emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112793: * lisp/isearch.el (isearch-m


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112793: * lisp/isearch.el (isearch-mode-map): Bind `isearch-toggle-invisible' to "\M-si".
Date: Fri, 31 May 2013 02:45:41 +0300
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112793
fixes bug: http://debbugs.gnu.org/11378
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Fri 2013-05-31 02:45:41 +0300
message:
  * 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'.
modified:
  etc/NEWS
  lisp/ChangeLog
  lisp/isearch.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2013-05-27 23:02:37 +0000
+++ b/etc/NEWS  2013-05-30 23:45:41 +0000
@@ -241,6 +241,9 @@
 *** `C-x 8 RET' in Isearch mode reads a character by its Unicode name
 and adds it to the search string.
 
+*** `M-s i' toggles the variable `isearch-invisible' between nil and
+the value of the option `search-invisible' (or `open' when it's nil).
+
 *** `query-replace' skips invisible text when `search-invisible' is nil,
 and opens overlays with hidden text when `search-invisible' is `open'.
 

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-05-30 23:33:08 +0000
+++ b/lisp/ChangeLog    2013-05-30 23:45:41 +0000
@@ -1,5 +1,21 @@
 2013-05-30  Juri Linkov  <address@hidden>
 
+       * 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'.  (Bug#11378)
+
+2013-05-30  Juri Linkov  <address@hidden>
+
        * replace.el (perform-replace): Avoid `isearch-range-invisible'
        call when `query-flag' is nil and `search-invisible' is non-nil.
        (Bug#11746)

=== modified file 'lisp/isearch.el'
--- a/lisp/isearch.el   2013-05-27 22:42:11 +0000
+++ b/lisp/isearch.el   2013-05-30 23:45:41 +0000
@@ -514,6 +514,7 @@
     (define-key map "\M-e" 'isearch-edit-string)
 
     (define-key map "\M-sc" 'isearch-toggle-case-fold)
+    (define-key map "\M-si" 'isearch-toggle-invisible)
     (define-key map "\M-sr" 'isearch-toggle-regexp)
     (define-key map "\M-sw" 'isearch-toggle-word)
     (define-key map "\M-s_" 'isearch-toggle-symbol)
@@ -602,6 +603,11 @@
 ;;   case in the search string is ignored.
 (defvar isearch-case-fold-search nil)
 
+;; search-invisible while searching.
+;;   either nil, t, or 'open.  'open means the same as t except that
+;;   opens hidden overlays.
+(defvar isearch-invisible search-invisible)
+
 (defvar isearch-last-case-fold-search nil)
 
 ;; Used to save default value while isearch is active
@@ -700,6 +706,7 @@
  nonincremental search.
 
 Type \\[isearch-toggle-case-fold] to toggle search case-sensitivity.
+Type \\[isearch-toggle-invisible] to toggle search in invisible text.
 Type \\[isearch-toggle-regexp] to toggle regular-expression mode.
 Type \\[isearch-toggle-word] to toggle word mode.
 Type \\[isearch-toggle-symbol] to toggle symbol mode.
@@ -836,6 +843,7 @@
        isearch-op-fun op-fun
        isearch-last-case-fold-search isearch-case-fold-search
        isearch-case-fold-search case-fold-search
+       isearch-invisible search-invisible
        isearch-string ""
        isearch-message ""
        isearch-cmds nil
@@ -1474,7 +1482,8 @@
   (isearch-update))
 
 (defun isearch-toggle-case-fold ()
-  "Toggle case folding in searching on or off."
+  "Toggle case folding in searching on or off.
+Toggles the value of the variable `isearch-case-fold-search'."
   (interactive)
   (setq isearch-case-fold-search
        (if isearch-case-fold-search nil 'yes))
@@ -1487,6 +1496,23 @@
   (sit-for 1)
   (isearch-update))
 
+(defun isearch-toggle-invisible ()
+  "Toggle searching in invisible text on or off.
+Toggles the variable `isearch-invisible' between values
+nil and a non-nil value of the option `search-invisible'
+\(or `open' if `search-invisible' is nil)."
+  (interactive)
+  (setq isearch-invisible
+       (if isearch-invisible nil (or search-invisible 'open)))
+  (let ((message-log-max nil))
+    (message "%s%s [match %svisible text]"
+            (isearch-message-prefix nil isearch-nonincremental)
+            isearch-message
+            (if isearch-invisible "in" "")))
+  (setq isearch-success t isearch-adjusted t)
+  (sit-for 1)
+  (isearch-update))
+
 
 ;; Word search
 
@@ -1622,6 +1648,7 @@
        ;; set `search-upper-case' to nil to not call
        ;; `isearch-no-upper-case-p' in `perform-replace'
        (search-upper-case nil)
+       (search-invisible isearch-invisible)
        (replace-lax-whitespace
         isearch-lax-whitespace)
        (replace-regexp-lax-whitespace
@@ -2638,9 +2665,10 @@
       (setq isearch-case-fold-search
            (isearch-no-upper-case-p isearch-string isearch-regexp)))
   (condition-case lossage
-      (let ((inhibit-point-motion-hooks search-invisible)
+      (let ((inhibit-point-motion-hooks isearch-invisible)
            (inhibit-quit nil)
            (case-fold-search isearch-case-fold-search)
+           (search-invisible isearch-invisible)
            (retry t))
        (setq isearch-error nil)
        (while retry
@@ -2836,7 +2864,7 @@
 searched too when `search-invisible' is t."
   (or (eq search-invisible t)
       (not (isearch-range-invisible beg end))))
-(make-obsolete 'isearch-filter-visible 'search-invisible "24.4")
+(make-obsolete 'isearch-filter-visible 'isearch-invisible "24.4")
 
 
 ;; General utilities


reply via email to

[Prev in Thread] Current Thread [Next in Thread]