summaryrefslogtreecommitdiff
path: root/lisp/info.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-08-21 13:36:59 -0700
committerLars Ingebrigtsen <larsi@gnus.org>2019-08-21 13:36:59 -0700
commit08dd4b9f0c0f2ccfcd17ae719b4a354919ddfeb5 (patch)
tree76edc7a03b4411064bbaadc59e4ad0bc03eef83e /lisp/info.el
parentb60bdfcd4cc4fdfa38894e8619ce4fec206b8303 (diff)
downloademacs-08dd4b9f0c0f2ccfcd17ae719b4a354919ddfeb5.tar.gz
Use `quit-window-hook' in Info instead of having its own command
* doc/misc/info.texi (Help-Q): Info now uses `quit-window'. * lisp/info.el (info-standalone): Adjust doc string. (Info-exit): Made into obsolete alias. (Info-mode-map): Bind "q" to `quit-window'. (Info-mode-menu): Adjust. (info-tool-bar-map): Ditto. (Info-mode): Adjust doc string. (Info-mode): If Info is standalone, kill Emacs on "q".
Diffstat (limited to 'lisp/info.el')
-rw-r--r--lisp/info.el19
1 files changed, 8 insertions, 11 deletions
diff --git a/lisp/info.el b/lisp/info.el
index 16909736f8d..17a2d63e6de 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -841,7 +841,7 @@ See a list of available Info commands in `Info-mode'."
(defun info-standalone ()
"Run Emacs as a standalone Info reader.
Usage: emacs -f info-standalone [filename]
-In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself."
+In standalone mode, \\<Info-mode-map>\\[quit-window] exits Emacs itself."
(setq Info-standalone t)
(if (and command-line-args-left
(not (string-match "^-" (car command-line-args-left))))
@@ -2948,12 +2948,7 @@ N is the digit argument used to invoke this command."
(t
(user-error "No pointer backward from this node")))))
-(defun Info-exit ()
- "Exit Info by selecting some other buffer."
- (interactive)
- (if Info-standalone
- (save-buffers-kill-emacs)
- (quit-window)))
+(define-obsolete-function-alias 'Info-exit #'quit-window "27.1")
(defun Info-next-menu-item ()
"Go to the node of the next menu item."
@@ -4045,7 +4040,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
(define-key map "m" 'Info-menu)
(define-key map "n" 'Info-next)
(define-key map "p" 'Info-prev)
- (define-key map "q" 'Info-exit)
+ (define-key map "q" 'quit-window)
(define-key map "r" 'Info-history-forward)
(define-key map "s" 'Info-search)
(define-key map "S" 'Info-search-case-sensitively)
@@ -4123,7 +4118,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
:help "Copy the name of the current node into the kill ring"]
["Clone Info buffer" clone-buffer
:help "Create a twin copy of the current Info buffer."]
- ["Exit" Info-exit :help "Stop reading Info"]))
+ ["Exit" quit-window :help "Stop reading Info"]))
(defvar info-tool-bar-map
@@ -4152,7 +4147,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
:label "Index")
(tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map
:vert-only t)
- (tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map
+ (tool-bar-local-item-from-menu 'quit-window "exit" map Info-mode-map
:vert-only t)
map))
@@ -4280,7 +4275,7 @@ topics. Info has commands to follow the references and show you other nodes.
\\<Info-mode-map>\
\\[Info-help] Invoke the Info tutorial.
-\\[Info-exit] Quit Info: reselect previously selected buffer.
+\\[quit-window] Quit Info: reselect previously selected buffer.
Selecting other nodes:
\\[Info-mouse-follow-nearest-node]
@@ -4353,6 +4348,8 @@ Advanced commands:
(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)
+ (when Info-standalone
+ (add-hook 'quit-window-hook 'save-buffers-kill-emacs nil t))
(setq-local isearch-search-fun-function #'Info-isearch-search)
(setq-local isearch-wrap-function #'Info-isearch-wrap)
(setq-local isearch-push-state-function #'Info-isearch-push-state)