From: Alan Mackenzie <acm@muc.de>
To: Juri Linkov <juri@jurta.org>, Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Drew Adams <drew.adams@oracle.com>, emacs-devel@gnu.org
Subject: isearch-allow-prefix [Was: [PATCH] Make `C-x {' and `C-x }' repeatable]
Date: Sun, 2 Jun 2013 21:05:12 +0000 [thread overview]
Message-ID: <20130602210512.GC2765@acm.acm> (raw)
In-Reply-To: <878v32aj3c.fsf@mail.jurta.org>
Hi, Juri and Stefan.
On Sat, May 25, 2013 at 11:40:55PM +0300, Juri Linkov wrote:
> >> There is an unaddressed request for this feature in bug#9706.
> > If I remember correctly, the patch to the code was finished and working
> > (and who knows, might still work), but the patch to the manual hadn't yet
> > been written.
> I highly recommend enabling `isearch-allow-prefix' by default
> in your patch, provided that it can correctly apply a specified
> argument either to a isearch command (that doesn't exit isearch)
> or to a normal command (that exits isearch).
> IOW, if `C-u C-M-y' typed in isearch-mode will apply `C-u'
> to `isearch-yank-char' without exiting isearch, but `C-u C-f'
> will exit isearch and apply `C-u' to `forward-char', then
> the default value of `isearch-allow-prefix' should be `t'.
OK. Here is a patch for isearch.el, search.texi and NEWS. I'm not
terribly impressed by the documentation patch, but it was the best I
could manage.
Do you have any comments on the patch, or should I just commit it?
=== modified file 'doc/emacs/emacs.texi'
*** doc/emacs/emacs.texi 2013-03-30 16:47:07 +0000
--- doc/emacs/emacs.texi 2013-06-02 18:25:29 +0000
***************
*** 396,409 ****
Incremental Search
! * Basic Isearch:: Basic incremental search commands.
! * Repeat Isearch:: Searching for the same string again.
! * Error in Isearch:: When your string is not found.
! * Special Isearch:: Special input in incremental search.
! * Isearch Yank:: Commands that grab text into the search string
! or else edit the search string.
! * Isearch Scroll:: Scrolling during an incremental search.
! * Isearch Minibuffer:: Incremental search of the minibuffer history.
Replacement Commands
--- 396,410 ----
Incremental Search
! * Basic Isearch:: Basic incremental search commands.
! * Repeat Isearch:: Searching for the same string again.
! * Error in Isearch:: When your string is not found.
! * Prefix Argument in Isearch:: What prefix arguments do.
! * Special Isearch:: Special input in incremental search.
! * Isearch Yank:: Commands that grab text into the search string
! or else edit the search string.
! * Isearch Scroll:: Scrolling during an incremental search.
! * Isearch Minibuffer:: Incremental search of the minibuffer history.
Replacement Commands
=== modified file 'doc/emacs/search.texi'
*** doc/emacs/search.texi 2013-05-15 23:14:18 +0000
--- doc/emacs/search.texi 2013-06-02 20:52:05 +0000
***************
*** 52,65 ****
@end table
@menu
! * Basic Isearch:: Basic incremental search commands.
! * Repeat Isearch:: Searching for the same string again.
! * Error in Isearch:: When your string is not found.
! * Special Isearch:: Special input in incremental search.
! * Isearch Yank:: Commands that grab text into the search string
! or else edit the search string.
! * Isearch Scroll:: Scrolling during an incremental search.
! * Isearch Minibuffer:: Incremental search of the minibuffer history.
@end menu
@node Basic Isearch
--- 52,66 ----
@end table
@menu
! * Basic Isearch:: Basic incremental search commands.
! * Repeat Isearch:: Searching for the same string again.
! * Error in Isearch:: When your string is not found.
! * Prefix Argument in Isearch:: What prefix arguments do.
! * Special Isearch:: Special input in incremental search.
! * Isearch Yank:: Commands that grab text into the search string
! or else edit the search string.
! * Isearch Scroll:: Scrolling during an incremental search.
! * Isearch Minibuffer:: Incremental search of the minibuffer history.
@end menu
@node Basic Isearch
***************
*** 212,217 ****
--- 213,234 ----
waiting for more input, so a second @kbd{C-g} will cancel the entire
search.
+ @node Prefix Argument in Isearch
+ @subsection The Prefix Argument in Incremental Search
+
+ @vindex isearch-allow-prefix
+ In incremental search, when you enter a prefix argument
+ (@pxref{Arguments}), by default it will apply either to the next
+ action in the search or to the command that exits the search.
+
+ In previous versions of Emacs, entering a prefix argument always
+ terminated the search. You can revert to this behavior by setting the
+ variable @code{isearch-allow-prefix} to @code{nil}.
+
+ When @code{isearch-allow-scroll} is non-@code{nil} (@pxref{Isearch
+ Scroll}), prefix arguments always have the default behavior described
+ above.
+
@node Special Isearch
@subsection Special Input for Incremental Search
=== modified file 'etc/NEWS'
*** etc/NEWS 2013-05-27 23:02:37 +0000
--- etc/NEWS 2013-06-02 19:56:21 +0000
***************
*** 244,249 ****
--- 244,253 ----
*** `query-replace' skips invisible text when `search-invisible' is nil,
and opens overlays with hidden text when `search-invisible' is `open'.
+ +++
+ *** By default, prefix arguments can now be entered without
+ terminating Isearch mode. Set `isearch-allow-prefix' to nil to disable.
+
** MH-E has been updated to MH-E version 8.5.
See MH-E-NEWS for details.
=== modified file 'lisp/isearch.el'
*** lisp/isearch.el 2013-05-27 22:42:11 +0000
--- lisp/isearch.el 2013-06-02 20:54:25 +0000
***************
*** 2102,2107 ****
--- 2102,2115 ----
:type 'boolean
:group 'isearch)
+ (defcustom isearch-allow-prefix t
+ "Whether prefix arguments are allowed during incremental search.
+ If non-nil, entering a prefix argument will not terminate the
+ search. This option is ignored \(presumed t) when
+ `isearch-allow-scroll' is set."
+ :type 'boolean
+ :group 'isearch)
+
(defun isearch-string-out-of-window (isearch-point)
"Test whether the search string is currently outside of the window.
Return nil if it's completely visible, or if point is visible,
***************
*** 2254,2265 ****
(setq prefix-arg arg)
(apply 'isearch-unread keylist)
(isearch-edit-string))
! ;; Handle a scrolling function.
! ((and isearch-allow-scroll
! (progn (setq key (isearch-reread-key-sequence-naturally keylist))
! (setq keylist (listify-key-sequence key))
! (setq main-event (aref key 0))
! (setq scroll-command (isearch-lookup-scroll-key key))))
;; From this point onwards, KEY, KEYLIST and MAIN-EVENT hold a
;; complete key sequence, possibly as modified by function-key-map,
;; not merely the one or two event fragment which invoked
--- 2262,2280 ----
(setq prefix-arg arg)
(apply 'isearch-unread keylist)
(isearch-edit-string))
! ;; Handle a scrolling function or prefix argument.
! ((progn
! (setq key (isearch-reread-key-sequence-naturally keylist)
! keylist (listify-key-sequence key)
! main-event (aref key 0))
! (or (and isearch-allow-scroll
! (setq scroll-command (isearch-lookup-scroll-key key)))
! (and isearch-allow-prefix
! (let (overriding-terminal-local-map)
! (setq scroll-command (key-binding key))
! (memq scroll-command
! '(universal-argument
! negative-argument digit-argument))))))
;; From this point onwards, KEY, KEYLIST and MAIN-EVENT hold a
;; complete key sequence, possibly as modified by function-key-map,
;; not merely the one or two event fragment which invoked
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2013-06-02 21:05 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 19:59 [PATCH] Make `C-x {' and `C-x }' repeatable Gauthier Östervall
2013-05-21 9:58 ` Vitalie Spinu
2013-05-21 13:53 ` Gauthier Östervall
2013-05-21 18:34 ` Juri Linkov
2013-05-22 17:44 ` Drew Adams
2013-05-22 18:55 ` Juri Linkov
2013-05-22 21:39 ` Drew Adams
2013-05-22 22:08 ` Stefan Monnier
2013-05-22 23:53 ` Drew Adams
2013-05-23 0:18 ` chad
2013-05-23 16:19 ` Drew Adams
2013-05-23 16:48 ` Stefan Monnier
2013-05-23 19:52 ` Drew Adams
2013-05-24 4:53 ` Stephen J. Turnbull
2013-05-24 15:55 ` Drew Adams
2013-05-24 17:00 ` Stephen J. Turnbull
2013-05-22 21:47 ` Stefan Monnier
2013-05-22 22:24 ` Stefan Monnier
2013-05-22 23:53 ` Drew Adams
2013-05-23 22:30 ` Juri Linkov
2013-05-24 3:58 ` Stefan Monnier
2013-05-22 19:05 ` Stefan Monnier
2013-05-23 12:21 ` Gauthier Östervall
2013-05-23 13:41 ` Stefan Monnier
2013-05-23 22:04 ` Juri Linkov
2013-05-24 9:38 ` Alan Mackenzie
2013-05-24 20:31 ` Juri Linkov
2013-05-25 20:01 ` Alan Mackenzie
2013-05-25 20:40 ` Juri Linkov
2013-06-02 21:05 ` Alan Mackenzie [this message]
2013-06-04 18:03 ` isearch-allow-prefix [Was: [PATCH] Make `C-x {' and `C-x }' repeatable] Juri Linkov
2013-06-04 21:24 ` Alan Mackenzie
2013-06-05 8:23 ` Juri Linkov
2013-06-05 21:02 ` Alan Mackenzie
2013-06-06 6:07 ` isearch-allow-move [Was: isearch-allow-prefix] Juri Linkov
2013-06-06 12:45 ` Stefan Monnier
2013-06-06 15:07 ` Juri Linkov
2013-06-06 15:43 ` Drew Adams
2013-06-06 16:39 ` Stefan Monnier
2013-06-07 7:07 ` Juri Linkov
2013-06-06 20:07 ` Alan Mackenzie
2013-06-07 6:59 ` Juri Linkov
2013-06-07 10:30 ` Alan Mackenzie
2013-06-07 19:30 ` Juri Linkov
2013-06-09 20:09 ` Juri Linkov
2013-06-11 19:35 ` Juri Linkov
2013-06-07 20:04 ` Juri Linkov
2013-06-09 12:07 ` [PATCH] set-temporary-overlay-map improvement and make windresize exit on other commands Vitalie Spinu
2013-06-09 16:03 ` Stefan Monnier
2013-06-09 17:12 ` Vitalie Spinu
2013-06-13 20:44 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130602210512.GC2765@acm.acm \
--to=acm@muc.de \
--cc=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=juri@jurta.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.