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

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

bug#19338: [PATCH 1/3] eldoc: use default eldoc function if local one gi


From: Michal Nazarewicz
Subject: bug#19338: [PATCH 1/3] eldoc: use default eldoc function if local one gives no results
Date: Wed, 10 Dec 2014 22:46:21 +0100
User-agent: Notmuch/0.19~rc1+1~g03aea4f (http://notmuchmail.org) Emacs/25.0.50.2 (x86_64-unknown-linux-gnu)

On Wed, Dec 10 2014, Stefan Monnier <monnier@IRO.UMontreal.CA> wrote:
>> -     (eldoc-message (funcall eldoc-documentation-function)))))
>> +         (eldoc-message
>> +          (or (funcall eldoc-documentation-function)
>> +              ;; If local documentation function did not return anything, 
>> try
>> +              ;; global one.
>> +              (when (local-variable-p 'eldoc-documentation-function)
>> +                (let ((func (default-value 'eldoc-documentation-function)))
>> +                  (when func (funcall func)))))))))
>
> We don't need that: if the major-mode wants that to happen, it can do
> that with an appropriate call to add-function, which will take care of
> delegating to the global value if/when applicable.
>
> This works very much like the add-hook's `local' argument.

So the point here is that I don't want major-mode to be aware of what
I might have set the default value of `eldoc-documentation-function' to
(and work even if I change it at any point).

This is also why I made `eldoc-documentation-function' into a defcustom
so user can customise the default value regardless of what major-mode is
doing.

I first tried doing it with `eldoc-mode' but the result didn't seem
clean or working correctly when major mode had its own eldoc function
set.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--





reply via email to

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