all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Mark Oteiza <mvoteiza@udel.edu>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	npostavs@users.sourceforge.net,
	Noam Postavsky <npostavs@gmail.com>,
	28257@debbugs.gnu.org
Subject: bug#28257: 26.0.50; [PATCH] expose eldoc functions in a hook
Date: Fri, 14 Feb 2020 09:50:47 -0500	[thread overview]
Message-ID: <jwvimk9p73t.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <20200126234731.GA12794@holos.localdomain> (Mark Oteiza's message of "Sun, 26 Jan 2020 18:47:31 -0500")

> +*** 'eldoc-documentation-function' is now a custom variable.

I think this should be expanded to clarify that packages should stop
using this var and use `eldoc-documentation-functions` instead.

>  (defun eldoc--supported-p ()
>    "Non-nil if an ElDoc function is set for this buffer."
> -  (not (memq eldoc-documentation-function '(nil ignore))))
> +  (let ((hook 'eldoc-documentation-functions))
> +    (and eldoc-documentation-function
> +         (or (and (local-variable-p hook)
> +                  (buffer-local-value hook (current-buffer)))
> +             (default-value hook)))))

The

    (and eldoc-documentation-function

should really be

    (and (not (memq eldoc-documentation-function '(nil ignore))))

>  ;;;###autoload
> -(defvar eldoc-documentation-function #'ignore
> +(defvar eldoc-documentation-functions nil

There's no reason to autoload this new var.
[ Of course, it makes no practical difference since eldoc is preloaded
  anyway, but if it weren't preloaded this var should be autoloaded.  ]

> +(defun eldoc-documentation-default ()
> +  "Show doc string for item at point.
> +Default value for `eldoc-documentation-function'."

This doc should clarify that it shows the *first* doc.

> +;;;###autoload
> +(defcustom eldoc-documentation-function #'eldoc-documentation-default

Now that it's a defcustom this shouldn't be autoloaded either (currently
packages are expected to use `add-function` on it even if there's no
indication that the user will actually use eldoc, which is why it is/was
autoloaded.  But with its new meaning this need disappears).

> +  (if (> emacs-major-version 25)
> +      (add-hook 'eldoc-documentation-functions
> +                #'cfengine3-documentation-function nil t)

The test should be fixed (I guess you could use (boundp
'eldoc-documentation-functions)).

> +    (if (< emacs-major-version 26)
> +        (add-function :before-until (local 'eldoc-documentation-function)
> +                      #'python-eldoc-function)
> +      (add-hook 'eldoc-documentation-functions #'python-eldoc-function nil t)))

Same here.


        Stefan






  parent reply	other threads:[~2020-02-14 14:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-28  2:10 bug#28257: 26.0.50; [PATCH] expose eldoc functions in a hook Mark Oteiza
2017-08-28  2:49 ` npostavs
2017-08-28  3:11   ` Mark Oteiza
2017-08-29  1:05     ` npostavs
2017-08-30  1:50       ` Mark Oteiza
2019-06-24 16:16         ` Lars Ingebrigtsen
2019-06-24 22:51           ` Noam Postavsky
2019-06-26 14:03             ` Mark Oteiza
2020-01-26 23:47               ` Mark Oteiza
2020-01-31 14:05                 ` Eli Zaretskii
2020-02-08 10:03                   ` Eli Zaretskii
2020-02-11 21:57                     ` Noam Postavsky
2020-02-14  9:58                       ` Eli Zaretskii
2020-02-14 14:51                         ` Stefan Monnier
2020-02-14 14:50                 ` Stefan Monnier [this message]
2020-02-14 22:54                   ` Mark Oteiza
2020-02-21  8:47                     ` Eli Zaretskii
2020-02-25 23:18                       ` Mark Oteiza
2020-08-10 14:42                         ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=jwvimk9p73t.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=28257@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=mvoteiza@udel.edu \
    --cc=npostavs@gmail.com \
    --cc=npostavs@users.sourceforge.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.