emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r100219: Remove nodes visited during


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r100219: Remove nodes visited during Isearch from the Info history.
Date: Mon, 10 May 2010 22:07:22 +0300
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 100219
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Mon 2010-05-10 22:07:22 +0300
message:
  Remove nodes visited during Isearch from the Info history.
  * info.el (Info-isearch-initial-history)
  (Info-isearch-initial-history-list): New variables.
  (Info-isearch-start): Record initial values of
  Info-isearch-initial-history and Info-isearch-initial-history-list.
  Add Info-isearch-end to isearch-mode-end-hook.
  (Info-isearch-end): New function.
modified:
  lisp/ChangeLog
  lisp/info.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-05-10 15:50:30 +0000
+++ b/lisp/ChangeLog    2010-05-10 19:07:22 +0000
@@ -1,3 +1,13 @@
+2010-05-10  Juri Linkov  <address@hidden>
+
+       Remove nodes visited during Isearch from the Info history.
+       * info.el (Info-isearch-initial-history)
+       (Info-isearch-initial-history-list): New variables.
+       (Info-isearch-start): Record initial values of
+       Info-isearch-initial-history and Info-isearch-initial-history-list.
+       Add Info-isearch-end to isearch-mode-end-hook.
+       (Info-isearch-end): New function.
+
 2010-05-10  Michael Albinus  <address@hidden>
 
        * net/tramp.el (tramp-do-file-attributes-with-stat): Add space in

=== modified file 'lisp/info.el'
--- a/lisp/info.el      2010-05-08 18:47:07 +0000
+++ b/lisp/info.el      2010-05-10 19:07:22 +0000
@@ -266,6 +266,8 @@
   :group 'info)
 
 (defvar Info-isearch-initial-node nil)
+(defvar Info-isearch-initial-history nil)
+(defvar Info-isearch-initial-history-list nil)
 
 (defcustom Info-mode-hook
   ;; Try to obey obsolete Info-fontify settings.
@@ -1914,7 +1916,27 @@
   (setq Info-isearch-initial-node
        ;; Don't stop at initial node for nonincremental search.
        ;; Otherwise this variable is set after first search failure.
-       (and isearch-nonincremental Info-current-node)))
+       (and isearch-nonincremental Info-current-node))
+  (setq Info-isearch-initial-history      Info-history
+       Info-isearch-initial-history-list Info-history-list)
+  (add-hook 'isearch-mode-end-hook 'Info-isearch-end nil t))
+
+(defun Info-isearch-end ()
+  ;; Remove intermediate nodes (visited while searching)
+  ;; from the history.  Add only the last node (where Isearch ended).
+  (if (> (length Info-history)
+        (length Info-isearch-initial-history))
+      (setq Info-history
+           (nthcdr (- (length Info-history)
+                      (length Info-isearch-initial-history)
+                      1)
+                   Info-history)))
+  (if (> (length Info-history-list)
+        (length Info-isearch-initial-history-list))
+      (setq Info-history-list
+           (cons (car Info-history-list)
+                 Info-isearch-initial-history-list)))
+  (remove-hook 'isearch-mode-end-hook  'Info-isearch-end t))
 
 (defun Info-isearch-filter (beg-found found)
   "Test whether the current search hit is a visible useful text.


reply via email to

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