all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: max.brieiev@gmail.com, larsi@gnus.org, 56459@debbugs.gnu.org,
	friedman@splode.com
Subject: bug#56459: 29.0.50; Edebug disables Eldoc
Date: Wed, 1 Mar 2023 21:19:05 +0200	[thread overview]
Message-ID: <f6ba1096-90d5-b2ae-89b2-91b1f2a6a4f0@yandex.ru> (raw)
In-Reply-To: <83bklcflzg.fsf@gnu.org>

On 01/03/2023 18:57, Eli Zaretskii wrote:
>> Date: Wed, 1 Mar 2023 18:06:56 +0200
>> Cc:max.brieiev@gmail.com,larsi@gnus.org,56459@debbugs.gnu.org,
>>   friedman@splode.com
>> From: Dmitry Gutov<dgutov@yandex.ru>
>>
>> On 01/03/2023 17:49, Eli Zaretskii wrote:
>>>> Cc:max.brieiev@gmail.com,larsi@gnus.org,56459@debbugs.gnu.org,
>>>>    friedman@splode.com
>>>> Date: Wed, 01 Mar 2023 17:42:07 +0200
>>>> From: Eli Zaretskii<eliz@gnu.org>
>>>>
>>>> So I've now reverted that change, and I'm reopening the bug.  It will
>>>> have to be fixed in some other way.
>>> One possibility would be to show the ElDoc info on the mode line when
>>> Edebug is active.  But the difficulty with that is to figure out how
>>> to revert the mode line to the original shape when Edebug finishes.
>>> We currently show the info on the mdoe line when the current buffer is
>>> a minibuffer, and remove the info in minibuffer-exit-hook, but how to
>>> do that in the Edebug case?
>> edebug-mode-hook?
> That's a starting point, but I don't think it's enough, because you
> could switch to another buffer without exiting Edebug.  I tried
> something like that and it didn't work well enough.  But maybe my
> testing was incorrect, so if you are confident that this fixes the
> problem, feel free to install (perhaps on master, though).

We could try to use more hooks, or give up and use post-command-hook.

Also switched to looking up edebug-mode instead of edebug-active because 
the latter is a global value.

diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 3f5cf0ad0dc..493ec18446f 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -296,13 +296,10 @@ eldoc-minibuffer-message
  This function displays the message produced by formatting ARGS
  with FORMAT-STRING on the mode line when the current buffer is a 
minibuffer.
  Otherwise, it displays the message like `message' would."
-  (if (minibufferp)
+  (defvar edebug-mode)
+  (if (or edebug-mode (minibufferp))
        (progn
-	(add-hook 'minibuffer-exit-hook
-		  (lambda () (setq eldoc-mode-line-string nil
-			      ;; https://debbugs.gnu.org/16920
-			      eldoc-last-message nil))
-		  nil t)
+        (add-hook 'post-command-hook #'eldoc-minibuffer--cleanup)
  	(with-current-buffer
  	    (window-buffer
  	     (or (window-in-direction 'above (minibuffer-window))
@@ -321,6 +318,14 @@ eldoc-minibuffer-message
            (force-mode-line-update)))
      (apply #'message format-string args)))

+(defun eldoc-minibuffer--cleanup ()
+  (defvar edebug-mode)
+  (unless (or edebug-mode (minibufferp))
+    (setq eldoc-mode-line-string nil
+          ;; https://debbugs.gnu.org/16920
+          eldoc-last-message nil)
+    (remove-hook 'post-command-hook #'eldoc-minibuffer--cleanup)))
+
  (make-obsolete
   'eldoc-message "use `eldoc-documentation-functions' instead." 
"eldoc-1.1.0")
  (defun eldoc-message (&optional string) (eldoc--message string))






  parent reply	other threads:[~2023-03-01 19:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-09  7:23 bug#56459: 29.0.50; Edebug disables Eldoc Max Brieiev
2022-07-11 10:49 ` Lars Ingebrigtsen
2022-07-11 11:52   ` Eli Zaretskii
2022-08-01  1:59     ` Noah Friedman
2022-08-01  2:52     ` Noah Friedman
2022-08-01 10:48       ` Lars Ingebrigtsen
2022-08-02  0:51         ` Noah Friedman
2022-08-02  9:58           ` Lars Ingebrigtsen
2023-02-28  2:15         ` Dmitry Gutov
2023-02-28 13:04           ` Eli Zaretskii
2023-02-28 16:25             ` Dmitry Gutov
2023-03-01 15:42               ` Eli Zaretskii
2023-03-01 15:49                 ` Eli Zaretskii
2023-03-01 16:06                   ` Dmitry Gutov
2023-03-01 16:57                     ` Eli Zaretskii
2023-03-01 18:25                       ` João Távora
2023-03-01 18:42                         ` Eli Zaretskii
2023-03-01 19:11                           ` João Távora
2023-03-01 19:19                       ` Dmitry Gutov [this message]
2023-03-01 19:25                         ` Eli Zaretskii
2023-03-01 19:39                           ` Dmitry Gutov
2023-03-01 19:58                             ` João Távora
2023-03-01 21:36                               ` Dmitry Gutov
2023-03-02  6:08                             ` Eli Zaretskii
2023-03-04  0:43                               ` Dmitry Gutov

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=f6ba1096-90d5-b2ae-89b2-91b1f2a6a4f0@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=56459@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=friedman@splode.com \
    --cc=larsi@gnus.org \
    --cc=max.brieiev@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 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.