[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] org-eldoc: Fix compatibility with Emacs 28
From: |
Kyle Meyer |
Subject: |
Re: [PATCH] org-eldoc: Fix compatibility with Emacs 28 |
Date: |
Fri, 17 Jul 2020 18:11:07 -0400 |
Basil L. Contovounesios writes:
>> @@ -161,11 +161,17 @@ (defun org-eldoc-documentation-function ()
>> (defun org-eldoc-load ()
>> "Set up org-eldoc documentation function."
>> (interactive)
>> - (if (boundp 'eldoc-documentation-functions)
>> - (add-hook 'eldoc-documentation-functions
>> - #'org-eldoc-documentation-function nil t)
>> - (setq-local eldoc-documentation-function
>> - #'org-eldoc-documentation-function)))
>> + ;; This approach is taken from python.el.
>> + (with-no-warnings
>> + (if (null eldoc-documentation-function)
>> + ;; Emacs<25
>> + (setq-local eldoc-documentation-function
>> + #'org-eldoc-documentation-function)
>> + (if (boundp 'eldoc-documentation-functions)
>> + (add-hook 'eldoc-documentation-functions
>> + #'org-eldoc-documentation-function nil t)
>> + (add-function :before-until (local 'eldoc-documentation-function)
>> + #'org-eldoc-documentation-function)))))
>
> LGTM. My only aesthetic nit would be to replace the nested if with a
> flat cond, but that's entirely up to you.
I agree with your preference, though it didn't cross my mind when I was
lazily copying over from python.el. Will update.
Thanks.