summaryrefslogtreecommitdiff
path: root/lisp/isearch.el
Commit message (Collapse)AuthorAgeFilesLines
* * lisp/isearch.el (isearch-forward-symbol-at-point): Add isearch-push-state.Juri Linkov2016-05-011-0/+1
| | | | (Bug#23410)
* isearch-search-fun-function doc tweakLars Ingebrigtsen2016-05-011-2/+3
| | | | | | | * lisp/isearch.el (isearch-search-fun-function): Mention what the STRING parameter is (bug#21552). (cherry picked from commit cafc2a5940cdc523cfea6dcf1cf540f48367c62a)
* Fix last change to isearch-update (bug#23406)Leo Liu2016-05-011-1/+0
| | | | | | * lisp/isearch.el (isearch-update): Remove (setq cursor-sensor-inhibit nil) ie remove the original (unless (boundp 'cursor-sensor-inhibit) ...) form.
* Autoload cursor-sensor-inhibit (bug#23406)Leo Liu2016-04-301-3/+1
| | | | | * lisp/emacs-lisp/cursor-sensor.el (cursor-sensor-inhibit): Autoload. * lisp/isearch.el (isearch-update): Remove boundp check.
* Fix an Isearch var to be a string (Bug#23038)Kaushal Modi2016-03-221-8/+11
| | | | | | | | | | | | | * isearch.el (isearch--describe-regexp-mode): The `description' var needs to always be a string. Add the missing default case for the cond form that ensures that. Before this bug fix, for the events when `regexp-function' and `search-default-mode' both were nil, `description' also stayed nil. So when `space-before' was non-nil, the "non-string" `description' (with a value of nil) got passed as an argument to `replace-regexp-in-string' (where a string was expected). That caused the error described in Bug#23038.
* Fix Isearch prompt when invoked with an argumentKaushal Modi2016-03-141-4/+15
| | | | | | | | | | * lisp/isearch.el (isearch--describe-regexp-mode): With `search-default-mode' set to nil, if user does C-u C-s, the minibuffer now displays "Regexp I-search: " again. But if the user has set `search-default-mode' to t, and then does C-s, the minibuffer now displays "I-search: " because the default search mode is now regexp mode. Comments have been added to explain the priority of conditions in the `cond' form. (Bug#22991)
* Revert "Revert "Backport: * lisp/isearch.el: Turn char-folding off by default""John Wiegley2016-03-091-1/+1
| | | | This reverts commit a91b4b51ddf2575d821adb8b84fdf32cff83886e.
* * lisp/isearch.el (isearch-define-mode-toggle): Fix toggling logicArtur Malabarba2016-03-031-1/+3
|
* Revert "Backport: * lisp/isearch.el: Turn char-folding off by default"Eli Zaretskii2016-02-111-1/+1
| | | | | | * lisp/isearch.el: Turn char-folding back oon by default. This reverts commit 12c50e82c9b432b2fc31f8fb2215f43ceea80822.
* Backport: * lisp/isearch.el: Turn char-folding off by defaultArtur Malabarba2016-02-101-1/+1
| | | | (search-default-mode): Set default value to nil.
* * lisp/isearch.el (isearch-define-mode-toggle): Improve logicArtur Malabarba2016-02-061-5/+3
|
* * lisp/isearch.el (search-default-mode)Artur Malabarba2016-02-061-4/+8
| | | | (isearch-regexp-function): Improve docstrings.
* * lisp/isearch.el: Rename search-default-regexp-mode to search-default-modeArtur Malabarba2016-02-061-8/+8
| | | | | | | | | (search-default-mode): New variable. (isearch-mode, isearch-define-mode-toggle) (isearch--describe-regexp-mode): Update accordingly. * lisp/menu-bar.el (nonincremental-search-forward): Update accordingly. * etc/NEWS: Update accordingly. * doc/emacs/search.texi: Update accordingly.
* Fix doc string of 'isearch-search-fun-function'Eli Zaretskii2016-01-201-3/+10
| | | | | * lisp/isearch.el (isearch-search-fun-function) (isearch-search-string): Doc fixes. (Bug#22411)
* Update copyright year to 2016Paul Eggert2016-01-011-1/+1
| | | | Run admin/update-copyright.
* Rename `recenter-group' to `recenter-window-group'scratch/followAlan Mackenzie2015-12-181-4/+4
| | | | | | | | | * doc/lispref/windows.texi (Textual Scrolling) * lisp/window.el (top level, recenter-group) * lisp/follow.el (follow-mode) * lisp/isearch.el (isearch-back-into-window): Rename `recenter-group' to `recenter-window-group' and `recenter-group-function' to `recenter-window-group-function'.
* Replace GROUP argument in six window primitives by new functions.Alan Mackenzie2015-12-141-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/windows.texi (Window Start and End, Textual Scrolling) * doc/lispref/positions.texi (Screen Lines): Remove optional GROUP argument from description of six window functions. Add in description of new functions window-group-start, window-group-end, set-window-group-start, pos-visible-in-window-group-p, recenter-group and move-to-window-group-line, together with the six variables indirecting to the pertinent group functions. * src/window.c * src/keyboard.c: Revert the commit from 2015-11-11 12:02:48, in so far as it applies to these two files, which added the GROUP argument to six window primitives. * lisp/follow.el (follow-mode): Use updated variable names for the indirected functions. * lisp/isearch.el (isearch-update, isearch-done, isearch-string-out-of-window) (isearch-back-into-window, isearch-lazy-highlight-new-loop) (isearch-lazy-highlight-search, isearch-lazy-highlight-update): Replace calls to window primitives (e.g. window-start) with a GROUP argument by calls to new functions (e.g. window-group-start). * lisp/ispell.el (ispell-command-loop): Replace call to pos-visible-in-window-p with pos-visible-in-window-group-p. * lisp/window.el (window-group-start, window-group-end) (set-window-group-start, recenter-group, pos-visible-in-window-group-p) (selected-window-group, move-to-window-group-line): New functions. (window-group-start-function, window-group-end-function) (set-window-group-start-function, recenter-group-function) (pos-visible-in-window-group-p-function, selected-window-group-function) (move-to-window-group-line-function): New variables.
* Further progress making Isearch, Ispell, Replace work with Follow Mode.Alan Mackenzie2015-12-071-20/+11
| | | | | | | | | | | | | | | | | | | | | | | * lisp/follow.el: (follow-mode): Remove references to sit*-for-function, which no longer exists. Add follow-post-command-hook to three special purpose hooks at setup, and remove them at tear down. * lisp/isearch.el: (isearch-update): invoke isearch-update-post-hook before isearch-lazy-highlight-new-loop. (isearch-lazy-highlight-new-loop): Restore this function to what it previously was, merging the functionality of isearch-lazy-highlight-maybe-new-loop into it. (isearch-lazy-highlight-maybe-new-loop): function removed. * lisp/replace.el: (replace-update-post-hook): New hook variable. (perform-replace): Add second (nil) argument to looking-back. Invoke replace-update-post-hook before calling replace-highlight. * lisp/textmodes/ispell.el: (ispell-update-post-hook): New hook variable. (ispell-command-loop): invoke ispell-update-post-hook. Add GROUP argument to call of pos-visible-in-window-p. (ispell-display-buffer): Place *Choices* window at the top of the last window in a window group.
* lisp/isearch.el: Eliminate macro isearch-call-message, replacing with funcall.Alan Mackenzie2015-12-041-10/+7
|
* First commit to scratch/follow. Make Isearch work with Follow Mode, etc.Alan Mackenzie2015-12-041-53/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | doc/lispref/window.texi (Basic Windows): Add paragraph defining "Group of Windows" and new @defun selected-window-group. (Window Start and End): Describe new &optional parameter GROUP and ...-group-function for window-start, window-end, set-window-start, and pos-visible-in-window-p. (Textual Scrolling) Describe the same for recenter. doc/lispref/positions.texi (Screen Lines): Describe the same for move-to-window-line. src/window.c (Fwindow_start, Fwindow_end, Fset_window_start) (Fpos_visible_in_window_p, Frecenter, Fmove_to_window_line): To each, add ar new optional parameter "group". At the beginning of each, check whether the corresponding ...-group-function is set to a function, and if so execute this function in place of the normal processing. (syms_of_window): Define symbols for the six new variables below. (window-start-group-function, window-end-group-function) (set-window-start-group-function, recenter-group-function) (pos-visible-in-window-p-group-function, move-to-window-line-group-function): New permanent local buffer local variables. src/keyboard.c (Fposn_at_point): Add extra parameter in call to Fpos_visible_in_window_p. lisp/window.el (selected-window-group-function): New permanent local buffer local variable. (selected-window-group): New function. lisp/follow.el (follow-mode): Set the ...-group-function variables at mode enable, kill them at mode disable. Add/remove follow-after-change to/from after-change-functions. (follow-start-end-invalid): New variable. (follow-redisplay): Manipulate follow-start-end-invalid. (follow-after-change, follow-window-start, follow-window-end) (follow-set-window-start, follow-pos-visible-in-window-p) (follow-move-to-window-line, follow-sit-for): New functions. lisp/isearch.el (isearch-call-message): New macro. (isearch-update, with-isearch-suspended, isearch-del-char) (isearch-search-and-update, isearch-ring-adjust): Invoke above new macro. (with-isearch-suspended): Rearrange code such that isearch-call-message is invoked before point is moved. (isearch-message): Add comment about where point must be at function call. (isearch-search): Remove call to isearch-message. (isearch-lazy-highlight-window-group): New variable. (isearch-lazy-highlight-new-loop): Unconditionally start idle timer. Move the battery of tests to ... (isearch-lazy-highlight-maybe-new-loop): New function, started by idle timer. Note: (sit-for 0) is still called. (isearch-lazy-highlight-update): Check membership of isearch-lazy-highlight-window-group. Don't set the `window' overlay property. (isearch-update, isearch-done, isearch-string-out-of-window) (isearch-back-into-window, isearch-lazy-highlight-maybe-new-loop) (isearch-lazy-highlight-search, isearch-lazy-highlight-update) (isearch-lazy-highlight-update): Call the six amended primitives (see src/window.c above) with the new `group' argument set to t, to cooperate with Follow Mode.
* More accurate documentation of lax whitespace matchingEli Zaretskii2015-12-011-6/+12
| | | | | | | | | | | * lisp/isearch.el (isearch-forward-word, isearch-forward-symbol) (word-search-backward, word-search-forward) (word-search-backward-lax, word-search-forward-lax): Mention in doc strings that toggling lax whitespace matching has no effect on these commands. * doc/emacs/search.texi (Word Search, Symbol Search): Clarify that lax whitespace matching has no effect on these commands.
* Yet another doc improvement for search commandsEli Zaretskii2015-11-301-11/+21
| | | | | | | | | | | | | | | | | | | * doc/emacs/search.texi (Word Search, Symbol Search) (Regexp Search): Document commands that don't support lax whitespace matching or character folding. (Nonincremental Search): Mention the search commands that can be invoked from the menu bar. * lisp/isearch.el (isearch-define-mode-toggle-word) (isearch-define-mode-toggle-symbol) (isearch-define-mode-toggle-character-fold): Note in the doc string that turning these on exits the regexp mode. (isearch-forward-regexp, isearch-forward-word) (isearch-forward-symbol, isearch-backward-regexp) (word-search-backward, word-search-forward) (word-search-backward-lax, word-search-forward-lax): State in the doc string which commands don't support character folding and/or lax-whitespace matching.
* * lisp/isearch.el (isearch-search-fun-default): Nicer errorArtur Malabarba2015-11-291-10/+17
| | | | message when the search fails.
* * lisp/isearch.el (isearch-define-mode-toggle): Advertise bindingArtur Malabarba2015-11-291-6/+6
|
* * lisp/isearch.el: Ensure we still support `isearch-new-word'Artur Malabarba2015-11-271-0/+8
| | | | | (isearch-new-regexp-function): Define variable. (isearch-new-word): Define as an obsolete alias. (Bug#22018)
* Improve and update documentation of search commandsEli Zaretskii2015-11-251-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/search.texi (Lax Search): Renamed from "Search Case"; all references changed. Move the description of lax-whitespace here. Add description of the new character folding features and additional customizable options. (Isearch Yank): Move before "Error in Search". (Basic Isearch): Improve wording. Add index entries. Add short description of how to abandon search, making this subsection a complete introduction to search basics. (Repeat Isearch): Add index entries. Describe additional customizable options. Describe mouse clicks. (Isearch Yank): Add index entries. Describe mouse-2 click in echo area. Describe more customizable options. (Error in Isearch): Add index entries. (Special Isearch): Move actual description of some isearch commands to other sections, leaving here just the summary of the commands. Add command that toggles character folding. Describe commands, like "C-h C-h", that were previously omitted for some reason. (Not Exiting Isearch): Describe search-exit-option. Add index entries. (Word Search): Describe eww-search-word and eww-search-prefix. (Symbol Search): Add index entries. (Regexp Search): Describe regexp-search-ring-max. (Replacement and Lax Matches): Renamed from "Replacement and Case"; all references changed. Describe lax-whitespace matching in replace commands and related options. Describe character folding in replace commands and related options. (Query Replace): Describe query-replace-from-to-separator and the new history features. Add index entries for highlighted text. Describe query-replace-skip-read-only. Describe more keys accepted by query-replace. (Other Repeating Search): More index entries for Occur. Describe list-matching-lines-default-context-lines. (Search Customizations): New section, documents customizable options that were not documented until now. * doc/emacs/glossary.texi (Glossary): Add "Case Folding" and "Character Folding". * etc/NEWS: Move search- and replace-related entries to a single parent section. * lisp/replace.el (query-replace-show-replacement): Doc fix. * lisp/isearch.el (search-nonincremental-instead) (isearch-hide-immediately): Doc fixes.
* * lisp/replace.el (occur-regexp-descr): New function.Juri Linkov2015-11-201-1/+7
| | | | | | | | | (occur-1, occur-engine): Use it. * lisp/isearch.el (isearch-occur): Propertize regexp with isearch-string and isearch-regexp-function-descr for occur-regexp-descr to display the correct description message in the header (bug#21176, bug#21180).
* * lisp/isearch.el (search-default-regexp-mode): change default valueArtur Malabarba2015-11-101-1/+1
|
* * lisp/isearch.el: Avoid an error that blocks isearchArtur Malabarba2015-10-301-1/+1
| | | | | | | | (isearch-update): Don't error if `isearch--current-buffer' has been killed. * test/automated/isearch-tests.el (isearch--test-update): New file.
* * lisp/isearch.el: Delete some outdated commentsArtur Malabarba2015-10-291-5/+1
|
* * lisp/isearch.el: Refactor momentary messagesArtur Malabarba2015-10-281-29/+27
| | | | | | (isearch--momentary-message): New function. (isearch-toggle-lax-whitespace, isearch-toggle-case-fold) (isearch-toggle-invisible): Use it.
* * lisp/isearch.el: Define all toggles with `isearch-define-mode-toggle'Artur Malabarba2015-10-281-58/+47
| | | | | | | | | (isearch-define-mode-toggle): New macro. (isearch-toggle-invisible): Renamed to `isearch-define-mode-toggle'. (isearch-toggle-case-fold, isearch-toggle-invisible) (isearch-toggle-regexp, isearch-toggle-lax-whitespace): Define with `isearch-define-mode-toggle'.
* * lisp/isearch.el (search-default-regexp-mode): Revert to nilArtur Malabarba2015-10-261-1/+1
| | | | | Character-fold search _still_ doesn't play well with lax-whitespace. So disable it by default (again) for now.
* * lisp/isearch.el: No visual feedback for default search modeArtur Malabarba2015-10-261-7/+12
| | | | | | | | | | | | | During an isearch where character-folding is the default, we don't want to take up minibuffer space just to tell the user that "Char-fold " is on. The same goes for other modes, if the user changes the default. In contrast, if the user toggles OFF the default mode, they should see "Literal", to distinguish it from the default mode. (isearch--describe-regexp-mode): Return "" if describing the default mode, and return "literal " if describing a plain search and it is not default.
* * lisp/isearch.el: Make character-fold search the default againArtur Malabarba2015-10-251-3/+3
|
* * lisp/isearch.el: Generalize definition of regexp-function togglesArtur Malabarba2015-10-251-34/+29
| | | | | | | | (isearch-specify-regexp-function): New macro for specifying possible values of `isearch-regexp-function'. (isearch-toggle-character-fold, isearch-toggle-symbol) (isearch-toggle-word): Define with `isearch-specify-regexp-function'.
* * lisp/isearch.el (search-default-regexp-mode): New variableArtur Malabarba2015-10-251-4/+24
| | | | (isearch-mode): Use it.
* * lisp/isearch.el: Delete redundant :group entriesArtur Malabarba2015-10-251-27/+13
| | | | | | | | | | (search-exit-option, search-slow-window-lines) (search-slow-speed, search-upper-case) (search-nonincremental-instead, search-whitespace-regexp) (search-invisible, isearch-hide-immediately) (isearch-resume-in-command-history, search-ring-max) (regexp-search-ring-max, search-ring-update, search-highlight) (isearch-fail): Delete :group entries.
* * lisp/isearch.el (isearch-search-fun-default): Simplify logicArtur Malabarba2015-10-211-32/+33
| | | | (isearch--lax-regexp-function-p): New function.
* * lisp/isearch.el: Support lax-whitespace in regexp-function searchesArtur Malabarba2015-10-211-1/+3
| | | | | (isearch-search-fun-default): Let-bind `search-spaces-regexp' around `isearch-regexp-function'.
* * lisp/isearch.el: Rename word search to regexp-function searchArtur Malabarba2015-10-211-58/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `isearch-word' went well beyond its original purpose, and the name no longer makes sense. It is now called `isearch-regexp-function', and it's value should always be a function that converts a string to a regexp (though setting it to t is still supported for now). (isearch-word): Make obsolete. (isearch-regexp-function): New variable. (isearch-mode, isearch-done, isearch--state, isearch--set-state) (with-isearch-suspended, isearch-toggle-regexp) (isearch-toggle-word, isearch-toggle-symbol) (isearch-toggle-character-fold, isearch-query-replace) (isearch-occur, isearch-highlight-regexp) (isearch-search-and-update, isearch-message-prefix) (isearch-search-fun-default, isearch-search) (isearch-lazy-highlight-new-loop, isearch-lazy-highlight-search): Use it. (isearch-lazy-highlight-regexp-function): New var. (isearch-lazy-highlight-word): Make obsolete. (isearch--describe-regexp-mode): New function. (isearch--describe-word-mode): Make obsolete. * lisp/info.el (Info-isearch-search): Use the new var. * lisp/replace.el (replace-search, replace-highlight): Use the new var. * lisp/obsolete/longlines.el (longlines-search-function): Use the new var. * lisp/hexl.el (hexl-isearch-search-function): Use the new var. * lisp/cedet/semantic/senator.el (senator-isearch-search-fun): Use the new var.
* isearch: Document character folding mode.RĂ¼diger Sonderfeld2015-08-311-0/+1
| | | | | * isearch.el (isearch-forward): Mention `isearch-toggle-character-fold' in docstring.
* * isearch.el (isearch-search-fun-default): Revert a5bdb87Artur Malabarba2015-08-191-6/+5
| | | | | | | | | | | Remove usage of `isearch-lax-whitespace' inside the `iearch-word' clause of `isearch-search-fun-default'. That lax variable does not refer to lax-whitespacing. Related to (bug#21777). This reverts commit a5bdb872edb9f031fe041faf9a8c0be432e5f64c. * character-fold.el (character-fold-search): Set to nil Default to nil for now, until someone implements proper lax-whitespacing with char-fold searching.
* * isearch.el (isearch-search-fun-default): (Bug#21164)Artur Malabarba2015-08-091-5/+6
| | | | | Respect `isearch-lax-whitespace' when searching through `isearch-word'.
* Factor isearch word description into new functionDaniel Colascione2015-07-041-17/+20
| | | | | * lisp/isearch.el (isearch--describe-word-mode): New function. (isearch-message-prefix, isearch-query-replace): Use it.
* * lisp/isearch.el (isearch-toggle-word): Fix toggleArtur Malabarba2015-06-301-1/+1
|
* * lisp/isearch.el (isearch-exit): Don't call isearch-done twice (bug#20925).Katsumi Yamaoka2015-06-291-2/+2
|
* * lisp/isearch.el (isearch-mode): Don't char-fold regexpsArtur Malabarba2015-06-281-0/+1
| | | | (bug#20913)
* * lisp/character-fold.el: New file (Bug#20887)Artur Malabarba2015-06-241-79/+15
| | | | | | | | | | | | | (character-fold-to-regexp): New function. * lisp/replace.el (replace-search): Check value of `character-fold-search'. * lisp/isearch.el: Move character-folding code to character-fold.el (isearch-toggle-character-fold): New command. (isearch-mode-map): Bind it to "\M-sf". (isearch-mode): Check value of `character-fold-search'.
* * lisp/isearch.el: Fold many unicode characters to ASCIIArtur Malabarba2015-06-231-0/+78
| | | | | | | | | | | | (isearch-character-fold-search, isearch--character-fold-extras) (isearch--character-fold-table): New variable. (isearch--character-folded-regexp): New function. (isearch-search-fun-default): Use them. * lisp/replace.el (replace-character-fold): New variable. (replace-search): Use it. * etc/NEWS: Document it.