[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--
- bug#19338: [PATCH 0/3] Implement an ElDoc function which describes char at point, Michal Nazarewicz, 2014/12/10
- bug#19338: [PATCH 1/3] eldoc: use default eldoc function if local one gives no results, Michal Nazarewicz, 2014/12/10
- bug#19338: [PATCH 2/3] descr-text: add `describe-char-eldoc' describing character at point, Michal Nazarewicz, 2014/12/10
- bug#19338: [PATCH 3/3] eldoc: convert `eldoc-documentation-function' into a defcustom, Michal Nazarewicz, 2014/12/10
- bug#19338: [PATCH 1/3] eldoc: use default eldoc function if local one gives no results, Stefan Monnier, 2014/12/10
- bug#19338: [PATCH 1/3] eldoc: use default eldoc function if local one gives no results,
Michal Nazarewicz <=
- bug#19338: [PATCH 1/3] eldoc: use default eldoc function if local one gives no results, Stefan Monnier, 2014/12/10
- bug#19338: [PATCHv2 1/2] descr-text: add `describe-char-eldoc' describing character at point, Michal Nazarewicz, 2014/12/11
- bug#19338: [PATCHv2 2/2] eldoc: convert `eldoc-documentation-function' into a defcustom, Michal Nazarewicz, 2014/12/11
- bug#19338: [PATCHv2 1/2] descr-text: add `describe-char-eldoc' describing character at point, Leo Liu, 2014/12/11
- bug#19338: [PATCHv2 1/2] descr-text: add `describe-char-eldoc' describing character at point, Michal Nazarewicz, 2014/12/11
- bug#19338: [PATCHv2 1/2] descr-text: add `describe-char-eldoc' describing character at point, Eli Zaretskii, 2014/12/14
- bug#19338: [PATCHv3 1/2] descr-text: add `describe-char-eldoc' describing character at point, Michal Nazarewicz, 2014/12/14
- bug#19338: [PATCH 1/3] eldoc: use default eldoc function if local one gives no results, Stefan Monnier, 2014/12/11