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: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/info.el
Date: Fri, 25 Nov 2005 11:35:36 -0500

Index: emacs/lisp/info.el
diff -c emacs/lisp/info.el:1.461 emacs/lisp/info.el:1.462
*** emacs/lisp/info.el:1.461    Thu Nov 24 16:10:00 2005
--- emacs/lisp/info.el  Fri Nov 25 16:35:34 2005
***************
*** 290,297 ****
  (defvar Info-current-file nil
    "Info file that Info is now looking at, or nil.
  This is the name that was specified in Info, not the actual file name.
! It doesn't contain directory names or file name extensions added by Info.
! Can also be t when using `Info-on-current-buffer'.")
  
  (defvar Info-current-subfile nil
    "Info subfile that is actually in the *info* buffer now.
--- 290,296 ----
  (defvar Info-current-file nil
    "Info file that Info is now looking at, or nil.
  This is the name that was specified in Info, not the actual file name.
! It doesn't contain directory names or file name extensions added by Info.")
  
  (defvar Info-current-subfile nil
    "Info subfile that is actually in the *info* buffer now.
***************
*** 691,702 ****
    ;; Go into Info buffer.
    (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
    ;; Record the node we are leaving.
!   (if (and Info-current-file (not no-going-back))
        (setq Info-history
              (cons (list Info-current-file Info-current-node (point))
                    Info-history)))
    (Info-find-node-2 filename nodename no-going-back))
  
  (defun Info-on-current-buffer (&optional nodename)
    "Use the `Info-mode' to browse the current Info buffer.
  If a prefix arg is provided, it queries for the NODENAME which
--- 690,702 ----
    ;; Go into Info buffer.
    (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*"))
    ;; Record the node we are leaving.
!   (if (not no-going-back)
        (setq Info-history
              (cons (list Info-current-file Info-current-node (point))
                    Info-history)))
    (Info-find-node-2 filename nodename no-going-back))
  
+ ;;;###autoload
  (defun Info-on-current-buffer (&optional nodename)
    "Use the `Info-mode' to browse the current Info buffer.
  If a prefix arg is provided, it queries for the NODENAME which
***************
*** 708,714 ****
    (unless nodename (setq nodename "Top"))
    (info-initialize)
    (Info-mode)
!   (set (make-local-variable 'Info-current-file) t)
    (Info-find-node-2 nil nodename))
  
  ;; It's perhaps a bit nasty to kill the *info* buffer to force a re-read,
--- 708,717 ----
    (unless nodename (setq nodename "Top"))
    (info-initialize)
    (Info-mode)
!   (set (make-local-variable 'Info-current-file)
!        (or buffer-file-name
!          ;; If called on a non-file buffer, make a fake file name.
!          (concat default-directory (buffer-name))))
    (Info-find-node-2 nil nodename))
  
  ;; It's perhaps a bit nasty to kill the *info* buffer to force a re-read,
***************
*** 726,733 ****
        (pline        (count-lines (point-min) (line-beginning-position)))
        (wline        (count-lines (point-min) (window-start)))
        (old-history  Info-history)
!       (new-history (and Info-current-file
!                         (list Info-current-file Info-current-node (point)))))
      (kill-buffer (current-buffer))
      (Info-find-node filename nodename)
      (setq Info-history old-history)
--- 729,735 ----
        (pline        (count-lines (point-min) (line-beginning-position)))
        (wline        (count-lines (point-min) (window-start)))
        (old-history  Info-history)
!       (new-history  (list Info-current-file Info-current-node (point))))
      (kill-buffer (current-buffer))
      (Info-find-node filename nodename)
      (setq Info-history old-history)
***************
*** 1400,1411 ****
        (nconc (propertized-buffer-identification "%b")
               (list
                (concat " ("
!                       (file-name-nondirectory
!                        (if (stringp Info-current-file)
!                            Info-current-file
!                          (or buffer-file-name "")))
!                       ") "
!                       (or Info-current-node ""))))))
  
  ;; Go to an Info node specified with a filename-and-nodename string
  ;; of the sort that is found in pointers in nodes.
--- 1402,1411 ----
        (nconc (propertized-buffer-identification "%b")
               (list
                (concat " ("
!                       (if Info-current-file
!                           (file-name-nondirectory Info-current-file)
!                         " ")
!                       ") " (or Info-current-node ""))))))
  
  ;; Go to an Info node specified with a filename-and-nodename string
  ;; of the sort that is found in pointers in nodes.
