emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James N. V. Cash <james.cash@occasionallycogent.com>
To: Kyle Meyer <kyle@kyleam.com>
Cc: bzg@gnu.org, , emacs-orgmode@gnu.org
Subject: Re: eldoc recursion error
Date: Sun, 20 Sep 2020 11:35:09 -0400	[thread overview]
Message-ID: <87mu1kxxzm.fsf@gmail.com> (raw)
In-Reply-To: <87tuvtvyig.fsf@kyleam.com>

Kyle Meyer <kyle@kyleam.com> writes:

> Using lexical-let here is problematic because it's obsolete since Emacs
> 24.  Taking a quick glance, I don't see any issues with switching this
> file over to lexical binding by adding " -*- lexical-binding: t; -*-" to
> the first line.

Cool, will do. I was concerned that the lexical-binding stanza was
missing for a reason, but I'll give it a shot.

> Also, why use
>
>     (doc-funs (symbol-value 'eldoc-documentation-functions))
>
> rather than
>
>     (doc-funs eldoc-documentation-functions)
>
> ?

Good question...I was doing that just because the original code does
~(symbol-value 'eldoc-documentation-function)~ and I assumed there was
some reason I didn't understand for doing so.

>> +         (lambda ()
>> +           (let ((eldoc-documentation-functions doc-funs))
>> +             (funcall eldoc-documentation-strategy))))
>> +             (and eldoc-documentation-function
>> +            (symbol-value 'eldoc-documentation-function))))
>
> nit: Please switch this to the Elisp style of indenting the `else' arm
> less than the `then' arm.

Oops, will do.

>> -(defun org-eldoc-documentation-function (&rest _ignored)
>> +(defun org-eldoc-documentation-function (&optional callback)
>
> Perhaps even with the callback parameter the &rest should stay around.
> The docstring of eldoc-documentation-functions makes me nervous because
> it says "each hook function is called with _at least_ one argument" (my
> emphasis).

Good call, will do.

> Hmm, I think the more complete approach you put together for
> org-eldoc-get-mode-local-documentation-function, along with your change
> to consider the callback parameter here, means we don't need to bother
> with the condition-case/wrong-number-of-arguments dance.  The callback
> alone should be a reliable indication we're on Emacs 28, in which case
> we can expect the function to accept a callback argument (even if they
> ignore it like python-eldoc-function does).

I was just thinking more about this, and I'm concerned I might need to
change things around a little bit more. The closure that
org-eldoc-get-mode-local-documentation-function now returns under Emacs
28 doesn't take any arguments and instead lets the
eldoc-documentation-strategy function create its own new callback.

I think the current approach will appear to work when the documentation
function returns a value directly, but if it uses the callback, then I
think that it won't, since it invokes a new, separate callback.

I will take another crack at addressing this and send another patch shortly.

> Thanks again for working on this.

My pleasure!


  reply	other threads:[~2020-09-20 15:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 19:22 eldoc recursion error James N V Cash
2020-09-17  4:55 ` Kyle Meyer
2020-09-17 15:03   ` James N. V. Cash
2020-09-20  4:54     ` Kyle Meyer
2020-09-20 15:35       ` James N. V. Cash [this message]
2020-09-20 15:49         ` James N. V. Cash
2020-09-20 23:38           ` Kyle Meyer
2020-09-21  1:07             ` James N. V. Cash
2020-09-21  1:36               ` Kyle Meyer
  -- strict thread matches above, loose matches on Subject: below --
2020-09-08 13:49 Matt Price
2020-09-08 14:24 ` Bastien
2020-09-08 14:49   ` Matt Price
2020-09-08 14:53     ` Bastien
2020-09-08 15:27       ` Matt Price
2020-09-08 16:19         ` Matt Price
2020-09-11  4:12           ` Kyle Meyer
2020-09-21  1:51             ` Kyle Meyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mu1kxxzm.fsf@gmail.com \
    --to=james.cash@occasionallycogent.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=kyle@kyleam.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).