From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#56459: 29.0.50; Edebug disables Eldoc Date: Wed, 1 Mar 2023 21:19:05 +0200 Message-ID: References: <87zghieol4.fsf@gmail.com> <871qurzzyv.fsf@gnus.org> <83pmibzx0k.fsf@gnu.org> <20220731195223.90596.FMU217810@trabanten-schwein.prv.splode.com> <87sfmg1bpf.fsf@gnus.org> <5dd202b1-3dfb-022a-d458-c0a13c1a2d59@yandex.ru> <83edqagcux.fsf@gnu.org> <0fc4cf3b-86af-027e-32f4-9c85e2650ae7@yandex.ru> <83ilfkfpgw.fsf@gnu.org> <83h6v4fp3z.fsf@gnu.org> <83bklcflzg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7357"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: max.brieiev@gmail.com, larsi@gnus.org, 56459@debbugs.gnu.org, friedman@splode.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 01 20:20:34 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXS08-0001dE-Kq for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Mar 2023 20:20:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXRzk-0008A3-85; Wed, 01 Mar 2023 14:20:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXRzf-00087L-S2 for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 14:20:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXRzf-00082T-1H for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 14:20:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pXRze-0005su-AL for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 14:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Mar 2023 19:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56459 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 56459-submit@debbugs.gnu.org id=B56459.167769835622563 (code B ref 56459); Wed, 01 Mar 2023 19:20:02 +0000 Original-Received: (at 56459) by debbugs.gnu.org; 1 Mar 2023 19:19:16 +0000 Original-Received: from localhost ([127.0.0.1]:54930 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXRyu-0005rr-7y for submit@debbugs.gnu.org; Wed, 01 Mar 2023 14:19:16 -0500 Original-Received: from mail-wm1-f46.google.com ([209.85.128.46]:43836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXRys-0005re-Ju for 56459@debbugs.gnu.org; Wed, 01 Mar 2023 14:19:15 -0500 Original-Received: by mail-wm1-f46.google.com with SMTP id l7-20020a05600c4f0700b003e79fa98ce1so174006wmq.2 for <56459@debbugs.gnu.org>; Wed, 01 Mar 2023 11:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1677698348; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=HbY3/G6gjtTpHFNDBRdVYyIPYLtD0isk/24iaB6ohvY=; b=WxoHrrzJNCrZaHhT8405stV2/BgOXYF0st8I59sjRX2fCvBk20UJK9hGt0yEPM0ws3 jepnAKahK/FpVj8vl0BZybO+gvC6e7+6jeZXgugF2WTww2//Y8bY95h/ROfLk+oxc6Pm 5CPilCoJpSAoItwdYBL0UTeP2IRXUSg0MIs85H7JUcjjQFP87nX4o8G+S2+qo5GWFDMl 9QPDjf8ONxXkiNEnsXBSVStO62P5F9czpTIrKPFRqToXsU4joIl6Hqk45u4cZidtNn7a 2X0nDNgU9py4DvMNoDizRKZq0NGxlGjogw5a6K0Zt3NpQHI30/jtkcWjb73bq7LQaD3r EqfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677698348; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HbY3/G6gjtTpHFNDBRdVYyIPYLtD0isk/24iaB6ohvY=; b=on2WngWZzdQ2ObTZj0Gkjad0Ot/Q8nQVMIncFXpnVPJOyKvsDJMRwbtayMC1LL3oeg bUH20aLHVFpzgQ6WjLWRQsFMdapQRmu4RDkNbj3jnvnTHLDGiRy/aycZUHnHMC1pPL0r MGmqNmFpyVz7PbsFXCeCXEZExPbhiaBpG0IwOyhbLSoLzVQ9cmSCnURscDJZV5VE49AO yRm2JpiNJDFB4ElvGqH7wfyfPD41CmLNxOSMq+8v4xez/iqIQ7l++ARHaw7Vg4pRLp0P zMVRcflJ7ZN49pktoFD7nUw8/ghwert6wMLzH/pvFtPHrDfp2I7Q8UpO2adP2AP0Jl8f +wNw== X-Gm-Message-State: AO0yUKUVDKFPKLyrKyi6a/ikBmtnHQrta7K22d9pbbfGNu5ZsoZeUdur wgjfHcIZj6IcndaZdc3v8wc= X-Google-Smtp-Source: AK7set9ko5KqZdpmRLwlWgqiPQAhCaQ1syNlixjct+LhX4D0+ceKLFQGc+YQOcdBKaUF39HhTw2aAA== X-Received: by 2002:a05:600c:43d5:b0:3eb:29fe:7bad with SMTP id f21-20020a05600c43d500b003eb29fe7badmr5852452wmn.1.1677698348454; Wed, 01 Mar 2023 11:19:08 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f5-20020a7bc8c5000000b003e896d953a8sm462717wml.17.2023.03.01.11.19.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Mar 2023 11:19:07 -0800 (PST) Content-Language: en-US In-Reply-To: <83bklcflzg.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257099 Archived-At: 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 >> >> 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 >>>> >>>> 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))