help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make a drawing with Emacs


From: Tomas Hlavaty
Subject: Re: make a drawing with Emacs
Date: Fri, 04 Sep 2020 10:42:20 +0200

thanks, bug reported

On Thu 03 Sep 2020 at 15:52, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> (cl-defun foo (a &rest args &key b c)
>>   (cons a args))
>>
>> (foo 1 :b 2 :c 3)
>>
>> This works.
>>
>> But positioning cursor somewhere on :b 2 highlights args instead of b.
>> Strangely enough, positioning it on :c 3 highlights c correctly.
>
> Probably a happy accident.
>
>> If this worked it would be enough to use cl-defun and add key list
>> without having to change anything else.
>
> Indeed, that's a bug (or lack of feature).
> `M-x report-emacs-bug` seems to be in order.
>
>>> BTW, if you're only concerned about the Eldoc and `C-h o` info, then you
>>> can also just provide the more precise info in the docstring e.g.:
>>>
>>>     (defun svg-create (width height &rest args)
>>>       "Create a new, empty SVG image with dimensions WIDTH x HEIGHT.
>>>     ARGS can be used to provide `stroke' and `stroke-width' parameters to
>>>     any further elements added.
>>>
>>>     \(fn WIDTH HEIGHT &key STROKE STROKE-WIDTH)"
>>>       ...)
>>
>> I don't understand.  Should \(fn WIDTH HEIGHT &key STROKE STROKE-WIDTH)
>> in docstring magically make eldoc to work?  It does not work for me.
>
> It makes eldoc work the same way as `cl-defun` does (it's actually the
> mechanism used internally by eldoc to preserve the &key arguments into
> the `C-h o` and the eldoc output), but without having to change the
> actual code.
>
>
>         Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]