diff options
| author | Lars Ingebrigtsen | 2019-08-21 13:36:59 -0700 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-08-21 13:36:59 -0700 |
| commit | 08dd4b9f0c0f2ccfcd17ae719b4a354919ddfeb5 (patch) | |
| tree | 76edc7a03b4411064bbaadc59e4ad0bc03eef83e | |
| parent | b60bdfcd4cc4fdfa38894e8619ce4fec206b8303 (diff) | |
| download | emacs-08dd4b9f0c0f2ccfcd17ae719b4a354919ddfeb5.tar.gz emacs-08dd4b9f0c0f2ccfcd17ae719b4a354919ddfeb5.zip | |
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".
| -rw-r--r-- | doc/misc/info.texi | 3 | ||||
| -rw-r--r-- | lisp/info.el | 19 |
2 files changed, 9 insertions, 13 deletions
diff --git a/doc/misc/info.texi b/doc/misc/info.texi index e69779a03ca..cbdeaff50ce 100644 --- a/doc/misc/info.texi +++ b/doc/misc/info.texi | |||
| @@ -929,10 +929,9 @@ is @code{Info-top-node}. | |||
| 929 | @section Quitting Info | 929 | @section Quitting Info |
| 930 | 930 | ||
| 931 | @kindex q @r{(Info mode)} | 931 | @kindex q @r{(Info mode)} |
| 932 | @findex Info-exit | ||
| 933 | @cindex quitting Info mode | 932 | @cindex quitting Info mode |
| 934 | To get out of Info, back to what you were doing before, type @kbd{q} | 933 | To get out of Info, back to what you were doing before, type @kbd{q} |
| 935 | for @dfn{Quit}. This runs @code{Info-exit} in Emacs. | 934 | for @dfn{Quit}. This runs @code{quit-window} in Emacs. |
| 936 | 935 | ||
| 937 | This is the end of the basic course on using Info. You have learned | 936 | This is the end of the basic course on using Info. You have learned |
| 938 | how to move in an Info document, and how to follow menus and cross | 937 | how to move in an Info document, and how to follow menus and cross |
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'." | |||
| 841 | (defun info-standalone () | 841 | (defun info-standalone () |
| 842 | "Run Emacs as a standalone Info reader. | 842 | "Run Emacs as a standalone Info reader. |
| 843 | Usage: emacs -f info-standalone [filename] | 843 | Usage: emacs -f info-standalone [filename] |
| 844 | In standalone mode, \\<Info-mode-map>\\[Info-exit] exits Emacs itself." | 844 | In standalone mode, \\<Info-mode-map>\\[quit-window] exits Emacs itself." |
| 845 | (setq Info-standalone t) | 845 | (setq Info-standalone t) |
| 846 | (if (and command-line-args-left | 846 | (if (and command-line-args-left |
| 847 | (not (string-match "^-" (car command-line-args-left)))) | 847 | (not (string-match "^-" (car command-line-args-left)))) |
| @@ -2948,12 +2948,7 @@ N is the digit argument used to invoke this command." | |||
| 2948 | (t | 2948 | (t |
| 2949 | (user-error "No pointer backward from this node"))))) | 2949 | (user-error "No pointer backward from this node"))))) |
| 2950 | 2950 | ||
| 2951 | (defun Info-exit () | 2951 | (define-obsolete-function-alias 'Info-exit #'quit-window "27.1") |
| 2952 | "Exit Info by selecting some other buffer." | ||
| 2953 | (interactive) | ||
| 2954 | (if Info-standalone | ||
| 2955 | (save-buffers-kill-emacs) | ||
| 2956 | (quit-window))) | ||
| 2957 | 2952 | ||
| 2958 | (defun Info-next-menu-item () | 2953 | (defun Info-next-menu-item () |
| 2959 | "Go to the node of the next menu item." | 2954 | "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'." | |||
| 4045 | (define-key map "m" 'Info-menu) | 4040 | (define-key map "m" 'Info-menu) |
| 4046 | (define-key map "n" 'Info-next) | 4041 | (define-key map "n" 'Info-next) |
| 4047 | (define-key map "p" 'Info-prev) | 4042 | (define-key map "p" 'Info-prev) |
| 4048 | (define-key map "q" 'Info-exit) | 4043 | (define-key map "q" 'quit-window) |
| 4049 | (define-key map "r" 'Info-history-forward) | 4044 | (define-key map "r" 'Info-history-forward) |
| 4050 | (define-key map "s" 'Info-search) | 4045 | (define-key map "s" 'Info-search) |
| 4051 | (define-key map "S" 'Info-search-case-sensitively) | 4046 | (define-key map "S" 'Info-search-case-sensitively) |
| @@ -4123,7 +4118,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." | |||
| 4123 | :help "Copy the name of the current node into the kill ring"] | 4118 | :help "Copy the name of the current node into the kill ring"] |
| 4124 | ["Clone Info buffer" clone-buffer | 4119 | ["Clone Info buffer" clone-buffer |
| 4125 | :help "Create a twin copy of the current Info buffer."] | 4120 | :help "Create a twin copy of the current Info buffer."] |
| 4126 | ["Exit" Info-exit :help "Stop reading Info"])) | 4121 | ["Exit" quit-window :help "Stop reading Info"])) |
| 4127 | 4122 | ||
| 4128 | 4123 | ||
| 4129 | (defvar info-tool-bar-map | 4124 | (defvar info-tool-bar-map |
| @@ -4152,7 +4147,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'." | |||
| 4152 | :label "Index") | 4147 | :label "Index") |
| 4153 | (tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map | 4148 | (tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map |
| 4154 | :vert-only t) | 4149 | :vert-only t) |
| 4155 | (tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map | 4150 | (tool-bar-local-item-from-menu 'quit-window "exit" map Info-mode-map |
| 4156 | :vert-only t) | 4151 | :vert-only t) |
| 4157 | map)) | 4152 | map)) |
| 4158 | 4153 | ||
| @@ -4280,7 +4275,7 @@ topics. Info has commands to follow the references and show you other nodes. | |||
| 4280 | 4275 | ||
| 4281 | \\<Info-mode-map>\ | 4276 | \\<Info-mode-map>\ |
| 4282 | \\[Info-help] Invoke the Info tutorial. | 4277 | \\[Info-help] Invoke the Info tutorial. |
| 4283 | \\[Info-exit] Quit Info: reselect previously selected buffer. | 4278 | \\[quit-window] Quit Info: reselect previously selected buffer. |
| 4284 | 4279 | ||
| 4285 | Selecting other nodes: | 4280 | Selecting other nodes: |
| 4286 | \\[Info-mouse-follow-nearest-node] | 4281 | \\[Info-mouse-follow-nearest-node] |
| @@ -4353,6 +4348,8 @@ Advanced commands: | |||
| 4353 | (add-hook 'clone-buffer-hook 'Info-clone-buffer nil t) | 4348 | (add-hook 'clone-buffer-hook 'Info-clone-buffer nil t) |
| 4354 | (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) | 4349 | (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) |
| 4355 | (add-hook 'isearch-mode-hook 'Info-isearch-start nil t) | 4350 | (add-hook 'isearch-mode-hook 'Info-isearch-start nil t) |
| 4351 | (when Info-standalone | ||
| 4352 | (add-hook 'quit-window-hook 'save-buffers-kill-emacs nil t)) | ||
| 4356 | (setq-local isearch-search-fun-function #'Info-isearch-search) | 4353 | (setq-local isearch-search-fun-function #'Info-isearch-search) |
| 4357 | (setq-local isearch-wrap-function #'Info-isearch-wrap) | 4354 | (setq-local isearch-wrap-function #'Info-isearch-wrap) |
| 4358 | (setq-local isearch-push-state-function #'Info-isearch-push-state) | 4355 | (setq-local isearch-push-state-function #'Info-isearch-push-state) |