GNU bug report logs - #16920
24.3; fix eldoc-message to clear own message only

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Sun, 2 Mar 2014 07:19:02 UTC

Severity: minor

Found in version 24.3

Done: Leo Liu <sdl.web <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 16920 in the body.
You can then email your comments to 16920 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#16920; Package emacs. (Sun, 02 Mar 2014 07:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Liu <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Sun, 02 Mar 2014 07:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; fix eldoc-message to clear own message only
Date: Sun, 02 Mar 2014 15:18:10 +0800
I would like to fix eldoc-message for the upcoming release. Now that
eldoc can be used in the minibuffer there is one issue that can be
really annoying.

1. M-x eval-expression
2. type in (+ 1 1 |) ; | is the cursor
3. quickly pressing SPC repeatedly and then RET

The value 2 is shown and then cleared by eldoc (when eldoc-idle-delay is
short enough one may not see the value at all). The proposed fix is in
the following patch. Comments or objections?

=== modified file 'lisp/emacs-lisp/eldoc.el'
--- lisp/emacs-lisp/eldoc.el	2014-01-30 07:54:28 +0000
+++ lisp/emacs-lisp/eldoc.el	2014-03-02 07:14:45 +0000
@@ -255,7 +255,8 @@
     (let ((message-log-max nil))
       (cond (eldoc-last-message
 	     (funcall eldoc-message-function "%s" eldoc-last-message))
-	    (omessage (funcall eldoc-message-function nil)))))
+	    (omessage (and (equal omessage (current-message))
+			   (funcall eldoc-message-function nil))))))
   eldoc-last-message)
 
 (defun eldoc--message-command-p (command)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16920; Package emacs. (Fri, 07 Mar 2014 22:55:01 GMT) Full text and rfc822 format available.

Message #8 received at 16920 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 16920 <at> debbugs.gnu.org
Subject: Re: bug#16920: 24.3; fix eldoc-message to clear own message only
Date: Fri, 07 Mar 2014 17:54:53 -0500
> -	    (omessage (funcall eldoc-message-function nil)))))
> +	    (omessage (and (equal omessage (current-message))
> +			   (funcall eldoc-message-function nil))))))

This can't be right when eldoc-message-function doesn't use `message'.
So, we should probably move this test to the eldoc-message-function.


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16920; Package emacs. (Sat, 08 Mar 2014 07:33:02 GMT) Full text and rfc822 format available.

Message #11 received at 16920 <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 16920 <at> debbugs.gnu.org
Subject: Re: bug#16920: 24.3; fix eldoc-message to clear own message only
Date: Sat, 08 Mar 2014 15:32:25 +0800
On 2014-03-08 06:54 +0800, Stefan Monnier wrote:
> This can't be right when eldoc-message-function doesn't use `message'.
> So, we should probably move this test to the eldoc-message-function.
>
>
>         Stefan

The bug happens when exit minibuffer so we need to clear its state
thoroughly at exit time. How about something like this:

=== modified file 'lisp/emacs-lisp/eldoc.el'
--- lisp/emacs-lisp/eldoc.el	2014-01-30 07:54:28 +0000
+++ lisp/emacs-lisp/eldoc.el	2014-03-08 07:30:21 +0000
@@ -219,7 +219,9 @@
   (if (minibufferp)
       (progn
 	(add-hook 'minibuffer-exit-hook
-		  (lambda () (setq eldoc-mode-line-string nil))
+		  (lambda () (setq eldoc-mode-line-string nil
+			      ;; http://debbugs.gnu.org/16920
+			      eldoc-last-message nil))
 		  nil t)
 	(with-current-buffer
 	    (window-buffer




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#16920; Package emacs. (Mon, 10 Mar 2014 02:45:01 GMT) Full text and rfc822 format available.

Message #14 received at 16920 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 16920 <at> debbugs.gnu.org
Subject: Re: bug#16920: 24.3; fix eldoc-message to clear own message only
Date: Sun, 09 Mar 2014 22:44:46 -0400
> The bug happens when exit minibuffer so we need to clear its state
> thoroughly at exit time. How about something like this:
[...]
> -		  (lambda () (setq eldoc-mode-line-string nil))
> +		  (lambda () (setq eldoc-mode-line-string nil
> +			      ;; http://debbugs.gnu.org/16920
> +			      eldoc-last-message nil))

Sounds good, thanks,


        Stefan




Reply sent to Leo Liu <sdl.web <at> gmail.com>:
You have taken responsibility. (Mon, 10 Mar 2014 05:38:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Liu <sdl.web <at> gmail.com>:
bug acknowledged by developer. (Mon, 10 Mar 2014 05:38:02 GMT) Full text and rfc822 format available.

Message #19 received at 16920-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 16920-done <at> debbugs.gnu.org
Subject: Re: bug#16920: 24.3; fix eldoc-message to clear own message only
Date: Mon, 10 Mar 2014 13:37:13 +0800
Fixed in 24.4

On 2014-03-10 10:44 +0800, Stefan Monnier wrote:
> Sounds good, thanks,
>
>
>         Stefan

OK, installed.

Leo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 Apr 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 233 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.