* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs @ 2009-05-02 15:28 Drew Adams 2012-01-29 10:14 ` Chong Yidong 2019-08-30 14:44 ` Mauro Aranda 0 siblings, 2 replies; 14+ messages in thread From: Drew Adams @ 2009-05-02 15:28 UTC (permalink / raw) To: emacs-pretest-bug emacs -Q (defcustom foo nil "..." :type '(alist :key-type (symbol) :value-type (function))) M-x customize-option foo Edit the Function field to nil (which is an invalid value). Click the State button and choose Set for Current Session. You see the message "Invalid function: nil" in the echo area. M-x tooltip-mode (to turn it off) Click the State button again and choose Set... No message is displayed. The message is logged in *Messages*, but the user sees nothing to indicate what, if anything, happened. Disabling tooltip-mode should mean only that mouseover :help text gets displayed in the echo area. It should not mean that if the mouse is over something (such as the State button) that has :help text defined then normal messages (including error messages) are inhibited. Also, clicking a button such as State, and choosing one of its menu items, should remove any mouseover :help text from the echo area - regardless of whether the menu item's invocation results in a message. In GNU Emacs 23.0.92.1 (i386-mingw-nt5.1.2600) of 2009-03-30 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (3.4)' ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2009-05-02 15:28 bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs Drew Adams @ 2012-01-29 10:14 ` Chong Yidong 2012-01-29 11:59 ` Juanma Barranquero 2019-08-30 14:44 ` Mauro Aranda 1 sibling, 1 reply; 14+ messages in thread From: Chong Yidong @ 2012-01-29 10:14 UTC (permalink / raw) To: Drew Adams; +Cc: 3192 "Drew Adams" <drew.adams@oracle.com> writes: > emacs -Q > > (defcustom foo nil > "..." > :type '(alist :key-type (symbol) :value-type (function))) > > M-x customize-option foo > > Edit the Function field to nil (which is an invalid value). > Click the State button and choose Set for Current Session. > > You see the message "Invalid function: nil" in the echo area. > > M-x tooltip-mode (to turn it off) > > Click the State button again and choose Set... > > No message is displayed. The message is logged in *Messages*, but the > user sees nothing to indicate what, if anything, happened. I can't reproduce this, either with Emacs 23 or trunk. ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2012-01-29 10:14 ` Chong Yidong @ 2012-01-29 11:59 ` Juanma Barranquero 0 siblings, 0 replies; 14+ messages in thread From: Juanma Barranquero @ 2012-01-29 11:59 UTC (permalink / raw) To: Chong Yidong; +Cc: 3192 On Sun, Jan 29, 2012 at 11:14, Chong Yidong <cyd@gnu.org> wrote: > I can't reproduce this, either with Emacs 23 or trunk. I can, with the trunk. But it only happens with the "Set for Current Session" option of the [STATE] menu. The [Set for current session] button above still produces the expected message. Juanma ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2009-05-02 15:28 bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs Drew Adams 2012-01-29 10:14 ` Chong Yidong @ 2019-08-30 14:44 ` Mauro Aranda 2019-08-31 2:34 ` Stefan Kangas 1 sibling, 1 reply; 14+ messages in thread From: Mauro Aranda @ 2019-08-30 14:44 UTC (permalink / raw) To: 3192 [-- Attachment #1: Type: text/plain, Size: 1209 bytes --] I'm able to reproduce with Emacs 26.2 on Windows, but not on GNU/Linux. When tooltip-mode is disabled, show-help-function is set to tooltip-show-help-non-mode. When this function is called with nil as the HELP argument, it may clear the echo area. But my analysis is that it is being called at two different times: On GNU/Linux, it is called right after the click in the button (in this case, the State button). So, the echo area is cleared. Then, clicking in the "Set for Current Session" item, triggers the error and then the error message is displayed. tooltip-show-help-non-mode is not called after that, so no cleaning happens. But on Windows, it is not called right after the click in the State button, rather it is called (with a nil argument) after the click in the item "Set for Current Session", which results in cleaning the echo area. That, in fact, is what clears the error message. It is possible to workaround this problem in tooltip-show-help-non-mode, but I would like to know if that is desirable, or other approach is preferred. Also, I don't know what happens on other systems other than GNU/Linux and Windows, so it would be good to have that information. Best regards, Mauro. [-- Attachment #2: Type: text/html, Size: 1337 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-08-30 14:44 ` Mauro Aranda @ 2019-08-31 2:34 ` Stefan Kangas 2019-09-01 10:43 ` Mauro Aranda 0 siblings, 1 reply; 14+ messages in thread From: Stefan Kangas @ 2019-08-31 2:34 UTC (permalink / raw) To: Mauro Aranda; +Cc: 3192 Mauro Aranda <maurooaranda@gmail.com> writes: > I don't know what happens on other systems other than GNU/Linux and > Windows, so it would be good to have that information. I'm not able to reproduce this on current master on macOS. I see these messages echoed in the minibuffer and in the *Messages* buffer: Tooltip mode enabled custom-variable-set: Invalid function: nil Tooltip mode disabled custom-variable-set: Invalid function: nil This is when invoking "Set for Current Session" according to the recipe given above. Thanks, Stefan Kangas ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-08-31 2:34 ` Stefan Kangas @ 2019-09-01 10:43 ` Mauro Aranda 2019-09-01 14:02 ` Eli Zaretskii 0 siblings, 1 reply; 14+ messages in thread From: Mauro Aranda @ 2019-09-01 10:43 UTC (permalink / raw) To: Stefan Kangas; +Cc: 3192 [-- Attachment #1.1: Type: text/plain, Size: 467 bytes --] Stefan Kangas <stefan@marxist.se> writes: > Mauro Aranda <maurooaranda@gmail.com> writes: > >> I don't know what happens on other systems other than GNU/Linux and >> Windows, so it would be good to have that information. > > I'm not able to reproduce this on current master on macOS. I see > these messages echoed in the minibuffer and in the *Messages* buffer: > Thank you Stefan. I propose the attached patch. > > Thanks, > Stefan Kangas Best regards, Mauro. [-- Attachment #1.2: Type: text/html, Size: 717 bytes --] [-- Attachment #2: 0001-With-tooltip-mode-disabled-don-t-unconditionally-cle.patch --] [-- Type: text/x-patch, Size: 1132 bytes --] From 2fcecc4efc443b8d7f58369f6cd64570913b9650 Mon Sep 17 00:00:00 2001 From: Mauro Aranda <maurooaranda@gmail.com> Date: Fri, 30 Aug 2019 10:11:11 -0300 Subject: [PATCH] With tooltip-mode disabled, don't unconditionally clear the echo area * lisp/tooltip.el (tooltip-show-help-non-mode): Only clear the echo area when the current message displayed is a tooltip message. (Bug#3192) --- lisp/tooltip.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/tooltip.el b/lisp/tooltip.el index b1c69ae..407531b 100644 --- a/lisp/tooltip.el +++ b/lisp/tooltip.el @@ -365,7 +365,10 @@ tooltip-show-help-non-mode (let ((message-log-max nil)) (message "%s" tooltip-previous-message) (setq tooltip-previous-message nil))) - (t + ;; Only stop displaying the message when the current message is our own. + ;; This has the advantage of not clearing the echo area when + ;; running after an error message was displayed. (Bug#3192) + ((equal-including-properties tooltip-help-message (current-message)) (message nil))))) (defun tooltip-show-help (msg) -- 2.7.4 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-09-01 10:43 ` Mauro Aranda @ 2019-09-01 14:02 ` Eli Zaretskii 2019-09-02 11:16 ` Mauro Aranda 0 siblings, 1 reply; 14+ messages in thread From: Eli Zaretskii @ 2019-09-01 14:02 UTC (permalink / raw) To: Mauro Aranda; +Cc: stefan, 3192 > From: Mauro Aranda <maurooaranda@gmail.com> > Date: Sun, 1 Sep 2019 07:43:42 -0300 > Cc: 3192@debbugs.gnu.org > > + ;; Only stop displaying the message when the current message is our own. > + ;; This has the advantage of not clearing the echo area when > + ;; running after an error message was displayed. (Bug#3192) > + ((equal-including-properties tooltip-help-message (current-message)) > (message nil))))) I think this will effectively disable tooltip messages in the echo area in too many situations. How about if we show the tooltip in these cases for only some short enough period of time, like 2 sec, and then restore the original contents of the echo area? ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-09-01 14:02 ` Eli Zaretskii @ 2019-09-02 11:16 ` Mauro Aranda 2019-09-07 9:55 ` Eli Zaretskii 0 siblings, 1 reply; 14+ messages in thread From: Mauro Aranda @ 2019-09-02 11:16 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Stefan Kangas, 3192 [-- Attachment #1: Type: text/plain, Size: 1724 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> From: Mauro Aranda <maurooaranda@gmail.com> >> Date: Sun, 1 Sep 2019 07:43:42 -0300 >> Cc: 3192@debbugs.gnu.org >> >> + ;; Only stop displaying the message when the current message is our own. >> + ;; This has the advantage of not clearing the echo area when >> + ;; running after an error message was displayed. (Bug#3192) >> + ((equal-including-properties tooltip-help-message (current-message)) >> (message nil))))) > > I think this will effectively disable tooltip messages in the echo > area in too many situations. Sorry, I don't think I follow. The clause I propose would replace a clause whose condition is `t'. So the new code would run, at most, in the same cases that the current code, right? And the two clauses (the current, and my proposed replace) call `message' with a nil argument, so if there is some disabling, it is already happening, right? But I can't figure out why this code (or the current code) would be disabling tooltip messages. AFAIU, the case when there is some message to show is already handled in the first of the clauses, with the condition: (stringp help). > How about if we show the tooltip in these cases for only some short > enough period of time, like 2 sec, and then restore the original > contents of the echo area? There should be no tooltip message to show, because this condition would be reached if HELP is nil. (HELP might be either a string or nil, just like in `tooltip-show-help' function). So I think when the two previous conditions were not meet, it indicates that it is time to clear the echo area. But we shouldn't do that unconditionally, only when the current message is that of a tooltip. [-- Attachment #2: Type: text/html, Size: 2133 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-09-02 11:16 ` Mauro Aranda @ 2019-09-07 9:55 ` Eli Zaretskii 2019-09-07 21:14 ` Mauro Aranda 0 siblings, 1 reply; 14+ messages in thread From: Eli Zaretskii @ 2019-09-07 9:55 UTC (permalink / raw) To: Mauro Aranda; +Cc: stefan, 3192 > From: Mauro Aranda <maurooaranda@gmail.com> > Date: Mon, 2 Sep 2019 08:16:21 -0300 > Cc: Stefan Kangas <stefan@marxist.se>, 3192@debbugs.gnu.org > > >> + ;; Only stop displaying the message when the current message is our own. > >> + ;; This has the advantage of not clearing the echo area when > >> + ;; running after an error message was displayed. (Bug#3192) > >> + ((equal-including-properties tooltip-help-message (current-message)) > >> (message nil))))) > > > > I think this will effectively disable tooltip messages in the echo > > area in too many situations. > > Sorry, I don't think I follow. The clause I propose would replace a > clause whose condition is `t'. So the new code would run, at most, in the > same cases that the current code, right? And the two clauses (the > current, and my proposed replace) call `message' with a nil argument, so > if there is some disabling, it is already happening, right? My point is that this fix is not as good as possible. I'm asking whether we can do better than this. If not, can you explain why not? > But I can't figure out why this code (or the current code) would be > disabling tooltip messages. AFAIU, the case when there is some message > to show is already handled in the first of the clauses, with the > condition: (stringp help). If this is already handled, then why do we need this change at all? What use case does it handle that the current code doesn't? > > How about if we show the tooltip in these cases for only some short > > enough period of time, like 2 sec, and then restore the original > > contents of the echo area? > > There should be no tooltip message to show, because this condition would > be reached if HELP is nil. (HELP might be either a string or nil, just > like in `tooltip-show-help' function). So I think when the two > previous conditions were not meet, it indicates that it is time to clear > the echo area. But we shouldn't do that unconditionally, only when the > current message is that of a tooltip. Then I guess I didn't understand your analysis of the original use case and what happens there. Could you perhaps describe that use case in more detail? Thanks. ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-09-07 9:55 ` Eli Zaretskii @ 2019-09-07 21:14 ` Mauro Aranda 2019-09-14 8:27 ` Eli Zaretskii 0 siblings, 1 reply; 14+ messages in thread From: Mauro Aranda @ 2019-09-07 21:14 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Stefan Kangas, 3192 [-- Attachment #1: Type: text/plain, Size: 5221 bytes --] Eli Zaretskii <eliz@gnu.org> writes: >> From: Mauro Aranda <maurooaranda@gmail.com> >> Date: Mon, 2 Sep 2019 08:16:21 -0300 >> Cc: Stefan Kangas <stefan@marxist.se>, 3192@debbugs.gnu.org >> >> >> + ;; Only stop displaying the message when the current message is our own. >> >> + ;; This has the advantage of not clearing the echo area when >> >> + ;; running after an error message was displayed. (Bug#3192) >> >> + ((equal-including-properties tooltip-help-message (current-message)) >> >> (message nil))))) >> > >> > I think this will effectively disable tooltip messages in the echo >> > area in too many situations. >> >> Sorry, I don't think I follow. The clause I propose would replace a >> clause whose condition is `t'. So the new code would run, at most, in the >> same cases that the current code, right? And the two clauses (the >> current, and my proposed replace) call `message' with a nil argument, so >> if there is some disabling, it is already happening, right? > > My point is that this fix is not as good as possible. I'm asking > whether we can do better than this. If not, can you explain why not? Apologies for not getting your point, then. See the last part of my response, where a try to explain the situation the best I can. >> But I can't figure out why this code (or the current code) would be >> disabling tooltip messages. AFAIU, the case when there is some message >> to show is already handled in the first of the clauses, with the >> condition: (stringp help). > > If this is already handled, then why do we need this change at all? > What use case does it handle that the current code doesn't? Because it's handling a different case, the case where we got nil as the argument, indicating us that we should stop showing a tooltip message. And we need a change, because there is a bug: The user cannot see an error message because it is cleared by the `tooltip-show-help-non-mode' function, and that shouldn't happen. It handles the situation were there was an error message shown after a tooltip message, but before the code gets a chance to clear the tooltip message from the echo area. IOW, when an error message is shown in-between the showing/hiding mechanism of the tooltip code. >> > How about if we show the tooltip in these cases for only some short >> > enough period of time, like 2 sec, and then restore the original >> > contents of the echo area? >> >> There should be no tooltip message to show, because this condition would >> be reached if HELP is nil. (HELP might be either a string or nil, just >> like in `tooltip-show-help' function). So I think when the two >> previous conditions were not meet, it indicates that it is time to clear >> the echo area. But we shouldn't do that unconditionally, only when the >> current message is that of a tooltip. > > Then I guess I didn't understand your analysis of the original use > case and what happens there. Could you perhaps describe that use case > in more detail? > > Thanks. `tooltip-show-help-non-mode' should handle two situations: 1) when there is a message to show, show it; 2) when there is no message to show, hide it. Both situations are distinguished by the type of the argument. For the 1st case, the argument is a string; for the 2nd case the argument is nil. Additionally, it needs to save the previous message shown (if it is not a tooltip one), to restore it when transitioning from the 1st case to the 2nd case. This previous message shown can be, again, either a string or nil, with nil meaning there was no previous message shown. So far so good, let's go to the implementation. In order: 1) If the argument is a string, then show the message. If the previous message shown was not a tooltip one (e.g., it is an error message), save it, to restore it later. This is the only chance that `tooltip-show-help-non-mode' gets to store the perhaps present error message. This is very important. 2) If the argument is not a string, then we should stop showing the tooltip message. But what should we show? The previous message, that we stored in the 1st case. And if we didn't store a string as a previous message, we have nothing to restore, so we clear the echo area with a (message nil) call. With that in mind, we can see when this bugs shows up: The bug shows up when something happens between transitioning from the 1st case to the 2nd case. In the recipe provided, there is an error echoed, that `tooltip-show-help-non-mode' can't grab because it ran the 1st case before the error. And because it didn't store anything, when running the 2nd case it clears clears the echo area. This has the consequence of not letting the user see the error message. So what I suggest is making `tooltip-show-help-non-mode' a little more careful when clearing the echo area. That is, clear the echo area only if we are certain that the last message shown was ours. To finally answer your first question, I couldn't find a better fix for this. I didn't see any drawbacks, and I'm certain it improves the situation, so I proposed it. Does my explanation make sense to you? If it is not enough, would you explain to me what do you expect the fix to accomplish? [-- Attachment #2: Type: text/html, Size: 6231 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-09-07 21:14 ` Mauro Aranda @ 2019-09-14 8:27 ` Eli Zaretskii 2019-09-16 14:43 ` Mauro Aranda 0 siblings, 1 reply; 14+ messages in thread From: Eli Zaretskii @ 2019-09-14 8:27 UTC (permalink / raw) To: Mauro Aranda; +Cc: stefan, 3192 > From: Mauro Aranda <maurooaranda@gmail.com> > Date: Sat, 7 Sep 2019 18:14:00 -0300 > Cc: Stefan Kangas <stefan@marxist.se>, 3192@debbugs.gnu.org > > Does my explanation make sense to you? It does, thanks. I guess I'm okay with the proposed patch. ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-09-14 8:27 ` Eli Zaretskii @ 2019-09-16 14:43 ` Mauro Aranda 2019-09-16 20:18 ` Lars Ingebrigtsen 0 siblings, 1 reply; 14+ messages in thread From: Mauro Aranda @ 2019-09-16 14:43 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Stefan Kangas, 3192 [-- Attachment #1: Type: text/plain, Size: 484 bytes --] tags 3192 patch quit Eli Zaretskii <eliz@gnu.org> writes: >> From: Mauro Aranda <maurooaranda@gmail.com> >> Date: Sat, 7 Sep 2019 18:14:00 -0300 >> Cc: Stefan Kangas <stefan@marxist.se>, 3192@debbugs.gnu.org >> >> Does my explanation make sense to you? > > It does, thanks. I guess I'm okay with the proposed patch. Great, thanks. If there are no more objections, could someone push the change? It's at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3192#20 Best regards, Mauro. [-- Attachment #2: Type: text/html, Size: 897 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-09-16 14:43 ` Mauro Aranda @ 2019-09-16 20:18 ` Lars Ingebrigtsen 2019-09-16 22:20 ` Mauro Aranda 0 siblings, 1 reply; 14+ messages in thread From: Lars Ingebrigtsen @ 2019-09-16 20:18 UTC (permalink / raw) To: Mauro Aranda; +Cc: Stefan Kangas, 3192 Mauro Aranda <maurooaranda@gmail.com> writes: > If there are no more objections, could someone push the change? > It's at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3192#20 I've now pushed the change. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ^ permalink raw reply [flat|nested] 14+ messages in thread
* bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs 2019-09-16 20:18 ` Lars Ingebrigtsen @ 2019-09-16 22:20 ` Mauro Aranda 0 siblings, 0 replies; 14+ messages in thread From: Mauro Aranda @ 2019-09-16 22:20 UTC (permalink / raw) To: Lars Ingebrigtsen; +Cc: Stefan Kangas, 3192 [-- Attachment #1: Type: text/plain, Size: 270 bytes --] Lars Ingebrigtsen <larsi@gnus.org> writes: > Mauro Aranda <maurooaranda@gmail.com> writes: > >> If there are no more objections, could someone push the change? >> It's at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3192#20 > > I've now pushed the change. Thank you. [-- Attachment #2: Type: text/html, Size: 515 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2019-09-16 22:20 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-05-02 15:28 bug#3192: 23.0.92; disabling tooltip-mode inhibits showing Customize error msgs Drew Adams 2012-01-29 10:14 ` Chong Yidong 2012-01-29 11:59 ` Juanma Barranquero 2019-08-30 14:44 ` Mauro Aranda 2019-08-31 2:34 ` Stefan Kangas 2019-09-01 10:43 ` Mauro Aranda 2019-09-01 14:02 ` Eli Zaretskii 2019-09-02 11:16 ` Mauro Aranda 2019-09-07 9:55 ` Eli Zaretskii 2019-09-07 21:14 ` Mauro Aranda 2019-09-14 8:27 ` Eli Zaretskii 2019-09-16 14:43 ` Mauro Aranda 2019-09-16 20:18 ` Lars Ingebrigtsen 2019-09-16 22:20 ` Mauro Aranda
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).