diff options
| author | Juri Linkov | 2010-05-10 22:07:22 +0300 |
|---|---|---|
| committer | Juri Linkov | 2010-05-10 22:07:22 +0300 |
| commit | 4bbedd9832178fcd264de9e6210d0dadbe3e2940 (patch) | |
| tree | 7dc60c4078f621cb8d7d75784b1e731959c522d6 | |
| parent | ae5e04fabcf5b6099aa8e1974566cad715e535f7 (diff) | |
| download | emacs-4bbedd9832178fcd264de9e6210d0dadbe3e2940.tar.gz emacs-4bbedd9832178fcd264de9e6210d0dadbe3e2940.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/info.el | 24 |
2 files changed, 33 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8bc5a26df8f..99a0a889d53 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2010-05-10 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | Remove nodes visited during Isearch from the Info history. | ||
| 4 | * info.el (Info-isearch-initial-history) | ||
| 5 | (Info-isearch-initial-history-list): New variables. | ||
| 6 | (Info-isearch-start): Record initial values of | ||
| 7 | Info-isearch-initial-history and Info-isearch-initial-history-list. | ||
| 8 | Add Info-isearch-end to isearch-mode-end-hook. | ||
| 9 | (Info-isearch-end): New function. | ||
| 10 | |||
| 1 | 2010-05-10 Michael Albinus <michael.albinus@gmx.de> | 11 | 2010-05-10 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 12 | ||
| 3 | * net/tramp.el (tramp-do-file-attributes-with-stat): Add space in | 13 | * net/tramp.el (tramp-do-file-attributes-with-stat): Add space in |
diff --git a/lisp/info.el b/lisp/info.el index f526ff22a0e..e76a8da146e 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -266,6 +266,8 @@ with wrapping around the current Info node." | |||
| 266 | :group 'info) | 266 | :group 'info) |
| 267 | 267 | ||
| 268 | (defvar Info-isearch-initial-node nil) | 268 | (defvar Info-isearch-initial-node nil) |
| 269 | (defvar Info-isearch-initial-history nil) | ||
| 270 | (defvar Info-isearch-initial-history-list nil) | ||
| 269 | 271 | ||
| 270 | (defcustom Info-mode-hook | 272 | (defcustom Info-mode-hook |
| 271 | ;; Try to obey obsolete Info-fontify settings. | 273 | ;; Try to obey obsolete Info-fontify settings. |
| @@ -1914,7 +1916,27 @@ If DIRECTION is `backward', search in the reverse direction." | |||
| 1914 | (setq Info-isearch-initial-node | 1916 | (setq Info-isearch-initial-node |
| 1915 | ;; Don't stop at initial node for nonincremental search. | 1917 | ;; Don't stop at initial node for nonincremental search. |
| 1916 | ;; Otherwise this variable is set after first search failure. | 1918 | ;; Otherwise this variable is set after first search failure. |
| 1917 | (and isearch-nonincremental Info-current-node))) | 1919 | (and isearch-nonincremental Info-current-node)) |
| 1920 | (setq Info-isearch-initial-history Info-history | ||
| 1921 | Info-isearch-initial-history-list Info-history-list) | ||
| 1922 | (add-hook 'isearch-mode-end-hook 'Info-isearch-end nil t)) | ||
| 1923 | |||
| 1924 | (defun Info-isearch-end () | ||
| 1925 | ;; Remove intermediate nodes (visited while searching) | ||
| 1926 | ;; from the history. Add only the last node (where Isearch ended). | ||
| 1927 | (if (> (length Info-history) | ||
| 1928 | (length Info-isearch-initial-history)) | ||
| 1929 | (setq Info-history | ||
| 1930 | (nthcdr (- (length Info-history) | ||
| 1931 | (length Info-isearch-initial-history) | ||
| 1932 | 1) | ||
| 1933 | Info-history))) | ||
| 1934 | (if (> (length Info-history-list) | ||
| 1935 | (length Info-isearch-initial-history-list)) | ||
| 1936 | (setq Info-history-list | ||
| 1937 | (cons (car Info-history-list) | ||
| 1938 | Info-isearch-initial-history-list))) | ||
| 1939 | (remove-hook 'isearch-mode-end-hook 'Info-isearch-end t)) | ||
| 1918 | 1940 | ||
| 1919 | (defun Info-isearch-filter (beg-found found) | 1941 | (defun Info-isearch-filter (beg-found found) |
| 1920 | "Test whether the current search hit is a visible useful text. | 1942 | "Test whether the current search hit is a visible useful text. |