bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16035: 24.3.50; Custom isearch broken on trunk (e.g. change-log-mode


From: Anders Lindgren
Subject: bug#16035: 24.3.50; Custom isearch broken on trunk (e.g. change-log-mode)
Date: Tue, 17 Dec 2013 07:17:19 +0100

Hi!

I just tried the patch. It solved the problem I reported. However, when I did some more testing I realized that there is still a difference between ESC and the real meta key. ESC c toggles case-sensitivity. However, Meta-c doesn't (it exits the search).

    -- Anders


On Mon, Dec 16, 2013 at 9:32 PM, Juri Linkov <juri@jurta.org> wrote:
> I just found another (minor) detail problem regarding the new isearch
> system.
>
> I sometimes use ESCAPE as the meta key. However, to exit an isearch search,
> pressing the real meta key (Cmd, on my mac) and < work as intended.
> However, the sequence ESCAPE < does not. Emacs simply responds that
> "<escape> < is undefined".

Hopefully, the following patch fixes this in a correct way.
At least, it works in all tests that I tried:

C-s ESC <       - exits isearch and goes to the top
C-s ESC c       - doesn't exit isearch and toggles case-sensitivity
C-s ESC ESC ESC - cancels isearch

=== modified file 'lisp/isearch.el'
--- lisp/isearch.el     2013-12-06 00:55:20 +0000
+++ lisp/isearch.el     2013-12-16 20:28:12 +0000
@@ -435,8 +435,7 @@ (defvar isearch-mode-map
     ;; would be simpler to disable the global keymap, and/or have a
     ;; default local key binding for any key not otherwise bound.
     (let ((meta-map (make-sparse-keymap)))
-      (define-key map (char-to-string meta-prefix-char) meta-map)
-      (define-key map [escape] meta-map))
+      (define-key map (char-to-string meta-prefix-char) meta-map))

     ;; Several non-printing chars change the searching behavior.
     (define-key map "\C-s" 'isearch-repeat-forward)
@@ -453,7 +452,6 @@ (defvar isearch-mode-map
     (or (= ?\e meta-prefix-char)
        (error "Inconsistency in isearch.el"))
     (define-key map "\e\e\e" 'isearch-cancel)
-    (define-key map  [escape escape escape] 'isearch-cancel)

     (define-key map "\C-q" 'isearch-quote-char)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]