# HG changeset patch # User Juri Linkov # Date 1099681584 0 # Node ID 117144126cd9a15b640aa3c226669b630aa35d39 # Parent effc031180e9aa1a38a6e55411467c168d12ef29 (Info-search): Don't search in node header lines and file headers. diff -r effc031180e9 -r 117144126cd9 lisp/info.el --- a/lisp/info.el Fri Nov 05 19:05:44 2004 +0000 +++ b/lisp/info.el Fri Nov 05 19:06:24 2004 +0000 @@ -1476,11 +1476,21 @@ (save-excursion (save-restriction (widen) + (when backward + ;; Hide Info file header for backward search + (narrow-to-region (save-excursion + (goto-char (point-min)) + (search-forward "\n\^_") + (1- (point))) + (point-max))) (while (and (not give-up) (or (null found) (if backward (isearch-range-invisible found beg-found) - (isearch-range-invisible beg-found found)))) + (isearch-range-invisible beg-found found)) + ;; Skip node header line + (save-excursion (forward-line -1) + (looking-at "\^_")))) (if (if backward (re-search-backward regexp bound t) (re-search-forward regexp bound t)) @@ -1531,14 +1541,24 @@ (while list (message "Searching subfile %s..." (cdr (car list))) (Info-read-subfile (car (car list))) - (if backward (goto-char (point-max))) + (when backward + ;; Hide Info file header for backward search + (narrow-to-region (save-excursion + (goto-char (point-min)) + (search-forward "\n\^_") + (1- (point))) + (point-max)) + (goto-char (point-max))) (setq list (cdr list)) (setq give-up nil found nil) (while (and (not give-up) (or (null found) (if backward (isearch-range-invisible found beg-found) - (isearch-range-invisible beg-found found)))) + (isearch-range-invisible beg-found found)) + ;; Skip node header line + (save-excursion (forward-line -1) + (looking-at "\^_")))) (if (if backward (re-search-backward regexp nil t) (re-search-forward regexp nil t))