emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kyle Meyer <kyle@kyleam.com>
To: No Wayman <iarchivedmywholelife@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: eldoc error: (void-function nil) [9.3.7 (release_9.3.7-708-g5417e3 @ /home/n/.emacs.d/straight/build/org/)]
Date: Sat, 15 Aug 2020 02:21:21 -0400	[thread overview]
Message-ID: <87pn7sa0pq.fsf@kyleam.com> (raw)
In-Reply-To: <871rkas8o1.fsf@gmail.com>

No Wayman writes:

> Subject: [PATCH] org-eldoc: (org-eldoc-documentation-function): set
>  `eldoc-documentation-functions'
>
> * contrib/lisp/org-eldoc.el (org-eldoc-documentation-function):
>
> b2b587387 did not set eldoc-documentation-functions, resulting in
> `eldoc--invoke-strategy' throwing a void-fucntion error.

I'll plan to drop the unconventional blank line in the changelog entry
and s/fucntion/function/ when applying.

> ---
>  contrib/lisp/org-eldoc.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
> index aa1dcb41b..ce0b7ddc2 100644
> --- a/contrib/lisp/org-eldoc.el
> +++ b/contrib/lisp/org-eldoc.el
> @@ -138,7 +138,8 @@
>               (string= lang "emacs-lisp")
>               (string= lang "elisp")) (if (fboundp 'elisp-eldoc-documentation-function)
>                                           (elisp-eldoc-documentation-function)
> -                                       (let (eldoc-documentation-function)
> +                                       (let ((eldoc-documentation-functions
> +					      '(elisp-eldoc-var-docstring elisp-eldoc-funcall)))
>                                           (eldoc-print-current-symbol-info))))
>             ((or
>               (string= lang "c") ;; http://github.com/nflath/c-eldoc

This works on my end testing with Emacs 26.3 and the Emacs master branch.
For example

   #+begin_src elisp
     (message "ok")
   #+end_src

shows "message: (FORMAT-STRING &rest ARGS)" when point is positioned
after "message".  I don't have Emacs 24 at hand, but the
eldoc-documentation-function let-binding you're dropping should be
retained for it, I think.  Assuming it's fine with you, I'll squash this
into your patch.

diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el
index ce0b7ddc2..3b0999340 100644
--- a/contrib/lisp/org-eldoc.el
+++ b/contrib/lisp/org-eldoc.el
@@ -136,11 +136,16 @@ (defun org-eldoc-documentation-function (&rest _ignored)
    (let ((lang (org-eldoc-get-src-lang)))
      (cond ((or
              (string= lang "emacs-lisp")
-             (string= lang "elisp")) (if (fboundp 'elisp-eldoc-documentation-function)
-                                         (elisp-eldoc-documentation-function)
-                                       (let ((eldoc-documentation-functions
-					      '(elisp-eldoc-var-docstring elisp-eldoc-funcall)))
-                                         (eldoc-print-current-symbol-info))))
+             (string= lang "elisp"))
+	    (cond ((boundp 'eldoc-documentation-functions) ; Emacs>=28
+		   (let ((eldoc-documentation-functions
+			  '(elisp-eldoc-var-docstring elisp-eldoc-funcall)))
+		     (eldoc-print-current-symbol-info)))
+		  ((fboundp 'elisp-eldoc-documentation-function)
+		   (elisp-eldoc-documentation-function))
+		  (t  			; Emacs<25
+		   (let (eldoc-documentation-function)
+		     (eldoc-print-current-symbol-info)))))
            ((or
              (string= lang "c") ;; http://github.com/nflath/c-eldoc
              (string= lang "C")) (when (require 'c-eldoc nil t)


  parent reply	other threads:[~2020-08-15 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-13 18:27 Bug: eldoc error: (void-function nil) [9.3.7 (release_9.3.7-708-g5417e3 @ /home/n/.emacs.d/straight/build/org/)] No Wayman
2020-08-14  5:07 ` Kyle Meyer
2020-08-15  6:21 ` Kyle Meyer [this message]
2020-08-15 15:20   ` No Wayman
2020-08-15 17:19     ` 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=87pn7sa0pq.fsf@kyleam.com \
    --to=kyle@kyleam.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=iarchivedmywholelife@gmail.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).