GNU bug report logs -
#43966
Isearch, C-g and f10 interact to leave Isearch in an inconsistent state.
Previous Next
Reported by: Alan Mackenzie <acm <at> muc.de>
Date: Mon, 12 Oct 2020 17:08:02 UTC
Severity: normal
Tags: fixed
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
>>> However, point can be freely moved by, e.g., C-f or C-b., without
>>> terminating the Isearch. This is a bug.
>>
>> This is because 'isearch-menu-bar-commands' contains 'menu-bar-open'
>> added in bug#32990 to allow invocation of isearch commands from menu.
>
> bug#32990 was a very long thread, so I didn't read that -- but does this
> mean that the reported behaviour isn't a bug?
It's still a bug. The problem is that when the menu-bar is disabled,
menu-bar-open calls tmm-menubar directly, but in isearch-mode
isearch-tmm-menubar should be used instead. isearch-mode-map remaps
tmm-menubar to isearch-tmm-menubar, but this doesn't help
in case of menu-bar-open calling tmm-menubar directly.
I see no way to fix this other than handling isearch-mode in tmm-menubar:
[isearch-tmm-menubar.patch (text/x-diff, inline)]
diff --git a/lisp/isearch.el b/lisp/isearch.el
index a86678572c..a1e3fe2c3f 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -513,7 +513,7 @@ isearch-tmm-menubar
(call-interactively command)))
(defvar isearch-menu-bar-commands
- '(isearch-tmm-menubar menu-bar-open mouse-minor-mode-menu)
+ '(isearch-tmm-menubar tmm-menubar menu-bar-open mouse-minor-mode-menu)
"List of commands that can open a menu during Isearch.")
(defvar isearch-menu-bar-yank-map
@@ -787,7 +787,6 @@ isearch-mode-map
(define-key map [menu-bar search-menu]
(list 'menu-item "Isearch" isearch-menu-bar-map))
- (define-key map [remap tmm-menubar] 'isearch-tmm-menubar)
map)
"Keymap for `isearch-mode'.")
diff --git a/lisp/tmm.el b/lisp/tmm.el
index e49246a5c4..2040f52270 100644
--- a/lisp/tmm.el
+++ b/lisp/tmm.el
@@ -56,12 +56,14 @@ tmm-menubar
`tty-menu-open-use-tmm' to a non-nil value."
(interactive)
(run-hooks 'menu-bar-update-hook)
- (let ((menu-bar (menu-bar-keymap))
- (menu-bar-item-cons (and x-position
- (menu-bar-item-at-x x-position))))
- (tmm-prompt menu-bar
- nil
- (and menu-bar-item-cons (car menu-bar-item-cons)))))
+ (if isearch-mode
+ (isearch-tmm-menubar)
+ (let ((menu-bar (menu-bar-keymap))
+ (menu-bar-item-cons (and x-position
+ (menu-bar-item-at-x x-position))))
+ (tmm-prompt menu-bar
+ nil
+ (and menu-bar-item-cons (car menu-bar-item-cons))))))
;;;###autoload
(defun tmm-menubar-mouse (event)
This bug report was last modified 4 years and 115 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.