Last edit
Changed:
< * '''`M-g'''' yanks the last successful search string (regexp or plain) from when you last hit `C-g' in Isearch. Sometimes you search for something but abandon the search --- you just want to check the locations of something, without staying at any of them. Afterward, if you want to find them again, use `M-g'. This yanks that search string, so you can append it to whatever you are already searching for.
to
> * '''`M-g'''' ('''`isearchp-retrieve-last-quit-search'''') yanks the last successful search string (regexp or plain) from when you last hit `C-g' in Isearch. Sometimes you search for something but abandon the search --- you just want to check the locations of something, without staying at any of them. Afterward, if you want to find them again, use `M-g'. This yanks that search string, so you can append it to whatever you are already searching for.
Added:
> [:isearchp-yank-char]
> * '''`##C-c##'''' ('''`isearchp-yank-char'''') yanks successive characters onto the search string.
Changed:
< * '''`##C-_##'''' yanks successive [[symbol]]s (or words or chars) into the search string.
to
> * '''`##C-_##'''' ('''`isearchp-yank-symbol-or-char'''') yanks successive [[symbol]]s (or words or subwords or chars) onto the search string.
Changed:
< * '''`##C-(##'''' yanks successive [[sexp]]s (or symbols or words or chars) into the search string.
to
> * '''`##C-(##'''' ('''`isearchp-yank-sexp-symbol-or-char'''') yanks successive [[sexp]]s (or symbols or words or subwords or chars) onto the search string.
Changed:
< C-y c isearch-yank-char
< C-y w isearch-yank-word-or-char
< C-y _ isearchp-yank-symbol-or-char
< C-y ( isearchp-yank-sexp-symbol-or-char
to
> C-y C-_ isearchp-yank-symbol-or-char
> C-y C-( isearchp-yank-sexp-symbol-or-char
Changed:
< C-y C-e isearch-yank-line
to
> C-y C-c isearchp-yank-char
> C-y C-e isearchp-yank-line
> C-y C-w isearchp-yank-word-or-char
Added:
> :: You can repeat any of these for which it makes sense (i.e., all except `isearch-yank-secondary', `isearch-yank-kill', and `isearch-yank-pop') by just repeating the last key. For example: `C-y C-e C-e C-e' adds the text up to the end of three lines.
> :: ''Note:'' Because of [[http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14095| Emacs bug #14095]] (a regression), this does not yet work in Emacs 24 for `isearchp-yank-line'. (It "works" for the others in Emacs 24 only because the same key without the `C-y' prefix is bound to essentially the same command. So the
> "repetition" is really a separate command.)
Changed:
< * '''`C-x 8 RET'''' reads the name of a Unicode character with
to
> * '''`C-x 8 RET'''' ('''`isearchp-read-unicode-char'''') reads the name of a Unicode character with
Changed:
< * '''`C-x o'''' opens a recursive editing session, where you can do
to
> * '''`C-x o'''' ('''`isearchp-open-recursive-edit'''') opens a recursive editing session, where you can do
Changed:
< * Command and binding to cycle automatic removal or replacement of the input portion
< that does not match, bound to '''`M-k''''. Behavior
to
> * '''`M-k'''' ('''`isearchp-cycle-mismatch-removal'''') cycles automatic removal or replacement of the input portion
> that does not match. The behavior
Deleted:
< [:isearch-toggle-word]
< * Command and binding to toggle (incremental) word search (from JuriLinkov): `isearch-toggle-word', bound to '''`M-w''''.
Changed:
< * Command and binding to toggle invisible-text sensitivity while searching: `isearchp-toggle-invisible', bound to '''`##C-+##''''.
< [:isearchp-toggle-invisible]
to
> * '''`##C-+##'''' ('''`isearchp-toggle-invisible'''') toggles invisible-text sensitivity while searching.
Changed:
< * Bindings during Isearch (the standard bindings for some of these use the Meta modifier, `M-', instead):
< ** '''`next'''', '''`prior'''' repeat the last Isearch forward and backward (easier than using the [[chord]]s `C-s', `C-r'.
< ** '''`C-h'''' provides ''help'' on Isearch while isearching. Library <tt>[[isearch+.el]]</tt> also redefines `isearch-mode-help' so that it lists ''all'' Isearch bindings and ends Isearch properly
< ** '''`C-c'''' lets you toggle ''case-sensitivity'' while isearching. (Standard binding is `M-c'.)
< ** '''`##C-+##'''' lets you toggle ''invisible-text sensitivity'' while isearching.
< ** '''`C-SPC'''' lets you toggle setting the region around the last found occurrence.
to
> * Other bindings during Isearch:
> ** '''`next'''', '''`prior'''' repeat the last Isearch forward and backward (easier than using the [[chord]]s `C-s', `C-r').
Added:
> ** '''`C-h'''' provides ''help'' on Isearch while searching. Library <tt>[[isearch+.el]]</tt> also redefines `isearch-mode-help' so that it lists ''all'' Isearch bindings and ends Isearch properly.
Changed:
< * '''`M-e'''' (`isearch-edit-string') automatically puts the [[cursor]] at the first mismatch position in the search string, for easy editing. Whereas `C-g' (see also `M-k') removes all of the mismatch, this feature lets you change or insert a character or two, without losing the rest of the search string.
to
> * '''`M-e'''' ('''`isearch-edit-string'''') automatically puts the [[cursor]] at the first mismatch position in the search string, for easy editing. Whereas `C-g' (see also `M-k') removes all of the mismatch, this feature lets you change or insert a character or two, without losing the rest of the search string.
This page is about Isearch+, that is, library isearch+.el. This extends standard Emacs library isearch.el, which provides IncrementalSearch.
Features:
‘ISEARCH’ for case-insensitive; ‘Isearch’ for case-sensitive.‘face’ text property with a value of ‘font-lock-comment-face’ or ‘font-lock-string-face’. Search overlays or text properties. From within Isearch: ‘C-t’ (or ‘C-M-t’ for regexp search). First time, or with a prefix argument, you are prompted for the property and its values. See the doc string of command ‘isearchp-char-prop-forward’.‘face’ and other text properties for use with ‘C-t’, you can use command ‘isearchp-put-prop-on-region’ (outside of Isearch) to add a text property to a zone of text. By default, it applies the last property and value whose zones you searched using ‘C-t’, but a prefix argument lets you specify the property and value to apply. This gives you an interactive way to set up zones for text-property search (‘C-t’). For property ‘face’, empty input removes all faces from the region.‘isearchp-set-region-flag’ – Non-‘nil’ means automatically set the region around the last search target.‘isearchp-toggle-set-region’, bound to ‘C-SPC’ during isearch – toggle ‘isearchp-set-region-flag’.‘set-region-around-search-target’ – manually set the region around the last search target.‘isearchp-regexp-quote-yank-flag’) and command (‘isearchp-toggle-regexp-quote-yank’, bound to `C-`’) to toggle quoting (escaping) of regexp special characters. With escaping turned off, you can yank text such as ^\*.* without it being transformed to \^\\\*\.\*.‘M-g’ (‘isearchp-retrieve-last-quit-search’) yanks the last successful search string (regexp or plain) from when you last hit ‘C-g’ in Isearch. Sometimes you search for something but abandon the search — you just want to check the locations of something, without staying at any of them. Afterward, if you want to find them again, use ‘M-g’. This yanks that search string, so you can append it to whatever you are already searching for.‘C-M-y’ (‘isearch-yank-secondary’) yanks the secondary selection onto the search string, if you also use library second-sel.el (see secondary selection enhancements).‘C-c’ (‘isearchp-yank-char’) yanks successive characters onto the search string.C-_’ (‘isearchp-yank-symbol-or-char’) yanks successive symbols (or words or subwords or chars) onto the search string.C-(’ (‘isearchp-yank-sexp-symbol-or-char’) yanks successive sexps (or symbols or words or subwords or chars) onto the search string.‘M-w’ (‘isearchp-kill-ring-save’) copies the current search string to the kill ring. You can then, for example, use ‘C-s M-y’ to search for the same thing in another Emacs session. (Use ‘M-s w’ for ‘isearch-toggle-word’.)‘C-y’ (in addition to any other Isearch bindings): C-y C-_ isearchp-yank-symbol-or-char
C-y C-( isearchp-yank-sexp-symbol-or-char
C-y C-2 isearch-yank-secondary
C-y C-c isearchp-yank-char
C-y C-e isearchp-yank-line
C-y C-w isearchp-yank-word-or-char
C-y C-y isearch-yank-kill
C-y M-y isearch-yank-pop‘isearch-yank-secondary’, ‘isearch-yank-kill’, and ‘isearch-yank-pop’) by just repeating the last key. For example: ‘C-y C-e C-e C-e’ adds the text up to the end of three lines.‘isearchp-yank-line’. (It “works” for the others in Emacs 24 only because the same key without the ‘C-y’ prefix is bound to essentially the same command. So the “repetition” is really a separate command.)‘C-x 8 RET’ (‘isearchp-read-unicode-char’) reads the name of a Unicode character with completion and appends it to the search string. Same thing when editing the search string (i.e., after ‘M-e’).‘C-x o’ (‘isearchp-open-recursive-edit’) opens a recursive editing session, where you can do anything you like (including search for something different). Using ‘C-M-c’ closes the recursive editing session and resumes the search (from the current position when you hit ‘C-M-c’).‘C-g’, or removed/replaced automatically if you use ‘M-k’ (see next). I added this feature to vanilla Emacs in release 23.1.‘C-g’ after successfully finding matches restores not only the original position but also its relative position in the window. IOW, you get back to what you saw before searching. Fixes GnuEmacs bug #12253 for Isearch.‘M-k’ (‘isearchp-cycle-mismatch-removal’) cycles automatic removal or replacement of the input portion that does not match. The behavior is controlled by the value of option ‘isearchp-drop-mismatch’:‘replace-last’ – Your current input replaces the last mismatched text. You can always see your last input, even if it is a mismatch. And it is available for editing using ‘M-e’.‘nil’ – Your current input is appended, even if the previous input has a mismatched portion.C-+’ (‘isearchp-toggle-invisible’) toggles invisible-text sensitivity while searching.‘next’, ‘prior’ repeat the last Isearch forward and backward (easier than using the chords ‘C-s’, ‘C-r’).‘C-end’ – go to the longest line. Repeat to go to the longest line following that one in the buffer. As usual, ‘C-g’ puts you back where you started. This binding is made only if you also use library misc-cmds.el. See Find Long Lines.‘C-h’ provides help on Isearch while searching. Library isearch+.el also redefines ‘isearch-mode-help’ so that it lists all Isearch bindings and ends Isearch properly.‘M-e’ (‘isearch-edit-string’) automatically puts the cursor at the first mismatch position in the search string, for easy editing. Whereas ‘C-g’ (see also ‘M-k’) removes all of the mismatch, this feature lets you change or insert a character or two, without losing the rest of the search string.‘isearchp-initiate-edit-commands’, that specifies commands whose keys will not exit Isearch but will instead initiate editing of the search string. For example, if ‘backward-char’ is included in the list then ‘C-b’ and ‘left’ will just move the cursor backward over the search string so you can change, delete, or insert chars in the middle somewhere. This makes the search string more minibuffer-like.‘C-s’ etc. to search for it. This is controlled by user option ‘isearchp-mouse-2-flag’.See Also:
‘query-replace’. In particular, the ability to select (put the region around) the last replacement.In Emacs 24.2.1, and maybe other versions, if you use IsearchPlus with Ido Ubiquitous (see: InteractivelyDoThings) enabled, you find that you can’t search for unicode charaters and if you try an error is generated. In Emacs 24.2.1 the solution is to disable Ido’s advice around ‘completing-read’ when ‘isearchp-read-unicode-char’ is called. This can be done by putting:
(ido-ubiquitous-disable-in isearchp-read-unicode-char)
in your .emacs file. When I first did this, I evaluated the form interactively and it didn’t seem to fix the problem - I don’t know why - but it worked next time I started up Emacs. — Bernard Hurley
Good to know, for Ido users. If you investigate a bit more and figure out why it sometimes does not work, would this be something that should be done automatically in Isearch+? Or do you think some users would not want it done (in which case perhaps it should be an option or an Isearch toggle)? Would you like to try patching isearch+.el to DTRT? Seems like we should be able to take care of this kind of thing automatically, so users do not need to do anything. – DrewAdams
Ido seems to work by advising ‘completing-read’ and advising various functions that call it. Ido code doesn’t look very clear to me, but I think that’s what it does. It also turns off this advice for functions that the Ido developers know about but haven’t got round to advising. This is obviously going to cause problems if you write a function that calls ‘completing-read’, as yours does, and are returned an unexpected value. I can’t imagine any users not wanting this fixed automatically. My own thoughts are that since Ido makes this quite radical change to a core Emacs function, it’s better if it’s done automatically in that package. I have emailed the developers to gently suggest this. However I will look farther into it in case they don’t want to do so. – Bernard Hurley
Thanks for the update. FYI, I renamed ‘isearchp-read-unicode-char’ to ‘isearchp-insert-char-by-name’ in keeping with an updated definition and an expectation that Emacs 24.4 might include this (as ‘isearch-insert-char-by-name’).
I still have the same question as above:
Please let me know, when you can. It would be good to take care of this problem automatically, if that is appropriate. Thx – DrewAdams
Since searching for unicode characters in isearch+ is virtually impossible without the fix, I think it should be done automatically. Ido users might be a bit surprised not to get an Ido search at this point but Ido isn’t guaranteed to work everywhere, so I can’t see why anyone shouldn’t want the fix. – Bernard Hurley
OK, thanks. Can you provide a patch? Note that the same feature might well be added to Emacs — see this thread: http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00234.html. So you might want to bring JuriLinkov into the loop about fixing this wrt Ido. He might also have a suggestion. Please cc me if you do so by email. Thx – DrewAdams