emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/info.el


From: Juri Linkov
Subject: [Emacs-diffs] Changes to emacs/lisp/info.el
Date: Tue, 15 Mar 2005 05:46:01 -0500

Index: emacs/lisp/info.el
diff -c emacs/lisp/info.el:1.419 emacs/lisp/info.el:1.420
*** emacs/lisp/info.el:1.419    Sat Mar 12 02:18:32 2005
--- emacs/lisp/info.el  Tue Mar 15 10:46:00 2005
***************
*** 210,215 ****
--- 210,217 ----
    :type 'boolean
    :group 'info)
  
+ (defvar Info-isearch-initial-node nil)
+ 
  (defcustom Info-mode-hook
    ;; Try to obey obsolete Info-fontify settings.
    (unless (and (boundp 'Info-fontify) (null Info-fontify))
***************
*** 1514,1519 ****
--- 1516,1529 ----
                  (setq found (point) beg-found (if backward (match-end 0)
                                                  (match-beginning 0)))
                (setq give-up t))))))
+ 
+       (when (and isearch-mode Info-isearch-search
+                (not Info-isearch-initial-node)
+                (not bound)
+                (or give-up (and found (not (and (> found opoint-min)
+                                                 (< found opoint-max))))))
+       (signal 'search-failed (list regexp "initial node")))
+ 
        ;; If no subfiles, give error now.
        (if give-up
          (if (null Info-current-subfile)
***************
*** 1523,1528 ****
--- 1533,1541 ----
                  (re-search-forward regexp)))
            (setq found nil)))
  
+       (if (and bound (not found))
+         (signal 'search-failed (list regexp)))
+ 
        (unless (or found bound)
        (unwind-protect
            ;; Try other subfiles.
***************
*** 1650,1674 ****
  (defun Info-isearch-search ()
    (if Info-isearch-search
        (lambda (string &optional bound noerror count)
!       (condition-case nil
!           (if isearch-word
!               (Info-search (concat "\\b" (replace-regexp-in-string
!                                           "\\W+" "\\\\W+"
!                                           (replace-regexp-in-string
!                                            "^\\W+\\|\\W+$" "" string)) "\\b")
!                            bound noerror count
!                            (unless isearch-forward 'backward))
!             (Info-search (if isearch-regexp string (regexp-quote string))
!                          bound noerror count
!                          (unless isearch-forward 'backward))
!             (point))
!         (error nil)))
      (let ((isearch-search-fun-function nil))
        (isearch-search-fun))))
  
  (defun Info-isearch-wrap ()
!   (when Info-isearch-search
!     (if isearch-forward (Info-top-node) (Info-final-node))
      (goto-char (if isearch-forward (point-min) (point-max)))))
  
  (defun Info-isearch-push-state ()
--- 1663,1690 ----
  (defun Info-isearch-search ()
    (if Info-isearch-search
        (lambda (string &optional bound noerror count)
!       (if isearch-word
!           (Info-search (concat "\\b" (replace-regexp-in-string
!                                       "\\W+" "\\\\W+"
!                                       (replace-regexp-in-string
!                                        "^\\W+\\|\\W+$" "" string)) "\\b")
!                        bound noerror count
!                        (unless isearch-forward 'backward))
!         (Info-search (if isearch-regexp string (regexp-quote string))
!                      bound noerror count
!                      (unless isearch-forward 'backward))
!         (point)))
      (let ((isearch-search-fun-function nil))
        (isearch-search-fun))))
  
  (defun Info-isearch-wrap ()
!   (if Info-isearch-search
!       (if Info-isearch-initial-node
!         (progn
!           (if isearch-forward (Info-top-node) (Info-final-node))
!           (goto-char (if isearch-forward (point-min) (point-max))))
!       (setq Info-isearch-initial-node Info-current-node)
!       (setq isearch-wrapped nil))
      (goto-char (if isearch-forward (point-min) (point-max)))))
  
  (defun Info-isearch-push-state ()
***************
*** 1680,1685 ****
--- 1696,1703 ----
             (string= Info-current-node node))
        (progn (Info-find-node file node) (sit-for 0))))
  
+ (defun Info-isearch-start ()
+   (setq Info-isearch-initial-node nil))
  
  (defun Info-extract-pointer (name &optional errorname)
    "Extract the value of the node-pointer named NAME.
***************
*** 3217,3222 ****
--- 3235,3241 ----
    (setq desktop-save-buffer 'Info-desktop-buffer-misc-data)
    (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t)
    (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
+   (add-hook 'isearch-mode-hook 'Info-isearch-start nil t)
    (set (make-local-variable 'isearch-search-fun-function)
         'Info-isearch-search)
    (set (make-local-variable 'isearch-wrap-function)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]