X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/0114082988eafdb8f7630dce0a1551c55c7b6c07..548667aad86a5e07e5ac96b832dcd10c5e6eb4c6:/lisp/info.el diff --git a/lisp/info.el b/lisp/info.el index 84e8248e02..13c417ccdd 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1,7 +1,7 @@ ;;; info.el --- info package for Emacs ;; Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. +;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: help @@ -10,7 +10,7 @@ ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, @@ -706,8 +706,8 @@ otherwise, that defaults to `Top'." (Info-find-node-2 nil nodename)) ;; It's perhaps a bit nasty to kill the *info* buffer to force a re-read, -;; but at least it keeps this routine (which is only for the benefit of -;; makeinfo-buffer) out of the way of normal operations. +;; but at least it keeps this routine (which is for makeinfo-buffer and +;; Info-revert-buffer-function) out of the way of normal operations. ;; (defun Info-revert-find-node (filename nodename) "Go to an Info node FILENAME and NODENAME, re-reading disk contents. @@ -739,6 +739,11 @@ is preserved, if possible." (if new-history (setq Info-history (cons new-history Info-history)))))) +(defun Info-revert-buffer-function (ignore-auto noconfirm) + (when (or noconfirm (y-or-n-p "Revert info buffer? ")) + (Info-revert-find-node Info-current-file Info-current-node) + (message "Reverted %s" Info-current-file))) + (defun Info-find-in-tag-table-1 (marker regexp case-fold) "Find a node in a tag table. MARKER specifies the buffer and position to start searching at. @@ -3262,10 +3267,14 @@ If FORK is non-nil, it i spassed to `Info-goto-node'." (defvar info-tool-bar-map (if (display-graphic-p) (let ((map (make-sparse-keymap))) - (tool-bar-local-item-from-menu 'Info-history-back "left-arrow" map Info-mode-map) - (tool-bar-local-item-from-menu 'Info-history-forward "right-arrow" map Info-mode-map) - (tool-bar-local-item-from-menu 'Info-prev "prev-node" map Info-mode-map) - (tool-bar-local-item-from-menu 'Info-next "next-node" map Info-mode-map) + (tool-bar-local-item-from-menu 'Info-history-back "left-arrow" map Info-mode-map + :rtl "right-arrow") + (tool-bar-local-item-from-menu 'Info-history-forward "right-arrow" map Info-mode-map + :rtl "left-arrow") + (tool-bar-local-item-from-menu 'Info-prev "prev-node" map Info-mode-map + :rtl "next-node") + (tool-bar-local-item-from-menu 'Info-next "next-node" map Info-mode-map + :rtl "prev-node") (tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map) (tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map) (tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map) @@ -3349,7 +3358,7 @@ With a zero prefix arg, put the name inside a function call to `info'." (unless Info-current-node (error "No current Info node")) (let ((node (if (stringp Info-current-file) - (concat "(" (file-name-nondirectory Info-current-file) ")" + (concat "(" (file-name-nondirectory Info-current-file) ") " Info-current-node)))) (if (zerop (prefix-numeric-value arg)) (setq node (concat "(info \"" node "\")"))) @@ -3463,7 +3472,7 @@ Advanced commands: (setq widen-automatically nil) (setq desktop-save-buffer 'Info-desktop-buffer-misc-data) (add-hook 'kill-buffer-hook 'Info-kill-buffer nil t) - (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t) + (add-hook 'clone-buffer-hook 'Info-clone-buffer 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) @@ -3474,6 +3483,8 @@ Advanced commands: 'Info-isearch-push-state) (set (make-local-variable 'search-whitespace-regexp) Info-search-whitespace-regexp) + (set (make-local-variable 'revert-buffer-function) + 'Info-revert-buffer-function) (Info-set-mode-line) (run-mode-hooks 'Info-mode-hook)) @@ -3484,7 +3495,8 @@ Advanced commands: Info-tag-table-buffer (kill-buffer Info-tag-table-buffer))) -(defun Info-clone-buffer-hook () +;; Placed on `clone-buffer-hook'. +(defun Info-clone-buffer () (when (bufferp Info-tag-table-buffer) (setq Info-tag-table-buffer (with-current-buffer Info-tag-table-buffer (clone-buffer))))