[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] feature/gnus-select c69a17d 025/218: * lisp/isearch.el (se
From: |
Andrew G Cohen |
Subject: |
[Emacs-diffs] feature/gnus-select c69a17d 025/218: * lisp/isearch.el (search-exit-option): Add option 'append'. |
Date: |
Fri, 14 Dec 2018 03:34:48 -0500 (EST) |
branch: feature/gnus-select
commit c69a17d62dc76c41815bb67e0e0084c60a9b3b7a
Author: Juri Linkov <address@hidden>
Commit: Andrew G Cohen <address@hidden>
* lisp/isearch.el (search-exit-option): Add option 'append'.
(isearch-pre-command-hook): Use it.
* doc/emacs/search.texi: Replace search-exit-option option nil with append.
https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00202.html
---
doc/emacs/search.texi | 2 +-
lisp/isearch.el | 13 +++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index 0de3aee..8ac9794 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -446,7 +446,7 @@ they are not themselves part of incremental search.
search exits the search before executing the command. Thus, the
command operates on the buffer from which you invoked the search.
However, if you customize the variable @code{search-exit-option} to
address@hidden, the characters which you type that are not interpreted by
address@hidden, the characters which you type that are not interpreted by
the incremental search are simply appended to the search string. This
is so you could include in the search string control characters, such
as @kbd{C-a}, that would normally exit the search and invoke the
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 96faa27..4f5f494 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -77,11 +77,14 @@ If `shift-move', extend the search string by motion commands
while holding down the shift key.
Both `move' and `shift-move' extend the search string by yanking text
that ends at the new position after moving point in the current buffer.
+If `append', the characters which you type that are not interpreted by
+the incremental search are simply appended to the search string.
If nil, run the command without exiting Isearch."
:type '(choice (const :tag "Terminate incremental search" t)
(const :tag "Edit the search string" edit)
(const :tag "Extend the search string by motion commands"
move)
(const :tag "Extend the search string by shifted motion keys"
shift-move)
+ (const :tag "Append control characters to the search string"
append)
(const :tag "Don't terminate incremental search" nil))
:version "27.1")
@@ -2452,13 +2455,15 @@ See more for options in `search-exit-option'."
this-command-keys-shift-translated))
(setq this-command-keys-shift-translated nil)
(setq isearch-pre-move-point (point)))
+ ;; Append control characters to the search string
+ ((eq search-exit-option 'append)
+ (when (cl-every #'characterp key)
+ (isearch-process-search-string key key))
+ (setq this-command 'ignore))
;; Other characters terminate the search and are then executed normally.
(search-exit-option
(isearch-done)
- (isearch-clean-overlays))
- ;; If search-exit-option is nil, run the command without exiting Isearch.
- (t
- (isearch-process-search-string key key)))))
+ (isearch-clean-overlays)))))
(defun isearch-post-command-hook ()
(cond
- [Emacs-diffs] feature/gnus-select c8fbb06 009/218: Remove some unused spam.el variables, (continued)
- [Emacs-diffs] feature/gnus-select c8fbb06 009/218: Remove some unused spam.el variables, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 754dd52 018/218: * lisp/mh-e/mh-e.el (mh-variant-set): Tweak failure message., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select e371b8a 017/218: * lisp/mh-e/mh-utils.el (mh-find-path): Add missing part of previous., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select f8efd23 019/218: Add OpenDocument formats to Tramp file archives, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select d2d8012 013/218: Replace some obsolete aliases in documentation, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5c6f7b3 007/218: Replace some obsolete aliases in documentation, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select bb63387 012/218: Minor improvements in manuals, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select f0512cd 016/218: Suppress "No MH variant found" message (bug#30669), Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 7ec13d7 011/218: Minor copyedits in display.texi, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 30510cf 026/218: Update from Gnulib, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select c69a17d 025/218: * lisp/isearch.el (search-exit-option): Add option 'append'.,
Andrew G Cohen <=
- [Emacs-diffs] feature/gnus-select 781d997 008/218: Replace some obsolete aliases in code, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 317b4d2 010/218: Fix display of TABs in hscrolled windows with line numbers, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select de2b09f 024/218: Add to "Completion Commands" Info node, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 4efd277 030/218: ; * lisp/org/org-table.el: Replace obsolete alias in comment., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 52b1442 003/218: Revert last commit, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 1d6e562 021/218: More minor changes in the manual, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 954d7ce 035/218: * test/Makefile.in (check-declare): New PHONY rule., Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 036f0fe 032/218: Fix string-to-number C-level mishandling, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 0160cc5 029/218: Avoid losing info when formatting integers, Andrew G Cohen, 2018/12/14
- [Emacs-diffs] feature/gnus-select 5276bca 052/218: Make transpose-regions interactive (Bug#30343), Andrew G Cohen, 2018/12/14