Commit 180ee7c7 authored by Juri Linkov's avatar Juri Linkov

(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.
parent 20c78df0
...@@ -15,6 +15,10 @@ ...@@ -15,6 +15,10 @@
contents to the current condition. Set histpos to 1 if initial contents to the current condition. Set histpos to 1 if initial
contents is equal to the last history element. contents is equal to the last history element.
* info.el (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.
2004-11-27 Luc Teirlinck <teirllm@auburn.edu> 2004-11-27 Luc Teirlinck <teirllm@auburn.edu>
* fringe.el (fringe-indicators): Add fake defvar to avoid compiler * fringe.el (fringe-indicators): Add fake defvar to avoid compiler
......
...@@ -188,7 +188,7 @@ file, so be prepared for a few surprises if you enable this feature." ...@@ -188,7 +188,7 @@ file, so be prepared for a few surprises if you enable this feature."
:type 'boolean :type 'boolean
:group 'info) :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. "*If non-nil, regular expression to match a sequence of whitespace chars.
This applies to Info search for regular expressions. This applies to Info search for regular expressions.
You might want to use something like \"[ \\t\\r\\n]+\" instead. You might want to use something like \"[ \\t\\r\\n]+\" instead.
...@@ -1486,14 +1486,14 @@ If DIRECTION is `backward', search in the reverse direction." ...@@ -1486,14 +1486,14 @@ If DIRECTION is `backward', search in the reverse direction."
(isearch-range-invisible found beg-found) (isearch-range-invisible found beg-found)
(isearch-range-invisible beg-found found)) (isearch-range-invisible beg-found found))
;; Skip node header line ;; Skip node header line
(save-excursion (forward-line -1) (and (save-excursion (forward-line -1)
(looking-at "\^_")) (looking-at "\^_"))
(forward-line 1))
;; Skip Tag Table node ;; Skip Tag Table node
(save-excursion (save-excursion
(and (search-backward "\^_" nil t) (and (search-backward "\^_" nil t)
(looking-at "\^_\nTag Table")))))) (looking-at "\^_\nTag Table"))))))
(let ((search-spaces-regexp (let ((search-spaces-regexp Info-search-whitespace-regexp))
Info-search-whitespace-regexp))
(if (if backward (if (if backward
(re-search-backward regexp bound t) (re-search-backward regexp bound t)
(re-search-forward regexp bound t)) (re-search-forward regexp bound t))
...@@ -1503,9 +1503,10 @@ If DIRECTION is `backward', search in the reverse direction." ...@@ -1503,9 +1503,10 @@ If DIRECTION is `backward', search in the reverse direction."
;; If no subfiles, give error now. ;; If no subfiles, give error now.
(if give-up (if give-up
(if (null Info-current-subfile) (if (null Info-current-subfile)
(if backward (let ((search-spaces-regexp Info-search-whitespace-regexp))
(re-search-backward regexp) (if backward
(re-search-forward regexp)) (re-search-backward regexp)
(re-search-forward regexp)))
(setq found nil))) (setq found nil)))
(unless (or found bound) (unless (or found bound)
...@@ -1561,18 +1562,20 @@ If DIRECTION is `backward', search in the reverse direction." ...@@ -1561,18 +1562,20 @@ If DIRECTION is `backward', search in the reverse direction."
(isearch-range-invisible found beg-found) (isearch-range-invisible found beg-found)
(isearch-range-invisible beg-found found)) (isearch-range-invisible beg-found found))
;; Skip node header line ;; Skip node header line
(save-excursion (forward-line -1) (and (save-excursion (forward-line -1)
(looking-at "\^_")) (looking-at "\^_"))
(forward-line 1))
;; Skip Tag Table node ;; Skip Tag Table node
(save-excursion (save-excursion
(and (search-backward "\^_" nil t) (and (search-backward "\^_" nil t)
(looking-at "\^_\nTag Table")))))) (looking-at "\^_\nTag Table"))))))
(if (if backward (let ((search-spaces-regexp Info-search-whitespace-regexp))
(re-search-backward regexp nil t) (if (if backward
(re-search-forward regexp nil t)) (re-search-backward regexp nil t)
(setq found (point) beg-found (if backward (match-end 0) (re-search-forward regexp nil t))
(match-beginning 0))) (setq found (point) beg-found (if backward (match-end 0)
(setq give-up t))) (match-beginning 0)))
(setq give-up t))))
(if give-up (if give-up
(setq found nil)) (setq found nil))
(if found (if found
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment