diff options
| author | Juri Linkov | 2013-05-31 02:45:41 +0300 |
|---|---|---|
| committer | Juri Linkov | 2013-05-31 02:45:41 +0300 |
| commit | 01dea85f7b9a064ceafefd6e2940566da0530fb4 (patch) | |
| tree | a9bd0366eea57f55efa6584b521e258144d0db59 | |
| parent | 8accd027c4ac0c73c8783eb2ae1bedeeee09d3da (diff) | |
| download | emacs-01dea85f7b9a064ceafefd6e2940566da0530fb4.tar.gz emacs-01dea85f7b9a064ceafefd6e2940566da0530fb4.zip | |
* lisp/isearch.el (isearch-mode-map): Bind `isearch-toggle-invisible' to "\M-si".
(isearch-invisible): New variable.
(isearch-forward): Doc fix.
(isearch-mode): Set `isearch-invisible'
to the value of `search-invisible'.
(isearch-toggle-case-fold): Doc fix.
(isearch-toggle-invisible): New command.
(isearch-query-replace): Let-bind `search-invisible'
to the value of `isearch-invisible'.
(isearch-search): Use `isearch-invisible' instead of
`search-invisible'. Let-bind `search-invisible'
to the value of `isearch-invisible'.
Fixes: debbugs:11378
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/isearch.el | 34 |
3 files changed, 50 insertions, 3 deletions
| @@ -241,6 +241,9 @@ entries displayed by `Info-index-next', `Info-virtual-index' and | |||
| 241 | *** `C-x 8 RET' in Isearch mode reads a character by its Unicode name | 241 | *** `C-x 8 RET' in Isearch mode reads a character by its Unicode name |
| 242 | and adds it to the search string. | 242 | and adds it to the search string. |
| 243 | 243 | ||
| 244 | *** `M-s i' toggles the variable `isearch-invisible' between nil and | ||
| 245 | the value of the option `search-invisible' (or `open' when it's nil). | ||
| 246 | |||
| 244 | *** `query-replace' skips invisible text when `search-invisible' is nil, | 247 | *** `query-replace' skips invisible text when `search-invisible' is nil, |
| 245 | and opens overlays with hidden text when `search-invisible' is `open'. | 248 | and opens overlays with hidden text when `search-invisible' is `open'. |
| 246 | 249 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fc0ba8a116a..87774cdb2a5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,21 @@ | |||
| 1 | 2013-05-30 Juri Linkov <juri@jurta.org> | 1 | 2013-05-30 Juri Linkov <juri@jurta.org> |
| 2 | 2 | ||
| 3 | * isearch.el (isearch-mode-map): Bind `isearch-toggle-invisible' | ||
| 4 | to "\M-si". | ||
| 5 | (isearch-invisible): New variable. | ||
| 6 | (isearch-forward): Doc fix. | ||
| 7 | (isearch-mode): Set `isearch-invisible' | ||
| 8 | to the value of `search-invisible'. | ||
| 9 | (isearch-toggle-case-fold): Doc fix. | ||
| 10 | (isearch-toggle-invisible): New command. | ||
| 11 | (isearch-query-replace): Let-bind `search-invisible' | ||
| 12 | to the value of `isearch-invisible'. | ||
| 13 | (isearch-search): Use `isearch-invisible' instead of | ||
| 14 | `search-invisible'. Let-bind `search-invisible' | ||
| 15 | to the value of `isearch-invisible'. (Bug#11378) | ||
| 16 | |||
| 17 | 2013-05-30 Juri Linkov <juri@jurta.org> | ||
| 18 | |||
| 3 | * replace.el (perform-replace): Avoid `isearch-range-invisible' | 19 | * replace.el (perform-replace): Avoid `isearch-range-invisible' |
| 4 | call when `query-flag' is nil and `search-invisible' is non-nil. | 20 | call when `query-flag' is nil and `search-invisible' is non-nil. |
| 5 | (Bug#11746) | 21 | (Bug#11746) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index 5bf2818fadc..e82627616c3 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -514,6 +514,7 @@ This is like `describe-bindings', but displays only Isearch keys." | |||
| 514 | (define-key map "\M-e" 'isearch-edit-string) | 514 | (define-key map "\M-e" 'isearch-edit-string) |
| 515 | 515 | ||
| 516 | (define-key map "\M-sc" 'isearch-toggle-case-fold) | 516 | (define-key map "\M-sc" 'isearch-toggle-case-fold) |
| 517 | (define-key map "\M-si" 'isearch-toggle-invisible) | ||
| 517 | (define-key map "\M-sr" 'isearch-toggle-regexp) | 518 | (define-key map "\M-sr" 'isearch-toggle-regexp) |
| 518 | (define-key map "\M-sw" 'isearch-toggle-word) | 519 | (define-key map "\M-sw" 'isearch-toggle-word) |
| 519 | (define-key map "\M-s_" 'isearch-toggle-symbol) | 520 | (define-key map "\M-s_" 'isearch-toggle-symbol) |
| @@ -602,6 +603,11 @@ Each set is a vector of the form: | |||
| 602 | ;; case in the search string is ignored. | 603 | ;; case in the search string is ignored. |
| 603 | (defvar isearch-case-fold-search nil) | 604 | (defvar isearch-case-fold-search nil) |
| 604 | 605 | ||
| 606 | ;; search-invisible while searching. | ||
| 607 | ;; either nil, t, or 'open. 'open means the same as t except that | ||
| 608 | ;; opens hidden overlays. | ||
| 609 | (defvar isearch-invisible search-invisible) | ||
| 610 | |||
| 605 | (defvar isearch-last-case-fold-search nil) | 611 | (defvar isearch-last-case-fold-search nil) |
| 606 | 612 | ||
| 607 | ;; Used to save default value while isearch is active | 613 | ;; Used to save default value while isearch is active |
| @@ -700,6 +706,7 @@ If you try to exit with the search string still empty, it invokes | |||
| 700 | nonincremental search. | 706 | nonincremental search. |
| 701 | 707 | ||
| 702 | Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity. | 708 | Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity. |
| 709 | Type \\[isearch-toggle-invisible] to toggle search in invisible text. | ||
| 703 | Type \\[isearch-toggle-regexp] to toggle regular-expression mode. | 710 | Type \\[isearch-toggle-regexp] to toggle regular-expression mode. |
| 704 | Type \\[isearch-toggle-word] to toggle word mode. | 711 | Type \\[isearch-toggle-word] to toggle word mode. |
| 705 | Type \\[isearch-toggle-symbol] to toggle symbol mode. | 712 | Type \\[isearch-toggle-symbol] to toggle symbol mode. |
| @@ -836,6 +843,7 @@ convert the search string to a regexp used by regexp search functions." | |||
| 836 | isearch-op-fun op-fun | 843 | isearch-op-fun op-fun |
| 837 | isearch-last-case-fold-search isearch-case-fold-search | 844 | isearch-last-case-fold-search isearch-case-fold-search |
| 838 | isearch-case-fold-search case-fold-search | 845 | isearch-case-fold-search case-fold-search |
| 846 | isearch-invisible search-invisible | ||
| 839 | isearch-string "" | 847 | isearch-string "" |
| 840 | isearch-message "" | 848 | isearch-message "" |
| 841 | isearch-cmds nil | 849 | isearch-cmds nil |
| @@ -1474,7 +1482,8 @@ value of the variable `isearch-regexp-lax-whitespace'." | |||
| 1474 | (isearch-update)) | 1482 | (isearch-update)) |
| 1475 | 1483 | ||
| 1476 | (defun isearch-toggle-case-fold () | 1484 | (defun isearch-toggle-case-fold () |
| 1477 | "Toggle case folding in searching on or off." | 1485 | "Toggle case folding in searching on or off. |
| 1486 | Toggles the value of the variable `isearch-case-fold-search'." | ||
| 1478 | (interactive) | 1487 | (interactive) |
| 1479 | (setq isearch-case-fold-search | 1488 | (setq isearch-case-fold-search |
| 1480 | (if isearch-case-fold-search nil 'yes)) | 1489 | (if isearch-case-fold-search nil 'yes)) |
| @@ -1487,6 +1496,23 @@ value of the variable `isearch-regexp-lax-whitespace'." | |||
| 1487 | (sit-for 1) | 1496 | (sit-for 1) |
| 1488 | (isearch-update)) | 1497 | (isearch-update)) |
| 1489 | 1498 | ||
| 1499 | (defun isearch-toggle-invisible () | ||
| 1500 | "Toggle searching in invisible text on or off. | ||
| 1501 | Toggles the variable `isearch-invisible' between values | ||
| 1502 | nil and a non-nil value of the option `search-invisible' | ||
| 1503 | \(or `open' if `search-invisible' is nil)." | ||
| 1504 | (interactive) | ||
| 1505 | (setq isearch-invisible | ||
| 1506 | (if isearch-invisible nil (or search-invisible 'open))) | ||
| 1507 | (let ((message-log-max nil)) | ||
| 1508 | (message "%s%s [match %svisible text]" | ||
| 1509 | (isearch-message-prefix nil isearch-nonincremental) | ||
| 1510 | isearch-message | ||
| 1511 | (if isearch-invisible "in" ""))) | ||
| 1512 | (setq isearch-success t isearch-adjusted t) | ||
| 1513 | (sit-for 1) | ||
| 1514 | (isearch-update)) | ||
| 1515 | |||
| 1490 | 1516 | ||
| 1491 | ;; Word search | 1517 | ;; Word search |
| 1492 | 1518 | ||
| @@ -1622,6 +1648,7 @@ way to run word replacements from Isearch is `M-s w ... M-%'." | |||
| 1622 | ;; set `search-upper-case' to nil to not call | 1648 | ;; set `search-upper-case' to nil to not call |
| 1623 | ;; `isearch-no-upper-case-p' in `perform-replace' | 1649 | ;; `isearch-no-upper-case-p' in `perform-replace' |
| 1624 | (search-upper-case nil) | 1650 | (search-upper-case nil) |
| 1651 | (search-invisible isearch-invisible) | ||
| 1625 | (replace-lax-whitespace | 1652 | (replace-lax-whitespace |
| 1626 | isearch-lax-whitespace) | 1653 | isearch-lax-whitespace) |
| 1627 | (replace-regexp-lax-whitespace | 1654 | (replace-regexp-lax-whitespace |
| @@ -2638,9 +2665,10 @@ update the match data, and return point." | |||
| 2638 | (setq isearch-case-fold-search | 2665 | (setq isearch-case-fold-search |
| 2639 | (isearch-no-upper-case-p isearch-string isearch-regexp))) | 2666 | (isearch-no-upper-case-p isearch-string isearch-regexp))) |
| 2640 | (condition-case lossage | 2667 | (condition-case lossage |
| 2641 | (let ((inhibit-point-motion-hooks search-invisible) | 2668 | (let ((inhibit-point-motion-hooks isearch-invisible) |
| 2642 | (inhibit-quit nil) | 2669 | (inhibit-quit nil) |
| 2643 | (case-fold-search isearch-case-fold-search) | 2670 | (case-fold-search isearch-case-fold-search) |
| 2671 | (search-invisible isearch-invisible) | ||
| 2644 | (retry t)) | 2672 | (retry t)) |
| 2645 | (setq isearch-error nil) | 2673 | (setq isearch-error nil) |
| 2646 | (while retry | 2674 | (while retry |
| @@ -2836,7 +2864,7 @@ determined by `isearch-range-invisible' unless invisible text can be | |||
| 2836 | searched too when `search-invisible' is t." | 2864 | searched too when `search-invisible' is t." |
| 2837 | (or (eq search-invisible t) | 2865 | (or (eq search-invisible t) |
| 2838 | (not (isearch-range-invisible beg end)))) | 2866 | (not (isearch-range-invisible beg end)))) |
| 2839 | (make-obsolete 'isearch-filter-visible 'search-invisible "24.4") | 2867 | (make-obsolete 'isearch-filter-visible 'isearch-invisible "24.4") |
| 2840 | 2868 | ||
| 2841 | 2869 | ||
| 2842 | ;; General utilities | 2870 | ;; General utilities |