***************
*** 1884,1890 ****
      (let ((old-node Info-current-node)
          (old-file Info-current-file)
          (node (Info-extract-pointer "up")) p)
!       (and (or same-file (not (stringp Info-current-file)))
           (string-match "^(" node)
           (error "Up node is in another Info file"))
        (Info-goto-node node)
--- 1884,1890 ----
      (let ((old-node Info-current-node)
          (old-file Info-current-file)
          (node (Info-extract-pointer "up")) p)
!       (and same-file
           (string-match "^(" node)
           (error "Up node is in another Info file"))
        (Info-goto-node node)
***************
*** 3266,3277 ****
    (interactive "P")
    (unless Info-current-node
      (error "No current Info node"))
!   (let ((node (concat "(" (file-name-nondirectory
!                            (or (and (stringp Info-current-file)
!                                     Info-current-file)
!                                buffer-file-name
!                                ""))
!                       ")" Info-current-node)))
      (if (zerop (prefix-numeric-value arg))
          (setq node (concat "(info \"" node "\")")))
      (kill-new node)
--- 3266,3273 ----
    (interactive "P")
    (unless Info-current-node
      (error "No current Info node"))
!   (let ((node (concat "(" (file-name-nondirectory Info-current-file) ")"
!                     Info-current-node)))
      (if (zerop (prefix-numeric-value arg))
          (setq node (concat "(info \"" node "\")")))
      (kill-new node)
***************
*** 3804,3831 ****
                                               (and (not (equal (match-string 
4) ""))
                                                    (match-string 4))
                                               (match-string 2)))))
!                                  (file (file-name-nondirectory
!                                         (if Info-current-file
!                                           (if (stringp Info-current-file)
!                                               Info-current-file
!                                             (buffer-file-name)))))
                                   (hl Info-history-list)
                                   res)
                              (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node)
!                                 (setq file (file-name-nondirectory
!                                             (match-string 1 node))
                                        node (if (equal (match-string 2 node) 
"")
                                                 "Top"
                                               (match-string 2 node))))
!                             (while hl
!                               (if (and (string-equal node (nth 1 (car hl)))
!                                      (or (and (eq t Info-current-file)
!                                               (eq t (nth 0 (car hl))))
!                                          (string-equal file
!                                                        (file-name-nondirectory
!                                                         (nth 0 (car hl))))))
!                                   (setq res (car hl) hl nil)
!                                 (setq hl (cdr hl))))
                              res))) 'info-xref-visited 'info-xref))
                ;; For multiline ref, unfontify newline and surrounding 
whitespace
                (save-excursion
--- 3800,3818 ----
                                               (and (not (equal (match-string 
4) ""))
                                                    (match-string 4))
                                               (match-string 2)))))
!                                  (file Info-current-file)
                                   (hl Info-history-list)
                                   res)
                              (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node)
!                                 (setq file (Info-find-file (match-string 1 
node))
                                        node (if (equal (match-string 2 node) 
"")
                                                 "Top"
                                               (match-string 2 node))))
!                           (while hl
!                             (if (and (string-equal node (nth 1 (car hl)))
!                                      (string-equal file (nth 0 (car hl))))
!                                 (setq res (car hl) hl nil)
!                               (setq hl (cdr hl))))
                              res))) 'info-xref-visited 'info-xref))
                ;; For multiline ref, unfontify newline and surrounding 
whitespace
                (save-excursion
***************
*** 3918,3945 ****
                              (let ((node (if (equal (match-string 3) "")
                                              (match-string 1)
                                            (match-string 3)))
!                                   (file (file-name-nondirectory
!                                        (if Info-current-file
!                                            (if (stringp Info-current-file)
!                                                Info-current-file
!                                              (buffer-file-name)))))
                                    (hl Info-history-list)
                                    res)
                                (if (string-match "(\\([^)]+\\))\\([^)]*\\)" 
node)
!                                   (setq file (file-name-nondirectory
!                                               (match-string 1 node))
                                          node (if (equal (match-string 2 node) 
"")
                                                   "Top"
                                                 (match-string 2 node))))
!                               (while hl
!                                 (if (and (string-equal node (nth 1 (car hl)))
!                                        (or (and (eq t Info-current-file)
!                                                 (eq t (nth 0 (car hl))))
!                                            (string-equal file
!                                                          
(file-name-nondirectory
!                                                           (nth 0 (car hl))))))
!                                     (setq res (car hl) hl nil)
!                                   (setq hl (cdr hl))))
                                res))) 'info-xref-visited 'info-xref)))
              (when (and not-fontified-p (memq Info-hide-note-references '(t 
hide)))
                (put-text-property (match-beginning 2) (1- (match-end 6))
--- 3905,3923 ----
                              (let ((node (if (equal (match-string 3) "")
                                              (match-string 1)
                                            (match-string 3)))
!                                   (file Info-current-file)
                                    (hl Info-history-list)
                                    res)
                                (if (string-match "(\\([^)]+\\))\\([^)]*\\)" 
node)
!                                   (setq file (Info-find-file (match-string 1 
node))
                                          node (if (equal (match-string 2 node) 
"")
                                                   "Top"
                                                 (match-string 2 node))))
!                             (while hl
!                               (if (and (string-equal node (nth 1 (car hl)))
!                                        (string-equal file (nth 0 (car hl))))
!                                   (setq res (car hl) hl nil)
!                                 (setq hl (cdr hl))))
                                res))) 'info-xref-visited 'info-xref)))
              (when (and not-fontified-p (memq Info-hide-note-references '(t 
hide)))
                (put-text-property (match-beginning 2) (1- (match-end 6))




reply via email to

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