[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/isearch-mb 01fdc36 19/20: Update Readme
From: |
Stefan Monnier |
Subject: |
[elpa] externals/isearch-mb 01fdc36 19/20: Update Readme |
Date: |
Sun, 16 May 2021 17:21:15 -0400 (EDT) |
branch: externals/isearch-mb
commit 01fdc36413b968ac846ab19b845070b619902dfe
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Update Readme
---
README.md | 67 +++++++++++++++++++++++++++++++++++++++++++--------------------
1 file changed, 46 insertions(+), 21 deletions(-)
diff --git a/README.md b/README.md
index d682160..e07490a 100644
--- a/README.md
+++ b/README.md
@@ -19,8 +19,8 @@ Keybindings
During a search, `isearch-mb-minibuffer-map` is active. By default,
it includes the following commands:
-- <kbd>C-s</kbd>: `isearch-repeat-forward`
-- <kbd>C-r</kbd>: `isearch-repeat-backward`
+- <kbd>C-s</kbd>, <kbd>↓</kbd>: `isearch-repeat-forward`
+- <kbd>C-r</kbd>, <kbd>↑</kbd>: `isearch-repeat-backward`
- <kbd>M-<</kbd>: `isearch-beginning-of-buffer`
- <kbd>M-></kbd>: `isearch-end-of-buffer`
- <kbd>M-%</kbd>: `isearch-query-replace`
@@ -71,37 +71,62 @@ strict whitespace matching with <kbd>M-s SPC</kbd> during a
search.
Interaction with other Isearch extensions
-----------------------------------------
-Some third-party Isearch extensions need to be patched to work with
-Isearch-Mb. There are three cases to consider:
+Some third-party Isearch extensions require a bit of configuration in
+order to work with Isearch-Mb. There are three cases to consider:
- **Commands that start a search** shouldn't require extra
configuration.
-
-- **Commands that operate during a search session** require the
- `isearch-mb--with-buffer` advice. Examples of this case are
- [`loccur-isearch`][loccur] and [`consult-isearch`][consult]:
-
+
+- **Commands that operate during a search session** should be added to
+ the list `isearch-mb--with-buffer`. Examples of this case are
+ [`loccur-isearch`][loccur] and [`consult-isearch`][consult].
+
+ ``` elisp
+ (add-to-list 'isearch-mb--with-buffer #'loccur-isearch)
+ (define-key isearch-mb-minibuffer-map (kbd "C-o") #'loccur-isearch)
+
+ (add-to-list 'isearch-mb--with-buffer #'consult-isearch)
+ (define-key isearch-mb-minibuffer-map (kbd "M-r") #'consult-isearch)
+ ```
+
+ Most Isearch commands that are not made available by default in
+ Isearch-Mb can also be used in this fashion:
+
``` elisp
- (advice-add 'loccur-isearch :around 'isearch-mb--with-buffer)
- (define-key isearch-mb-minibuffer-map (kbd "C-o") 'loccur-isearch)
-
- (advice-add 'consult-isearch :around 'isearch-mb--with-buffer)
- (define-key isearch-mb-minibuffer-map (kbd "M-r") 'consult-isearch)
+ (add-to-list 'isearch-mb--with-buffer #'isearch-yank-word)
+ (define-key isearch-mb-minibuffer-map (kbd "M-s C-w") #'isearch-yank-word)
```
-
-- **Commands that end the Isearch session** require the
- `isearch-mb--after-exit` advice. Examples of this case are
- [`anzu-isearch-query-replace`][anzu] and
- [`consult-line`][consult]:
+
+- **Commands that end the Isearch session** should be added to the
+ list `isearch-mb--after-exit`. Examples of this case are
+ [`anzu-isearch-query-replace`][anzu] and [`consult-line`][consult]:
``` elisp
- (advice-add 'anzu-isearch-query-replace :around 'isearch-mb--after-exit)
+ (add-to-list 'isearch-mb--after-exit #'anzu-isearch-query-replace)
(define-key isearch-mb-minibuffer-map (kbd "M-%")
'anzu-isearch-query-replace)
- (advice-add 'consult-line :around 'isearch-mb--after-exit)
+ (add-to-list 'isearch-mb--after-exit #'consult-line)
(define-key isearch-mb-minibuffer-map (kbd "M-s l") 'consult-line)
```
+ Making motion commands quit the search as in standard Isearch is out
+ of the scope of this package, but can achieved with a bit of work.
+ Here is one possibility:
+
+ ```elisp
+ (defun move-end-of-line-maybe-ending-isearch (arg)
+ "End search and move to end of line, but only if already at the end of the
minibuffer."
+ (interactive "p")
+ (if (eobp)
+ (isearch-mb--after-exit
+ (lambda ()
+ (move-end-of-line arg)
+ (isearch-done)))
+ (move-end-of-line arg)))
+
+ (define-key isearch-mb-minibuffer-map (kbd "C-e")
'move-end-of-line-maybe-ending-isearch)
+ ```
+
[consult]: https://github.com/minad/consult
[loccur]: https://github.com/fourier/loccur#isearch-integration
[anzu]: https://github.com/emacsorphanage/anzu
- [elpa] externals/isearch-mb a663c22 16/20: Better place to check if Isearch is still active, (continued)
- [elpa] externals/isearch-mb a663c22 16/20: Better place to check if Isearch is still active, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb dc603a9 03/20: Lazily highlight the whole buffer, to avoid missing overlays, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 40add97 01/20: Initial commit, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 8566108 02/20: Many changes, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 223b1b9 04/20: Introduce a buffer-local minor mode, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 5805f13 07/20: Add keybinding for newline, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb d075efe 06/20: Rename minor modes, move a test to the timer function, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 9f11fda 05/20: Several improvements, reorganization, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb a8d2a15 10/20: Provide future history, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb fccf1b7 08/20: Fix post-command hook for the failed search case, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 01fdc36 19/20: Update Readme,
Stefan Monnier <=
- [elpa] externals/isearch-mb c38032c 09/20: Display error messages occurring at the beginning of search, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 4aa89c1 13/20: Define only a global minor mode., Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 0b58b14 14/20: Require cl-lib when compiling, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb c491220 11/20: Use after-change-functions, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb c270809 20/20: Pad lazy count so that it only grows, Stefan Monnier, 2021/05/16