From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Leo Liu <sdl.web@gmail.com>
Cc: 13978@debbugs.gnu.org
Subject: bug#13978: 24.3; New minor mode eldoc-post-insert-mode
Date: Sat, 16 Mar 2013 17:55:21 -0400 [thread overview]
Message-ID: <jwvy5dnauut.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m1r4jfxi62.fsf@gmail.com> (Leo Liu's message of "Sun, 17 Mar 2013 03:23:49 +0800")
> The attached patch adds a new minor mode eldoc-post-insert-mode to
> eldoc.el; the new mode can also be used by eval-expression (screenshot
> attached). The feature supersedes eldoc-eval in GNU ELPA.
It's looking fairly good. Questions and comments inline below.
> +(defvar eval-expression-minibuffer-hook nil
> + "Hook run by `eval-expression' when entering the minibuffer.")
I'd call it eval-expression-minibuffer-setup-hook or maybe I'd just call
an emacs-lisp-minibuffer-mode (which might need to not be an actual
major-mode for technical reasons, but could try to be close to one).
I'd like to move towards using major modes in the minibuffer, so we
might as well plan for that future.
> +(defvar eldoc-message-function nil
> + "The function used by `eldoc-message' to display messages.
> +It should receive the same arguments as `message'. If this is
> +nil, `eldoc-minibuffer-message' is used.")
Please give it `eldoc-minibuffer-message' as default value rather
than nil. Better yet give it `message' as default value and set it to
a different value for in-minibuffer use.
> +(define-minor-mode eldoc-post-insert-mode nil
> + :group 'eldoc :lighter ""
> + (setq eldoc-last-message nil)
> + (let ((prn-info (lambda ()
> + (unless eldoc-mode
> + (eldoc-print-current-symbol-info-1)))))
> + (if eldoc-post-insert-mode
> + (add-hook 'post-self-insert-hook prn-info nil t)
> + (remove-hook 'post-self-insert-hook prn-info t))))
Shouldn't that be called `eldoc-minibuffer-mode'?
And why not just use eldoc-mode?
> -(defun eldoc-print-current-symbol-info ()
> +(defun eldoc-print-current-symbol-info-1 ()
[...]
> +(defun eldoc-print-current-symbol-info ()
> + (and (eldoc-display-message-p) (eldoc-print-current-symbol-info-1)))
I removed (not (eq (selected-window) (minibuffer-window)) and (not
cursor-in-echo-area) from my eldoc-display-message-no-interference-p
and haven't noticed any downside, so maybe we can just do that and avoid
creating eldoc-print-current-symbol-info-1 and eldoc-minibuffer-mode.
Stefan
next prev parent reply other threads:[~2013-03-16 21:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-16 19:23 bug#13978: 24.3; New minor mode eldoc-post-insert-mode Leo Liu
2013-03-16 21:55 ` Stefan Monnier [this message]
2013-03-17 2:56 ` Leo Liu
2013-03-17 3:39 ` Dmitry Gutov
2013-03-17 3:57 ` Leo Liu
2013-03-17 4:01 ` Dmitry Gutov
2013-03-17 4:09 ` Leo Liu
2013-03-17 12:10 ` Dmitry Gutov
2013-03-17 13:04 ` Stefan Monnier
2013-03-17 13:51 ` Leo Liu
2013-03-17 15:21 ` Leo Liu
2013-03-17 15:26 ` Stefan Monnier
2013-03-17 15:55 ` Leo Liu
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.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvy5dnauut.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=13978@debbugs.gnu.org \
--cc=sdl.web@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.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).