emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] Make org-eldoc work with Emacs 28


From: Kyle Meyer
Subject: Re: [PATCH] Make org-eldoc work with Emacs 28
Date: Thu, 16 Jul 2020 00:29:51 -0400

Basil L. Contovounesios writes:

> "James N. V. Cash" <james.nvc@gmail.com> writes:
>
>> This patch makes it continue to work by setting the new variable
>> eldoc-documentation-strategy, which puts eldoc in
>> "backwards-compatability" mode.
>
> How involved would it be to make org-eldoc work in
> non-"backwards-compatibility" mode?

I think we can do that, while still supporting Org's minimum Emacs
version, by following python.el.  Here's what it does:

  (with-no-warnings
    ;; supress warnings about eldoc-documentation-function being obsolete
    (if (null eldoc-documentation-function)
        ;; Emacs<25
        (set (make-local-variable 'eldoc-documentation-function)
             #'python-eldoc-function)
      (if (boundp 'eldoc-documentation-functions)
          (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil 
t)
        (add-function :before-until (local 'eldoc-documentation-function)
                      #'python-eldoc-function))))

And then...

>> -  (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)))
>> +  (cond
>> +   ((boundp 'eldoc-documentation-strategy)
>> +    (setq-local eldoc-documentation-strategy
>> +            #'org-eldoc-documentation-function))
>> +   ((boundp 'eldoc-documentation-functions)
>> +    (add-hook 'eldoc-documentation-functions
>> +          #'org-eldoc-documentation-function nil t))
>
> Both eldoc-documentation-strategy and eldoc-documentation-functions are
> new in Emacs 28, so if one is defined, then so is the other.
>
> More importantly, functions added to eldoc-documentation-functions must
> take at least one argument, so org-eldoc-documentation-function is not a
> suitable function in its current state.

... org-eldoc-documentation-function's signature could be changed to
(&rest _ignored), like python-eldoc-function's.



reply via email to

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