/[emacs]/emacs/lisp/info.el
ViewVC logotype

Diff of /emacs/lisp/info.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.419 by jurta, Sat Mar 12 02:18:32 2005 UTC revision 1.420 by jurta, Tue Mar 15 10:46:00 2005 UTC
# Line 210  top/final node depending on search direc Line 210  top/final node depending on search direc
210    :type 'boolean    :type 'boolean
211    :group 'info)    :group 'info)
212    
213    (defvar Info-isearch-initial-node nil)
214    
215  (defcustom Info-mode-hook  (defcustom Info-mode-hook
216    ;; Try to obey obsolete Info-fontify settings.    ;; Try to obey obsolete Info-fontify settings.
217    (unless (and (boundp 'Info-fontify) (null Info-fontify))    (unless (and (boundp 'Info-fontify) (null Info-fontify))
# Line 1514  If DIRECTION is `backward', search in th Line 1516  If DIRECTION is `backward', search in th
1516                    (setq found (point) beg-found (if backward (match-end 0)                    (setq found (point) beg-found (if backward (match-end 0)
1517                                                    (match-beginning 0)))                                                    (match-beginning 0)))
1518                  (setq give-up t))))))                  (setq give-up t))))))
1519    
1520          (when (and isearch-mode Info-isearch-search
1521                     (not Info-isearch-initial-node)
1522                     (not bound)
1523                     (or give-up (and found (not (and (> found opoint-min)
1524                                                      (< found opoint-max))))))
1525            (signal 'search-failed (list regexp "initial node")))
1526    
1527        ;; If no subfiles, give error now.        ;; If no subfiles, give error now.
1528        (if give-up        (if give-up
1529            (if (null Info-current-subfile)            (if (null Info-current-subfile)
# Line 1523  If DIRECTION is `backward', search in th Line 1533  If DIRECTION is `backward', search in th
1533                    (re-search-forward regexp)))                    (re-search-forward regexp)))
1534              (setq found nil)))              (setq found nil)))
1535    
1536          (if (and bound (not found))
1537              (signal 'search-failed (list regexp)))
1538    
1539        (unless (or found bound)        (unless (or found bound)
1540          (unwind-protect          (unwind-protect
1541              ;; Try other subfiles.              ;; Try other subfiles.
# Line 1650  If DIRECTION is `backward', search in th Line 1663  If DIRECTION is `backward', search in th
1663  (defun Info-isearch-search ()  (defun Info-isearch-search ()
1664    (if Info-isearch-search    (if Info-isearch-search
1665        (lambda (string &optional bound noerror count)        (lambda (string &optional bound noerror count)
1666          (condition-case nil          (if isearch-word
1667              (if isearch-word              (Info-search (concat "\\b" (replace-regexp-in-string
1668                  (Info-search (concat "\\b" (replace-regexp-in-string                                          "\\W+" "\\\\W+"
1669                                              "\\W+" "\\\\W+"                                          (replace-regexp-in-string
1670                                              (replace-regexp-in-string                                           "^\\W+\\|\\W+$" "" string)) "\\b")
1671                                               "^\\W+\\|\\W+$" "" string)) "\\b")                           bound noerror count
1672                               bound noerror count                           (unless isearch-forward 'backward))
1673                               (unless isearch-forward 'backward))            (Info-search (if isearch-regexp string (regexp-quote string))
1674                (Info-search (if isearch-regexp string (regexp-quote string))                         bound noerror count
1675                             bound noerror count                         (unless isearch-forward 'backward))
1676                             (unless isearch-forward 'backward))            (point)))
               (point))  
           (error nil)))  
1677      (let ((isearch-search-fun-function nil))      (let ((isearch-search-fun-function nil))
1678        (isearch-search-fun))))        (isearch-search-fun))))
1679    
1680  (defun Info-isearch-wrap ()  (defun Info-isearch-wrap ()
1681    (when Info-isearch-search    (if Info-isearch-search
1682      (if isearch-forward (Info-top-node) (Info-final-node))        (if Info-isearch-initial-node
1683              (progn
1684                (if isearch-forward (Info-top-node) (Info-final-node))
1685                (goto-char (if isearch-forward (point-min) (point-max))))
1686            (setq Info-isearch-initial-node Info-current-node)
1687            (setq isearch-wrapped nil))
1688      (goto-char (if isearch-forward (point-min) (point-max)))))      (goto-char (if isearch-forward (point-min) (point-max)))))
1689    
1690  (defun Info-isearch-push-state ()  (defun Info-isearch-push-state ()
# Line 1680  If DIRECTION is `backward', search in th Line 1696  If DIRECTION is `backward', search in th
1696             (string= Info-current-node node))             (string= Info-current-node node))
1697        (progn (Info-find-node file node) (sit-for 0))))        (progn (Info-find-node file node) (sit-for 0))))
1698    
1699    (defun Info-isearch-start ()
1700      (setq Info-isearch-initial-node nil))
1701    
1702  (defun Info-extract-pointer (name &optional errorname)  (defun Info-extract-pointer (name &optional errorname)
1703    "Extract the value of the node-pointer named NAME.    "Extract the value of the node-pointer named NAME.
# Line 3217  Advanced commands: Line 3235  Advanced commands:
3235    (setq desktop-save-buffer 'Info-desktop-buffer-misc-data)    (setq desktop-save-buffer 'Info-desktop-buffer-misc-data)
3236    (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)    (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)
3237    (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)    (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
3238      (add-hook 'isearch-mode-hook 'Info-isearch-start nil t)
3239    (set (make-local-variable 'isearch-search-fun-function)    (set (make-local-variable 'isearch-search-fun-function)
3240         'Info-isearch-search)         'Info-isearch-search)
3241    (set (make-local-variable 'isearch-wrap-function)    (set (make-local-variable 'isearch-wrap-function)

Legend:
Removed from v.1.419  
changed lines
  Added in v.1.420

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26