# HG changeset patch # User Juri Linkov # Date 1101656476 0 # Node ID a227196e4498c3c0cdf564089d9dbd3c3732ea1b # Parent f8abf4233022e5f5bc3e4e7ceee5a98ea7849dab (Info-search-whitespace-regexp): Remove shy group. (Info-search): Forward line if search is on the header line. Use search-whitespace-regexp in two other places. diff -r f8abf4233022 -r a227196e4498 lisp/info.el --- a/lisp/info.el Sun Nov 28 07:57:10 2004 +0000 +++ b/lisp/info.el Sun Nov 28 15:41:16 2004 +0000 @@ -188,7 +188,7 @@ :type 'boolean :group 'info) -(defcustom Info-search-whitespace-regexp "\\(?:\\s-+\\)" +(defcustom Info-search-whitespace-regexp "\\s-+" "*If non-nil, regular expression to match a sequence of whitespace chars. This applies to Info search for regular expressions. You might want to use something like \"[ \\t\\r\\n]+\" instead. @@ -1486,14 +1486,14 @@ (isearch-range-invisible found beg-found) (isearch-range-invisible beg-found found)) ;; Skip node header line - (save-excursion (forward-line -1) - (looking-at "\^_")) + (and (save-excursion (forward-line -1) + (looking-at "\^_")) + (forward-line 1)) ;; Skip Tag Table node (save-excursion (and (search-backward "\^_" nil t) (looking-at "\^_\nTag Table")))))) - (let ((search-spaces-regexp - Info-search-whitespace-regexp)) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) (if (if backward (re-search-backward regexp bound t) (re-search-forward regexp bound t)) @@ -1503,9 +1503,10 @@ ;; If no subfiles, give error now. (if give-up (if (null Info-current-subfile) - (if backward - (re-search-backward regexp) - (re-search-forward regexp)) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) + (if backward + (re-search-backward regexp) + (re-search-forward regexp))) (setq found nil))) (unless (or found bound) @@ -1561,18 +1562,20 @@ (isearch-range-invisible found beg-found) (isearch-range-invisible beg-found found)) ;; Skip node header line - (save-excursion (forward-line -1) - (looking-at "\^_")) + (and (save-excursion (forward-line -1) + (looking-at "\^_")) + (forward-line 1)) ;; Skip Tag Table node (save-excursion (and (search-backward "\^_" nil t) (looking-at "\^_\nTag Table")))))) - (if (if backward - (re-search-backward regexp nil t) - (re-search-forward regexp nil t)) - (setq found (point) beg-found (if backward (match-end 0) - (match-beginning 0))) - (setq give-up t))) + (let ((search-spaces-regexp Info-search-whitespace-regexp)) + (if (if backward + (re-search-backward regexp nil t) + (re-search-forward regexp nil t)) + (setq found (point) beg-found (if backward (match-end 0) + (match-beginning 0))) + (setq give-up t)))) (if give-up (setq found nil)) (if found