[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ergoemacs-mode 3fcd06c 163/325: Fix interrupting isearc
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ergoemacs-mode 3fcd06c 163/325: Fix interrupting isearch with a regular command |
Date: |
Sat, 23 Oct 2021 18:48:44 -0400 (EDT) |
branch: externals/ergoemacs-mode
commit 3fcd06c2684d365e46ccaf1781c021e6d737eea2
Author: Walter Landry <wlandry@caltech.edu>
Commit: Walter Landry <wlandry@caltech.edu>
Fix interrupting isearch with a regular command
---
ergoemacs-test.el | 2 +-
ergoemacs-themes.el | 28 +++++++++++++++++++---------
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/ergoemacs-test.el b/ergoemacs-test.el
index 152c1ce..b0778cf 100644
--- a/ergoemacs-test.el
+++ b/ergoemacs-test.el
@@ -265,7 +265,7 @@ sunt in culpa qui officia deserunt mollit anim id est
laborum.")
(ergoemacs-test-layout
:layout "us"
(ergoemacs-eshell-here)
- (should (eq 'ergoemacs-isearch-forward (key-binding (kbd "C-f"))))
+ (should (eq 'isearch-forward (key-binding (kbd "C-f"))))
(kill-buffer (current-buffer))))
(ert-deftest ergoemacs-test-isearch-works-with-region ()
diff --git a/ergoemacs-themes.el b/ergoemacs-themes.el
index ae1191e..b6d0465 100644
--- a/ergoemacs-themes.el
+++ b/ergoemacs-themes.el
@@ -338,7 +338,7 @@ calling any other ergoemacs-set-* function"
;; These go into the global map, so they can be overridden by a
;; local mode map.
- (global-set-key (kbd "C-f") 'ergoemacs-isearch-forward)
+ (global-set-key (kbd "C-f") 'isearch-forward)
(global-set-key (kbd "C-a") 'mark-whole-buffer)
(global-set-key (kbd "C-z") 'ergoemacs-undo)
@@ -471,19 +471,22 @@ calling any other ergoemacs-set-* function"
"Search and Replace"
(ergoemacs-define-key keymap (kbd "M-5") 'query-replace)
(ergoemacs-define-key keymap (kbd "M-%") 'query-replace-regexp)
- (ergoemacs-define-key keymap (kbd "M-;") 'ergoemacs-isearch-forward)
- (put 'ergoemacs-isearch-forward
+ (ergoemacs-define-key keymap (kbd "M-;") 'isearch-forward)
+ (put 'isearch-forward
:advertised-binding (ergoemacs-translate--event-layout
(vconcat (listify-key-sequence (kbd "M-;")))
)
)
- (ergoemacs-define-key keymap (kbd "M-:") 'ergoemacs-isearch-backward)
+ (ergoemacs-define-key keymap (kbd "M-:") 'isearch-backward)
;; We have to override this in isearch-mode-map because isearch
;; makes that keymap override everything else, including emulation
- ;; keymaps. We could put this logic in ergoemacs-isearch-forward,
- ;; but it feels better to have a separate function for a different
- ;; mode.
+ ;; keymaps.
+ ;;
+ ;; We can not put this logic into a custom isearch-forward, because
+ ;; it ends up breaking commands that exit isearch. For example,
+ ;; trying to go to the beginning of a line will terminate the
+ ;; search, but not also go to the beginning of the line.
(ergoemacs-define-key isearch-mode-map (kbd "M-;") 'isearch-repeat-forward)
;; Changing advertised-binding does not work. Maybe because it is
;; only defined within isearch-mode-map?
@@ -506,6 +509,13 @@ calling any other ergoemacs-set-* function"
;; used C-x C-q, since that is used to make uneditable things
;; editable.
(define-key isearch-mode-map (kbd "C-x C-q") 'isearch-edit-string)
+
+ ;; When editing a search in isearch, it uses the
+ ;; minibuffer-local-isearch-map keymap, which gets overridden by the
+ ;; global emulation keymap. So we override isearch-forward so that
+ ;; we can exit with the same commands as searching.
+ (define-key minibuffer-local-isearch-map [remap isearch-forward]
'isearch-forward-exit-minibuffer)
+ (define-key minibuffer-local-isearch-map [remap isearch-backward]
'isearch-reverse-exit-minibuffer)
)
(defun ergoemacs-set-switch (keymap)
@@ -840,9 +850,9 @@ calling any other ergoemacs-set-* function"
(define-key-after (current-global-map) [menu-bar search]
(cons "Search"
'(keymap
- (isearch-forward menu-item "String Forward..."
ergoemacs-isearch-forward
+ (isearch-forward menu-item "String Forward..." isearch-forward
:help "Search forward for a string as you type
it")
- (isearch-backward menu-item " Backward..."
ergoemacs-isearch-backward
+ (isearch-backward menu-item " Backward..." isearch-backward
:help "Search backwards for a string as you type
it")
(re-isearch-forward menu-item "Regexp Forward..."
isearch-forward-regexp
:help "Search forward for a regular expression
as you type it")
- [elpa] externals/ergoemacs-mode d84c00c 065/325: Add missing requires for ibuffer, (continued)
- [elpa] externals/ergoemacs-mode d84c00c 065/325: Add missing requires for ibuffer, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 7ce34ce 086/325: Remove some M-C-* entries in term-raw-map., Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 3690135 077/325: Remove more shift translation, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 1c84bf1 090/325: Reindent, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode b928611 071/325: Remove keyfreq, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 88ecca1 117/325: Cleanup and remove <next>, <pause>, <prior>, <mouse> bindings, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode cdfb329 134/325: Install calc bindings with a regular function, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 61218ba 138/325: Remove multiple-cursors and avy, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 0640576 161/325: Menu work, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 45688c2 164/325: Add better binding for Fill menu, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 3fcd06c 163/325: Fix interrupting isearch with a regular command,
Stefan Monnier <=
- [elpa] externals/ergoemacs-mode addfd4c 156/325: Use ergoemacs-override-keymap instead of a local keymap, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 35897ad 159/325: Fix menus so that "Open Recent" works, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 27e8a09 167/325: Remove more macros, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode f6aac16 172/325: Remove unused ergoemacs-command-loop, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode b6ad133 178/325: Remove M-O-fight test. It fails, but the keys work with manual tests, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 6c909f3 185/325: Remove the shutdown hook, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 615ec31 186/325: Really remove the startup and shutdown hooks, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode d475686 187/325: Remove require stuff, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode 209e00f 189/325: Fix a test, Stefan Monnier, 2021/10/23
- [elpa] externals/ergoemacs-mode c484389 201/325: Lots of tweaks to the help svg, Stefan Monnier, 2021/10/23