diff options
| author | Eli Zaretskii | 2022-05-25 13:57:59 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2022-05-25 13:57:59 -0400 |
| commit | 97bb31be9f4e06060f2d192b049c3cdb47aca2f5 (patch) | |
| tree | 1c7e537561f05e65f43689dc9603056f96962402 | |
| parent | 9661c82920cf2b75300266bbd9da9e45b9471173 (diff) | |
| parent | 86b49d58652a8f59a3489bf15b367ec224e17ae7 (diff) | |
| download | emacs-97bb31be9f4e06060f2d192b049c3cdb47aca2f5.tar.gz emacs-97bb31be9f4e06060f2d192b049c3cdb47aca2f5.zip | |
Merge from origin/emacs-28
86b49d5865 ; * etc/NEWS: Announce changes in 'desktop-kill'. (Bug#55...
d5ccf2621a ; Fix last change
f1c1fd7184 Improve documentation of mail-user-agent.
b05d1e9b98 ; * lisp/desktop.el: Update the commentary. (Bug#55560)
139bfa1a08 More fixes in abbrev.el doc strings
d80dea6036 Add note about Tramp completion to completion-styles doc s...
9e7c0cf57d Remove mention of removed nnimap-nov-is-evil variable
90aae0bca2 Improve documentation strings and prompts in abbrev.el
dfa3e6f424 Restore the Fselect_window call in gui_consider_frame_title.
de35e9728f Advise against settings in the MS-Windows system registry
3ffa3d3403 ; Minor addition to make-tarball.txt
7dc026f9ea Fix kmacro-keymap binding after previous change
4f0fd54bc4 Add glossary entries for "interactively"
af1c05a3c4 Fix the name of a kmacro command.
# Conflicts:
# etc/NEWS
# lisp/abbrev.el
| -rw-r--r-- | admin/make-tarball.txt | 3 | ||||
| -rw-r--r-- | doc/emacs/cmdargs.texi | 54 | ||||
| -rw-r--r-- | doc/emacs/glossary.texi | 16 | ||||
| -rw-r--r-- | doc/emacs/sending.texi | 6 | ||||
| -rw-r--r-- | doc/misc/gnus.texi | 7 | ||||
| -rw-r--r-- | lisp/abbrev.el | 247 | ||||
| -rw-r--r-- | lisp/desktop.el | 9 | ||||
| -rw-r--r-- | lisp/kmacro.el | 8 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 6 | ||||
| -rw-r--r-- | lisp/simple.el | 7 | ||||
| -rw-r--r-- | src/frame.c | 7 | ||||
| -rw-r--r-- | src/frame.h | 1 | ||||
| -rw-r--r-- | src/minibuf.c | 10 | ||||
| -rw-r--r-- | src/xdisp.c | 3 |
14 files changed, 221 insertions, 163 deletions
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index c8ee3349cdb..02b4f318e26 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt | |||
| @@ -334,6 +334,9 @@ looks like this: | |||
| 334 | </div> | 334 | </div> |
| 335 | </div> | 335 | </div> |
| 336 | 336 | ||
| 337 | Also, make sure the copyright years at the bottom of emacs.html are | ||
| 338 | up-to-date. | ||
| 339 | |||
| 337 | The file download.html may need to be updated, for example if the | 340 | The file download.html may need to be updated, for example if the |
| 338 | MS-Windows binaries will be signed by a different person/key than | 341 | MS-Windows binaries will be signed by a different person/key than |
| 339 | those mentioned there. | 342 | those mentioned there. |
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 946afb6fc14..0f7acd87978 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi | |||
| @@ -800,29 +800,45 @@ changing any environment or registry settings. | |||
| 800 | @pindex addpm, MS-Windows installation program | 800 | @pindex addpm, MS-Windows installation program |
| 801 | @cindex registry, setting environment variables (MS-Windows) | 801 | @cindex registry, setting environment variables (MS-Windows) |
| 802 | 802 | ||
| 803 | On MS-Windows, the installation program @command{addpm.exe} adds | 803 | On MS-Windows, the environment variables @env{emacs_dir}, |
| 804 | values for @env{emacs_dir}, @env{EMACSLOADPATH}, @env{EMACSDATA}, | 804 | @env{EMACSLOADPATH}, @env{EMACSDATA}, @env{EMACSPATH}, @env{EMACSDOC}, |
| 805 | @env{EMACSPATH}, @env{EMACSDOC}, @env{SHELL} and @env{TERM} to the | 805 | @env{SHELL}, @env{TERM}, @env{HOME}, @env{LANG}, and |
| 806 | @file{HKEY_LOCAL_MACHINE} section of the system registry, under | 806 | @env{PRELOAD_WINSOCK} can also be set in the @file{HKEY_CURRENT_USER} |
| 807 | @file{/Software/GNU/Emacs}. It does this because there is no standard | 807 | or the @file{HKEY_LOCAL_MACHINE} section of the system registry, under |
| 808 | place to set environment variables across different versions of | 808 | the @file{/Software/GNU/Emacs} key. When Emacs starts, as well as |
| 809 | Windows. Running @command{addpm.exe} is no longer strictly necessary | 809 | checking the environment, it also checks the system registry for those |
| 810 | in recent versions of Emacs, but if you are upgrading from an older | 810 | variables. |
| 811 | version, running @command{addpm.exe} ensures that you do not have | ||
| 812 | older registry entries from a previous installation, which may not be | ||
| 813 | compatible with the latest version of Emacs. | ||
| 814 | |||
| 815 | When Emacs starts, as well as checking the environment, it also checks | ||
| 816 | the System Registry for those variables and for @env{HOME}, @env{LANG} | ||
| 817 | and @env{PRELOAD_WINSOCK}. | ||
| 818 | 811 | ||
| 819 | To determine the value of those variables, Emacs goes through the | 812 | To determine the value of those variables, Emacs goes through the |
| 820 | following procedure. First, the environment is checked. If the | 813 | following procedure. First, it checks the environment. If the |
| 821 | variable is not found there, Emacs looks for registry keys by that | 814 | variable is not found there, Emacs looks for a registry key by the |
| 822 | name under @file{/Software/GNU/Emacs}; first in the | 815 | name of the variable under @file{/Software/GNU/Emacs}; first in the |
| 823 | @file{HKEY_CURRENT_USER} section of the registry, and if not found | 816 | @file{HKEY_CURRENT_USER} section of the registry, and if not found |
| 824 | there, in the @file{HKEY_LOCAL_MACHINE} section. Finally, if Emacs | 817 | there, in the @file{HKEY_LOCAL_MACHINE} section. Finally, if Emacs |
| 825 | still cannot determine the values, compiled-in defaults are used. | 818 | still cannot determine the values, it uses the compiled-in defaults. |
| 819 | |||
| 820 | Note that the registry settings have global system-wide effect: they | ||
| 821 | will affect all Emacs sessions run on the system. Thus, if you run | ||
| 822 | different Emacs versions, or use both installed and un-installed Emacs | ||
| 823 | executables, or build newer versions of Emacs, the settings in the | ||
| 824 | registry will cause all of them to use the same directories, which is | ||
| 825 | probably not what you want. For this reason, @emph{we recommend | ||
| 826 | against setting these variables in the registry}. If you have such | ||
| 827 | settings in the registry, we recommend that you remove them. | ||
| 828 | |||
| 829 | If you run the Emacs MS-Windows installation program | ||
| 830 | @command{addpm.exe}, it will update any existing registry settings of | ||
| 831 | the @env{emacs_dir}, @env{EMACSLOADPATH}, @env{EMACSDATA}, | ||
| 832 | @env{EMACSPATH}, @env{EMACSDOC}, @env{SHELL}, and @env{TERM} variables | ||
| 833 | to have the values suitable for the installed Emacs version with which | ||
| 834 | @command{addpm.exe} came. Note that @command{addpm.exe} will | ||
| 835 | @emph{not} create any registry setting that didn't exist, it will only | ||
| 836 | update existing settings, which are most probably inherited from an | ||
| 837 | old Emacs installation, so that they are compatible with the newly | ||
| 838 | installed Emacs version. Running @command{addpm.exe} is no longer | ||
| 839 | necessary when installing recent versions of Emacs, so we only | ||
| 840 | recommend doing that if you are upgrading from an older version, and | ||
| 841 | cannot remove these settings from the registry for some reason. | ||
| 826 | 842 | ||
| 827 | In addition to the environment variables above, you can also add | 843 | In addition to the environment variables above, you can also add |
| 828 | settings to the @file{/Software/GNU/Emacs} registry key to specify X | 844 | settings to the @file{/Software/GNU/Emacs} registry key to specify X |
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi index 7e0c84d7237..a78a2c9e2d7 100644 --- a/doc/emacs/glossary.texi +++ b/doc/emacs/glossary.texi | |||
| @@ -229,9 +229,11 @@ from a variety of coding systems when reading or writing it. | |||
| 229 | @item Command | 229 | @item Command |
| 230 | A command is a Lisp function specially defined to be able to serve as | 230 | A command is a Lisp function specially defined to be able to serve as |
| 231 | a key binding in Emacs or to be invoked by its name | 231 | a key binding in Emacs or to be invoked by its name |
| 232 | (@pxref{Glossary---Command Name}). When you type a key sequence | 232 | (@pxref{Glossary---Command Name}). (Another term for @dfn{command} is |
| 233 | (q.v.), its binding (q.v.@:) is looked up in the relevant keymaps | 233 | @dfn{interactive function}---they are used interchangeably.) When you |
| 234 | (q.v.@:) to find the command to run. @xref{Commands}. | 234 | type a key sequence (q.v.), its binding (q.v.@:) is looked up in the |
| 235 | relevant keymaps (q.v.@:) to find the command to run. | ||
| 236 | @xref{Commands}. | ||
| 235 | 237 | ||
| 236 | @item Command History | 238 | @item Command History |
| 237 | @xref{Glossary---Minibuffer History}. | 239 | @xref{Glossary---Minibuffer History}. |
| @@ -775,6 +777,14 @@ typing sequences of @acronym{ASCII} characters (q.v.). @xref{Input Methods}. | |||
| 775 | Insertion means adding text into the buffer, either from the keyboard | 777 | Insertion means adding text into the buffer, either from the keyboard |
| 776 | or from some other place in Emacs. | 778 | or from some other place in Emacs. |
| 777 | 779 | ||
| 780 | @item Interactive Function | ||
| 781 | A different term for @dfn{command} (q.v.). | ||
| 782 | |||
| 783 | @item Interactive Invocation | ||
| 784 | A function can be called from Lisp code, or called as a user level | ||
| 785 | command (via @kbd{M-x}, a key binding or a menu). In the latter case, | ||
| 786 | the function is said to be @dfn{called interactively}. | ||
| 787 | |||
| 778 | @item Interlocking | 788 | @item Interlocking |
| 779 | @xref{Glossary---File Locking}. | 789 | @xref{Glossary---File Locking}. |
| 780 | 790 | ||
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi index ea87e0a77b6..cc54224200a 100644 --- a/doc/emacs/sending.texi +++ b/doc/emacs/sending.texi | |||
| @@ -659,6 +659,7 @@ such as MIME support. Another available mode is MH-E | |||
| 659 | (@pxref{Top,,MH-E,mh-e, The Emacs Interface to MH}). | 659 | (@pxref{Top,,MH-E,mh-e, The Emacs Interface to MH}). |
| 660 | 660 | ||
| 661 | @vindex mail-user-agent | 661 | @vindex mail-user-agent |
| 662 | @findex define-mail-user-agent | ||
| 662 | You can choose any of these @dfn{mail user agents} as your preferred | 663 | You can choose any of these @dfn{mail user agents} as your preferred |
| 663 | method for editing and sending mail. The commands @kbd{C-x m}, | 664 | method for editing and sending mail. The commands @kbd{C-x m}, |
| 664 | @kbd{C-x 4 m} and @kbd{C-x 5 m} use whichever agent you have | 665 | @kbd{C-x 4 m} and @kbd{C-x 5 m} use whichever agent you have |
| @@ -667,7 +668,10 @@ the bug reporter (@pxref{Bugs}). To specify a mail user agent, | |||
| 667 | customize the variable @code{mail-user-agent}. Currently, legitimate | 668 | customize the variable @code{mail-user-agent}. Currently, legitimate |
| 668 | values include @code{message-user-agent} (Message mode) | 669 | values include @code{message-user-agent} (Message mode) |
| 669 | @code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and | 670 | @code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and |
| 670 | @code{mh-e-user-agent}. | 671 | @code{mh-e-user-agent}. Additional options may be available; check |
| 672 | in the manual of your mail user agent package for details. You may | ||
| 673 | also define another mail user agent using | ||
| 674 | @code{define-mail-user-agent}. | ||
| 671 | 675 | ||
| 672 | If you select a different mail-composition method, the information | 676 | If you select a different mail-composition method, the information |
| 673 | in this chapter about the mail buffer and Message mode does not apply; | 677 | in this chapter about the mail buffer and Message mode does not apply; |
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index e51ae7d424d..a0be13dac88 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi | |||
| @@ -29685,10 +29685,9 @@ Gnus not to use @acronym{NOV}. | |||
| 29685 | 29685 | ||
| 29686 | As the variables for the other back ends, there are | 29686 | As the variables for the other back ends, there are |
| 29687 | @code{nndiary-nov-is-evil}, @code{nndir-nov-is-evil}, | 29687 | @code{nndiary-nov-is-evil}, @code{nndir-nov-is-evil}, |
| 29688 | @code{nnfolder-nov-is-evil}, @code{nnimap-nov-is-evil}, | 29688 | @code{nnfolder-nov-is-evil}, @code{nnml-nov-is-evil}, and |
| 29689 | @code{nnml-nov-is-evil}, and @code{nnspool-nov-is-evil}. Note that a | 29689 | @code{nnspool-nov-is-evil}. Note that a non-@code{nil} value for |
| 29690 | non-@code{nil} value for @code{gnus-nov-is-evil} overrides all those | 29690 | @code{gnus-nov-is-evil} overrides all those variables. |
| 29691 | variables. | ||
| 29692 | @end table | 29691 | @end table |
| 29693 | 29692 | ||
| 29694 | 29693 | ||
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 3ee972869bc..e875d77faae 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -42,12 +42,12 @@ | |||
| 42 | 42 | ||
| 43 | (defcustom abbrev-file-name | 43 | (defcustom abbrev-file-name |
| 44 | (locate-user-emacs-file "abbrev_defs" ".abbrev_defs") | 44 | (locate-user-emacs-file "abbrev_defs" ".abbrev_defs") |
| 45 | "Default name of file from which to read abbrevs." | 45 | "Default name of file from which to read and where to save abbrevs." |
| 46 | :initialize 'custom-initialize-delay | 46 | :initialize 'custom-initialize-delay |
| 47 | :type 'file) | 47 | :type 'file) |
| 48 | 48 | ||
| 49 | (defcustom only-global-abbrevs nil | 49 | (defcustom only-global-abbrevs nil |
| 50 | "Non-nil means user plans to use global abbrevs only. | 50 | "Non-nil means user plans to use only global abbrevs. |
| 51 | This makes the commands that normally define mode-specific abbrevs | 51 | This makes the commands that normally define mode-specific abbrevs |
| 52 | define global abbrevs instead." | 52 | define global abbrevs instead." |
| 53 | :type 'boolean | 53 | :type 'boolean |
| @@ -59,7 +59,8 @@ define global abbrevs instead." | |||
| 59 | 59 | ||
| 60 | In Abbrev mode, inserting an abbreviation causes it to expand and | 60 | In Abbrev mode, inserting an abbreviation causes it to expand and |
| 61 | be replaced by its expansion." | 61 | be replaced by its expansion." |
| 62 | ;; It's defined in C, this stops the d-m-m macro defining it again. | 62 | ;; It's defined in C, this stops the 'define-minor-mode' macro from |
| 63 | ;; defining it again. | ||
| 63 | :variable abbrev-mode) | 64 | :variable abbrev-mode) |
| 64 | 65 | ||
| 65 | (put 'abbrev-mode 'safe-local-variable 'booleanp) | 66 | (put 'abbrev-mode 'safe-local-variable 'booleanp) |
| @@ -81,7 +82,8 @@ be replaced by its expansion." | |||
| 81 | 82 | ||
| 82 | (defun copy-abbrev-table (table) | 83 | (defun copy-abbrev-table (table) |
| 83 | "Make a new abbrev-table with the same abbrevs as TABLE. | 84 | "Make a new abbrev-table with the same abbrevs as TABLE. |
| 84 | Does not copy property lists." | 85 | This function does not copy property lists of the abbrevs. |
| 86 | See `define-abbrev' for the documentation of abbrev properties." | ||
| 85 | (let ((new-table (make-abbrev-table))) | 87 | (let ((new-table (make-abbrev-table))) |
| 86 | (obarray-map | 88 | (obarray-map |
| 87 | (lambda (symbol) | 89 | (lambda (symbol) |
| @@ -93,8 +95,8 @@ Does not copy property lists." | |||
| 93 | new-table)) | 95 | new-table)) |
| 94 | 96 | ||
| 95 | (defun insert-abbrevs () | 97 | (defun insert-abbrevs () |
| 96 | "Insert after point a description of all defined abbrevs. | 98 | "Insert the description of all defined abbrevs after point. |
| 97 | Mark is set after the inserted text." | 99 | Set mark after the inserted text." |
| 98 | (interactive) | 100 | (interactive) |
| 99 | (push-mark | 101 | (push-mark |
| 100 | (save-excursion | 102 | (save-excursion |
| @@ -103,15 +105,15 @@ Mark is set after the inserted text." | |||
| 103 | (point)))) | 105 | (point)))) |
| 104 | 106 | ||
| 105 | (defun list-abbrevs (&optional local) | 107 | (defun list-abbrevs (&optional local) |
| 106 | "Display a list of defined abbrevs. | 108 | "Display a list of the defined abbrevs. |
| 107 | If LOCAL is non-nil, interactively when invoked with a | 109 | If LOCAL is non-nil (interactively, when invoked with a |
| 108 | prefix arg, display only local, i.e. mode-specific, abbrevs. | 110 | prefix arg), display only local, i.e. mode-specific, abbrevs. |
| 109 | Otherwise display all abbrevs." | 111 | Otherwise display all the abbrevs." |
| 110 | (interactive "P") | 112 | (interactive "P") |
| 111 | (display-buffer (prepare-abbrev-list-buffer local))) | 113 | (display-buffer (prepare-abbrev-list-buffer local))) |
| 112 | 114 | ||
| 113 | (defun abbrev-table-name (table) | 115 | (defun abbrev-table-name (table) |
| 114 | "Value is the name of abbrev table TABLE." | 116 | "Return the name of the specified abbrev TABLE." |
| 115 | (let ((tables abbrev-table-name-list) | 117 | (let ((tables abbrev-table-name-list) |
| 116 | found) | 118 | found) |
| 117 | (while (and (not found) tables) | 119 | (while (and (not found) tables) |
| @@ -135,33 +137,33 @@ Otherwise display all abbrevs." | |||
| 135 | (dolist (table (nreverse empty-tables)) | 137 | (dolist (table (nreverse empty-tables)) |
| 136 | (insert-abbrev-table-description table t))) | 138 | (insert-abbrev-table-description table t))) |
| 137 | ;; Note: `list-abbrevs' can display only local abbrevs, in | 139 | ;; Note: `list-abbrevs' can display only local abbrevs, in |
| 138 | ;; which case editing could lose abbrevs of other tables. Thus | 140 | ;; which case editing could lose abbrevs of other tables. |
| 139 | ;; enter `edit-abbrevs-mode' only if LOCAL is nil. | 141 | ;; Thus enter `edit-abbrevs-mode' only if LOCAL is nil. |
| 140 | (edit-abbrevs-mode)) | 142 | (edit-abbrevs-mode)) |
| 141 | (goto-char (point-min)) | 143 | (goto-char (point-min)) |
| 142 | (set-buffer-modified-p nil) | 144 | (set-buffer-modified-p nil) |
| 143 | (current-buffer)))) | 145 | (current-buffer)))) |
| 144 | 146 | ||
| 145 | (defun edit-abbrevs () | 147 | (defun edit-abbrevs () |
| 146 | "Alter abbrev definitions by editing a list of them. | 148 | "Alter abbrev definitions by editing the list of abbrevs. |
| 147 | Selects a buffer containing a list of abbrev definitions with | 149 | This selects a buffer containing the list of abbrev definitions |
| 148 | point located in the abbrev table for the current buffer, and | 150 | with point located in the abbrev table for the current buffer, and |
| 149 | turns on `edit-abbrevs-mode' in that buffer. | 151 | turns on `edit-abbrevs-mode' in the buffer with the list of abbrevs. |
| 150 | 152 | ||
| 151 | You can edit them and type \\<edit-abbrevs-mode-map>\\[edit-abbrevs-redefine] \ | 153 | You can edit the abbrevs and type \\<edit-abbrevs-mode-map>\\[edit-abbrevs-redefine] \ |
| 152 | to redefine abbrevs | 154 | to redefine abbrevs |
| 153 | according to your editing. | 155 | according to your editing. |
| 154 | 156 | ||
| 155 | The abbrevs editing buffer contains a header line for each | 157 | The abbrevs editing buffer contains a header line for each |
| 156 | abbrev table, which is the abbrev table name in parentheses. | 158 | abbrev table, which is the abbrev table name in parentheses. |
| 157 | 159 | ||
| 158 | This is followed by one line per abbrev in that table: | 160 | The header line is followed by one line per abbrev in that table: |
| 159 | 161 | ||
| 160 | NAME USECOUNT EXPANSION HOOK | 162 | NAME USECOUNT EXPANSION HOOK |
| 161 | 163 | ||
| 162 | where NAME and EXPANSION are strings with quotes, | 164 | where NAME and EXPANSION are strings with quotes, |
| 163 | USECOUNT is an integer, and HOOK is any valid function | 165 | USECOUNT is an integer, and HOOK is any valid function |
| 164 | or may be omitted (it is usually omitted)." | 166 | that may be omitted (it is usually omitted)." |
| 165 | (interactive) | 167 | (interactive) |
| 166 | (let ((table-name (abbrev-table-name local-abbrev-table))) | 168 | (let ((table-name (abbrev-table-name local-abbrev-table))) |
| 167 | (switch-to-buffer (prepare-abbrev-list-buffer)) | 169 | (switch-to-buffer (prepare-abbrev-list-buffer)) |
| @@ -182,8 +184,9 @@ or may be omitted (it is usually omitted)." | |||
| 182 | "Define abbrevs according to current visible buffer contents. | 184 | "Define abbrevs according to current visible buffer contents. |
| 183 | See documentation of `edit-abbrevs' for info on the format of the | 185 | See documentation of `edit-abbrevs' for info on the format of the |
| 184 | text you must have in the buffer. | 186 | text you must have in the buffer. |
| 185 | With argument, eliminate all abbrev definitions except | 187 | If ARG is non-nil (interactively, when invoked with a prefix |
| 186 | the ones defined from the buffer now." | 188 | argument), eliminate all abbrev definitions except the ones |
| 189 | defined by the current buffer contents." | ||
| 187 | (interactive "P") | 190 | (interactive "P") |
| 188 | (if arg (kill-all-abbrevs)) | 191 | (if arg (kill-all-abbrevs)) |
| 189 | (save-excursion | 192 | (save-excursion |
| @@ -214,7 +217,8 @@ the ones defined from the buffer now." | |||
| 214 | "Read abbrev definitions from file written with `write-abbrev-file'. | 217 | "Read abbrev definitions from file written with `write-abbrev-file'. |
| 215 | Optional argument FILE is the name of the file to read; | 218 | Optional argument FILE is the name of the file to read; |
| 216 | it defaults to the value of `abbrev-file-name'. | 219 | it defaults to the value of `abbrev-file-name'. |
| 217 | Optional second argument QUIETLY non-nil means don't display a message." | 220 | Optional second argument QUIETLY non-nil means don't display a message |
| 221 | about loading the abbrevs." | ||
| 218 | (interactive | 222 | (interactive |
| 219 | (list | 223 | (list |
| 220 | (read-file-name (format-prompt "Read abbrev file" abbrev-file-name) | 224 | (read-file-name (format-prompt "Read abbrev file" abbrev-file-name) |
| @@ -223,22 +227,22 @@ Optional second argument QUIETLY non-nil means don't display a message." | |||
| 223 | (setq abbrevs-changed nil)) | 227 | (setq abbrevs-changed nil)) |
| 224 | 228 | ||
| 225 | (defun quietly-read-abbrev-file (&optional file) | 229 | (defun quietly-read-abbrev-file (&optional file) |
| 226 | "Read abbrev definitions from file written with `write-abbrev-file'. | 230 | "Quietly read abbrev definitions from file written with `write-abbrev-file'. |
| 227 | Optional argument FILE is the name of the file to read; | 231 | Optional argument FILE is the name of the file to read; |
| 228 | it defaults to the value of `abbrev-file-name'. | 232 | it defaults to the value of `abbrev-file-name'. |
| 229 | Does not display any message." | 233 | Do not display any messages about loading the abbrevs." |
| 230 | ;(interactive "fRead abbrev file: ") | 234 | ;(interactive "fRead abbrev file: ") |
| 231 | (read-abbrev-file file t)) | 235 | (read-abbrev-file file t)) |
| 232 | 236 | ||
| 233 | (defun write-abbrev-file (&optional file verbose) | 237 | (defun write-abbrev-file (&optional file verbose) |
| 234 | "Write all user-level abbrev definitions to a file of Lisp code. | 238 | "Write all user-level abbrev definitions to a file of Lisp code. |
| 235 | This does not include system abbrevs; it includes only the abbrev tables | 239 | This does not include system abbrevs; it includes only the abbrev tables |
| 236 | listed in listed in `abbrev-table-name-list'. | 240 | listed in `abbrev-table-name-list'. |
| 237 | The file written can be loaded in another session to define the same abbrevs. | 241 | The file written can be loaded in another session to define the same abbrevs. |
| 238 | The argument FILE is the file name to write. If omitted or nil, the file | 242 | The argument FILE is the file name to write. If omitted or nil, it defaults |
| 239 | specified in `abbrev-file-name' is used. | 243 | to the value of `abbrev-file-name'. |
| 240 | If VERBOSE is non-nil, display a message indicating where abbrevs | 244 | If VERBOSE is non-nil, display a message indicating the file where the |
| 241 | have been saved." | 245 | abbrevs have been saved." |
| 242 | (interactive | 246 | (interactive |
| 243 | (list | 247 | (list |
| 244 | (read-file-name "Write abbrev file: " | 248 | (read-file-name "Write abbrev file: " |
| @@ -251,10 +255,10 @@ have been saved." | |||
| 251 | (dolist (table | 255 | (dolist (table |
| 252 | ;; We sort the table in order to ease the automatic | 256 | ;; We sort the table in order to ease the automatic |
| 253 | ;; merging of different versions of the user's abbrevs | 257 | ;; merging of different versions of the user's abbrevs |
| 254 | ;; file. This is useful, for example, for when the | 258 | ;; file. This is useful, for example, when the |
| 255 | ;; user keeps their home directory in a revision | 259 | ;; user keeps their home directory in a revision |
| 256 | ;; control system, and is therefore keeping multiple | 260 | ;; control system, and therefore keeps multiple |
| 257 | ;; slightly-differing copies loosely synchronized. | 261 | ;; slightly-differing loosely synchronized copies. |
| 258 | (sort (copy-sequence abbrev-table-name-list) | 262 | (sort (copy-sequence abbrev-table-name-list) |
| 259 | (lambda (s1 s2) | 263 | (lambda (s1 s2) |
| 260 | (string< (symbol-name s1) | 264 | (string< (symbol-name s1) |
| @@ -268,7 +272,7 @@ have been saved." | |||
| 268 | (write-region nil nil file nil (and (not verbose) 0))))) | 272 | (write-region nil nil file nil (and (not verbose) 0))))) |
| 269 | 273 | ||
| 270 | (defun abbrev-edit-save-to-file (file) | 274 | (defun abbrev-edit-save-to-file (file) |
| 271 | "Save all user-level abbrev definitions in current buffer to FILE." | 275 | "Save to FILE all the user-level abbrev definitions in current buffer." |
| 272 | (interactive | 276 | (interactive |
| 273 | (list (read-file-name "Save abbrevs to file: " | 277 | (list (read-file-name "Save abbrevs to file: " |
| 274 | (file-name-directory | 278 | (file-name-directory |
| @@ -279,7 +283,7 @@ have been saved." | |||
| 279 | (write-abbrev-file file t)) | 283 | (write-abbrev-file file t)) |
| 280 | 284 | ||
| 281 | (defun abbrev-edit-save-buffer () | 285 | (defun abbrev-edit-save-buffer () |
| 282 | "Save all user-level abbrev definitions in current buffer. | 286 | "Save all the user-level abbrev definitions in current buffer. |
| 283 | The saved abbrevs are written to the file specified by | 287 | The saved abbrevs are written to the file specified by |
| 284 | `abbrev-file-name'." | 288 | `abbrev-file-name'." |
| 285 | (interactive nil edit-abbrevs-mode) | 289 | (interactive nil edit-abbrevs-mode) |
| @@ -287,15 +291,16 @@ The saved abbrevs are written to the file specified by | |||
| 287 | 291 | ||
| 288 | 292 | ||
| 289 | (defun add-mode-abbrev (arg) | 293 | (defun add-mode-abbrev (arg) |
| 290 | "Define mode-specific abbrev for last word(s) before point. | 294 | "Define a mode-specific abbrev whose expansion is the last word before point. |
| 291 | Argument is how many words before point form the expansion; | 295 | Prefix argument ARG says how many words before point to use for the expansion; |
| 292 | or zero means the region is the expansion. | 296 | zero means the entire region is the expansion. |
| 293 | A negative argument means to undefine the specified abbrev. | 297 | A negative ARG means to undefine the specified abbrev. |
| 294 | Reads the abbreviation in the minibuffer. | 298 | |
| 299 | This command reads the abbreviation from the minibuffer. | ||
| 295 | 300 | ||
| 296 | See also `inverse-add-mode-abbrev', which performs the opposite task: | 301 | See also `inverse-add-mode-abbrev', which performs the opposite task: |
| 297 | if the abbrev text is already in the buffer, use this command to | 302 | if the abbreviation is already in the buffer, use that command to define |
| 298 | define an abbrev by specifying the expansion in the minibuffer. | 303 | a mode-specific abbrev by specifying its expansion in the minibuffer. |
| 299 | 304 | ||
| 300 | Don't use this function in a Lisp program; use `define-abbrev' instead." | 305 | Don't use this function in a Lisp program; use `define-abbrev' instead." |
| 301 | (interactive "p") | 306 | (interactive "p") |
| @@ -307,15 +312,16 @@ Don't use this function in a Lisp program; use `define-abbrev' instead." | |||
| 307 | "Mode" arg)) | 312 | "Mode" arg)) |
| 308 | 313 | ||
| 309 | (defun add-global-abbrev (arg) | 314 | (defun add-global-abbrev (arg) |
| 310 | "Define global (all modes) abbrev for last word(s) before point. | 315 | "Define a global (all modes) abbrev whose expansion is last word before point. |
| 311 | The prefix argument specifies the number of words before point that form the | 316 | Prefix argument ARG says how many words before point to use for the expansion; |
| 312 | expansion; or zero means the region is the expansion. | 317 | zero means the entire region is the expansion. |
| 313 | A negative argument means to undefine the specified abbrev. | 318 | A negative ARG means to undefine the specified abbrev. |
| 314 | This command uses the minibuffer to read the abbreviation. | 319 | |
| 320 | This command reads the abbreviation from the minibuffer. | ||
| 315 | 321 | ||
| 316 | See also `inverse-add-global-abbrev', which performs the opposite task: | 322 | See also `inverse-add-global-abbrev', which performs the opposite task: |
| 317 | if the abbrev text is already in the buffer, use this command to | 323 | if the abbreviation is already in the buffer, use that command to define |
| 318 | define an abbrev by specifying the expansion in the minibuffer. | 324 | a global abbrev by specifying its expansion in the minibuffer. |
| 319 | 325 | ||
| 320 | Don't use this function in a Lisp program; use `define-abbrev' instead." | 326 | Don't use this function in a Lisp program; use `define-abbrev' instead." |
| 321 | (interactive "p") | 327 | (interactive "p") |
| @@ -329,25 +335,30 @@ Don't use this function in a Lisp program; use `define-abbrev' instead." | |||
| 329 | (save-excursion (forward-word (- arg)) (point)))))) | 335 | (save-excursion (forward-word (- arg)) (point)))))) |
| 330 | name) | 336 | name) |
| 331 | (setq name | 337 | (setq name |
| 332 | (read-string (format (if exp "%s abbrev for \"%s\": " | 338 | (read-string (format (if exp "%s abbrev that expands into \"%s\": " |
| 333 | "Undefine %s abbrev: ") | 339 | "Undefine %s abbrev: ") |
| 334 | type exp))) | 340 | type exp))) |
| 335 | (set-text-properties 0 (length name) nil name) | 341 | (set-text-properties 0 (length name) nil name) |
| 336 | (if (or (null exp) | 342 | (if (or (null exp) |
| 337 | (not (abbrev-expansion name table)) | 343 | (not (abbrev-expansion name table)) |
| 338 | (y-or-n-p (format "%s expands to \"%s\"; redefine? " | 344 | (y-or-n-p (format "%s expands into \"%s\"; redefine? " |
| 339 | name (abbrev-expansion name table)))) | 345 | name (abbrev-expansion name table)))) |
| 340 | (define-abbrev table (downcase name) exp)))) | 346 | (define-abbrev table (downcase name) exp)))) |
| 341 | 347 | ||
| 342 | (defun inverse-add-mode-abbrev (n) | 348 | (defun inverse-add-mode-abbrev (n) |
| 343 | "Define last word before point as a mode-specific abbrev. | 349 | "Define the word before point as a mode-specific abbreviation. |
| 344 | With prefix argument N, defines the Nth word before point. | 350 | With prefix argument N, define the Nth word before point as the |
| 345 | This command uses the minibuffer to read the expansion. | 351 | abbreviation. Negative N means use the Nth word after point. |
| 346 | Expands the abbreviation after defining it. | 352 | |
| 353 | If `only-global-abbrevs' is non-nil, this command defines a | ||
| 354 | global (mode-independent) abbrev instead of a mode-specific one. | ||
| 355 | |||
| 356 | This command reads the expansion from the minibuffer, defines the | ||
| 357 | abbrev, and then expands the abbreviation in the current buffer. | ||
| 347 | 358 | ||
| 348 | See also `add-mode-abbrev', which performs the opposite task: | 359 | See also `add-mode-abbrev', which performs the opposite task: |
| 349 | if the expansion is already in the buffer, use this command | 360 | if the expansion is already in the buffer, use that command |
| 350 | to define an abbrev by specifying the abbrev in the minibuffer." | 361 | to define an abbrev by specifying the abbreviation in the minibuffer." |
| 351 | (interactive "p") | 362 | (interactive "p") |
| 352 | (inverse-add-abbrev | 363 | (inverse-add-abbrev |
| 353 | (if only-global-abbrevs | 364 | (if only-global-abbrevs |
| @@ -357,14 +368,16 @@ to define an abbrev by specifying the abbrev in the minibuffer." | |||
| 357 | "Mode" n)) | 368 | "Mode" n)) |
| 358 | 369 | ||
| 359 | (defun inverse-add-global-abbrev (n) | 370 | (defun inverse-add-global-abbrev (n) |
| 360 | "Define last word before point as a global (mode-independent) abbrev. | 371 | "Define the word before point as a global (mode-independent) abbreviation. |
| 361 | With prefix argument N, defines the Nth word before point. | 372 | With prefix argument N, define the Nth word before point as the |
| 362 | This command uses the minibuffer to read the expansion. | 373 | abbreviation. Negative N means use the Nth word after point. |
| 363 | Expands the abbreviation after defining it. | 374 | |
| 375 | This command reads the expansion from the minibuffer, defines the | ||
| 376 | abbrev, and then expands the abbreviation in the current buffer. | ||
| 364 | 377 | ||
| 365 | See also `add-global-abbrev', which performs the opposite task: | 378 | See also `add-global-abbrev', which performs the opposite task: |
| 366 | if the expansion is already in the buffer, use this command | 379 | if the expansion is already in the buffer, use that command |
| 367 | to define an abbrev by specifying the abbrev in the minibuffer." | 380 | to define an abbrev by specifying the abbreviation in the minibuffer." |
| 368 | (interactive "p") | 381 | (interactive "p") |
| 369 | (inverse-add-abbrev global-abbrev-table "Global" n)) | 382 | (inverse-add-abbrev global-abbrev-table "Global" n)) |
| 370 | 383 | ||
| @@ -378,10 +391,10 @@ to define an abbrev by specifying the abbrev in the minibuffer." | |||
| 378 | (setq start (point) | 391 | (setq start (point) |
| 379 | name (buffer-substring-no-properties start end))) | 392 | name (buffer-substring-no-properties start end))) |
| 380 | 393 | ||
| 381 | (setq exp (read-string (format "%s expansion for \"%s\": " type name) | 394 | (setq exp (read-string (format "Expansion for %s abbrev \"%s\": " type name) |
| 382 | nil nil nil t)) | 395 | nil nil nil t)) |
| 383 | (when (or (not (abbrev-expansion name table)) | 396 | (when (or (not (abbrev-expansion name table)) |
| 384 | (y-or-n-p (format "%s expands to \"%s\"; redefine? " | 397 | (y-or-n-p (format "%s expands into \"%s\"; redefine? " |
| 385 | name (abbrev-expansion name table)))) | 398 | name (abbrev-expansion name table)))) |
| 386 | (define-abbrev table (downcase name) exp) | 399 | (define-abbrev table (downcase name) exp) |
| 387 | (save-excursion | 400 | (save-excursion |
| @@ -389,10 +402,11 @@ to define an abbrev by specifying the abbrev in the minibuffer." | |||
| 389 | (expand-abbrev))))) | 402 | (expand-abbrev))))) |
| 390 | 403 | ||
| 391 | (defun abbrev-prefix-mark (&optional arg) | 404 | (defun abbrev-prefix-mark (&optional arg) |
| 392 | "Mark current point as the beginning of an abbrev. | 405 | "Mark point as the beginning of an abbreviation. |
| 393 | The abbrev to be expanded starts here rather than at beginning of | 406 | The abbrev to be expanded starts at point rather than at the |
| 394 | word. This way, you can expand an abbrev with a prefix: insert | 407 | beginning of a word. This way, you can expand an abbrev with |
| 395 | the prefix, use this command, then insert the abbrev. | 408 | a prefix: insert the prefix, use this command, then insert the |
| 409 | abbrev. | ||
| 396 | 410 | ||
| 397 | This command inserts a hyphen after the prefix, and if the abbrev | 411 | This command inserts a hyphen after the prefix, and if the abbrev |
| 398 | is subsequently expanded, this hyphen will be removed. | 412 | is subsequently expanded, this hyphen will be removed. |
| @@ -407,8 +421,8 @@ argument." | |||
| 407 | (insert "-")) | 421 | (insert "-")) |
| 408 | 422 | ||
| 409 | (defun expand-region-abbrevs (start end &optional noquery) | 423 | (defun expand-region-abbrevs (start end &optional noquery) |
| 410 | "For abbrev occurrence in the region, offer to expand it. | 424 | "For each abbrev occurrence in the region, offer to expand it. |
| 411 | The user is asked to type \\`y' or \\`n' for each occurrence. | 425 | Ask the user to type `y' or `n' for each occurrence. |
| 412 | A prefix argument means don't query; expand all abbrevs." | 426 | A prefix argument means don't query; expand all abbrevs." |
| 413 | (interactive "r\nP") | 427 | (interactive "r\nP") |
| 414 | (save-excursion | 428 | (save-excursion |
| @@ -429,18 +443,19 @@ A prefix argument means don't query; expand all abbrevs." | |||
| 429 | ;;; Abbrev properties. | 443 | ;;; Abbrev properties. |
| 430 | 444 | ||
| 431 | (defun abbrev-table-get (table prop) | 445 | (defun abbrev-table-get (table prop) |
| 432 | "Get the PROP property of abbrev table TABLE." | 446 | "Get the property PROP of abbrev table TABLE." |
| 433 | (let ((sym (obarray-get table ""))) | 447 | (let ((sym (obarray-get table ""))) |
| 434 | (if sym (get sym prop)))) | 448 | (if sym (get sym prop)))) |
| 435 | 449 | ||
| 436 | (defun abbrev-table-put (table prop val) | 450 | (defun abbrev-table-put (table prop val) |
| 437 | "Set the PROP property of abbrev table TABLE to VAL." | 451 | "Set the property PROP of abbrev table TABLE to VAL." |
| 438 | (let ((sym (obarray-put table ""))) | 452 | (let ((sym (obarray-put table ""))) |
| 439 | (set sym nil) ; Make sure it won't be confused for an abbrev. | 453 | (set sym nil) ; Make sure it won't be confused for an abbrev. |
| 440 | (put sym prop val))) | 454 | (put sym prop val))) |
| 441 | 455 | ||
| 442 | (defalias 'abbrev-get 'get | 456 | (defalias 'abbrev-get 'get |
| 443 | "Get the property PROP of abbrev ABBREV | 457 | "Get the property PROP of abbrev ABBREV |
| 458 | See `define-abbrev' for the effect of some special properties. | ||
| 444 | 459 | ||
| 445 | \(fn ABBREV PROP)") | 460 | \(fn ABBREV PROP)") |
| 446 | 461 | ||
| @@ -500,7 +515,8 @@ for any particular abbrev defined in both.") | |||
| 500 | (defvar abbrev-minor-mode-table-alist nil | 515 | (defvar abbrev-minor-mode-table-alist nil |
| 501 | "Alist of abbrev tables to use for minor modes. | 516 | "Alist of abbrev tables to use for minor modes. |
| 502 | Each element looks like (VARIABLE . ABBREV-TABLE); | 517 | Each element looks like (VARIABLE . ABBREV-TABLE); |
| 503 | ABBREV-TABLE is active whenever VARIABLE's value is non-nil. | 518 | ABBREV-TABLE is active whenever VARIABLE's value is non-nil; |
| 519 | VARIABLE is supposed to be a minor-mode variable. | ||
| 504 | ABBREV-TABLE can also be a list of abbrev tables.") | 520 | ABBREV-TABLE can also be a list of abbrev tables.") |
| 505 | 521 | ||
| 506 | (defvar fundamental-mode-abbrev-table | 522 | (defvar fundamental-mode-abbrev-table |
| @@ -511,11 +527,11 @@ ABBREV-TABLE can also be a list of abbrev tables.") | |||
| 511 | "The abbrev table of mode-specific abbrevs for Fundamental Mode.") | 527 | "The abbrev table of mode-specific abbrevs for Fundamental Mode.") |
| 512 | 528 | ||
| 513 | (defvar abbrevs-changed nil | 529 | (defvar abbrevs-changed nil |
| 514 | "Set non-nil by defining or altering any word abbrevs. | 530 | "Non-nil if any word abbrevs were defined or altered. |
| 515 | This causes `save-some-buffers' to offer to save the abbrevs.") | 531 | This causes `save-some-buffers' to offer to save the abbrevs.") |
| 516 | 532 | ||
| 517 | (defcustom abbrev-all-caps nil | 533 | (defcustom abbrev-all-caps nil |
| 518 | "Non-nil means expand multi-word abbrevs all caps if abbrev was so." | 534 | "Non-nil means expand multi-word abbrevs in all caps if the abbrev was so." |
| 519 | :type 'boolean | 535 | :type 'boolean |
| 520 | :group 'abbrev-mode) | 536 | :group 'abbrev-mode) |
| 521 | 537 | ||
| @@ -532,17 +548,17 @@ Trying to expand an abbrev in any other buffer clears `abbrev-start-location'.") | |||
| 532 | "The abbrev-symbol of the last abbrev expanded. See `abbrev-symbol'.") | 548 | "The abbrev-symbol of the last abbrev expanded. See `abbrev-symbol'.") |
| 533 | 549 | ||
| 534 | (defvar last-abbrev-text nil | 550 | (defvar last-abbrev-text nil |
| 535 | "The exact text of the last abbrev expanded. | 551 | "The exact text of the last abbrev that was expanded. |
| 536 | It is nil if the abbrev has already been unexpanded.") | 552 | It is nil if the abbrev has already been unexpanded.") |
| 537 | 553 | ||
| 538 | (defvar last-abbrev-location 0 | 554 | (defvar last-abbrev-location 0 |
| 539 | "The location of the start of the last abbrev expanded.") | 555 | "The location of the start of the last abbrev that was expanded.") |
| 540 | 556 | ||
| 541 | ;; (defvar-local local-abbrev-table fundamental-mode-abbrev-table | 557 | ;; (defvar-local local-abbrev-table fundamental-mode-abbrev-table |
| 542 | ;; "Local (mode-specific) abbrev table of current buffer.") | 558 | ;; "Local (mode-specific) abbrev table of current buffer.") |
| 543 | 559 | ||
| 544 | (defun clear-abbrev-table (table) | 560 | (defun clear-abbrev-table (table) |
| 545 | "Undefine all abbrevs in abbrev table TABLE, leaving it empty." | 561 | "Undefine all abbrevs in abbrev table TABLE, leaving TABLE empty." |
| 546 | (setq abbrevs-changed t) | 562 | (setq abbrevs-changed t) |
| 547 | (let* ((sym (obarray-get table ""))) | 563 | (let* ((sym (obarray-get table ""))) |
| 548 | (dotimes (i (length table)) | 564 | (dotimes (i (length table)) |
| @@ -557,9 +573,9 @@ It is nil if the abbrev has already been unexpanded.") | |||
| 557 | ;; For backward compatibility, always return nil. | 573 | ;; For backward compatibility, always return nil. |
| 558 | nil) | 574 | nil) |
| 559 | 575 | ||
| 560 | (defun define-abbrev (table name expansion &optional hook &rest props) | 576 | (defun define-abbrev (table abbrev expansion &optional hook &rest props) |
| 561 | "Define an abbrev in TABLE named NAME, to expand to EXPANSION and call HOOK. | 577 | "Define ABBREV in TABLE, to expand into EXPANSION and optionally call HOOK. |
| 562 | NAME must be a string, and should be lower-case. | 578 | ABBREV must be a string, and should be lower-case. |
| 563 | EXPANSION should usually be a string. | 579 | EXPANSION should usually be a string. |
| 564 | To undefine an abbrev, define it with EXPANSION = nil. | 580 | To undefine an abbrev, define it with EXPANSION = nil. |
| 565 | If HOOK is non-nil, it should be a function of no arguments; | 581 | If HOOK is non-nil, it should be a function of no arguments; |
| @@ -583,8 +599,8 @@ PROPS is a property list. The following properties are special: | |||
| 583 | overwrite a non-system abbreviation of the same name. | 599 | overwrite a non-system abbreviation of the same name. |
| 584 | - `:case-fixed': non-nil means that abbreviations are looked up without | 600 | - `:case-fixed': non-nil means that abbreviations are looked up without |
| 585 | case-folding, and the expansion is not capitalized/upcased. | 601 | case-folding, and the expansion is not capitalized/upcased. |
| 586 | - `:enable-function': a function of no argument which returns non-nil if the | 602 | - `:enable-function': a function of no arguments which returns non-nil |
| 587 | abbrev should be used for a particular call of `expand-abbrev'. | 603 | if the abbrev should be used for a particular call of `expand-abbrev'. |
| 588 | 604 | ||
| 589 | An obsolete but still supported calling form is: | 605 | An obsolete but still supported calling form is: |
| 590 | 606 | ||
| @@ -599,7 +615,7 @@ An obsolete but still supported calling form is: | |||
| 599 | (setq props (plist-put props :abbrev-table-modiff | 615 | (setq props (plist-put props :abbrev-table-modiff |
| 600 | (abbrev-table-get table :abbrev-table-modiff))) | 616 | (abbrev-table-get table :abbrev-table-modiff))) |
| 601 | (let ((system-flag (plist-get props :system)) | 617 | (let ((system-flag (plist-get props :system)) |
| 602 | (sym (obarray-put table name))) | 618 | (sym (obarray-put table abbrev))) |
| 603 | ;; Don't override a prior user-defined abbrev with a system abbrev, | 619 | ;; Don't override a prior user-defined abbrev with a system abbrev, |
| 604 | ;; unless system-flag is `force'. | 620 | ;; unless system-flag is `force'. |
| 605 | (unless (and (not (memq system-flag '(nil force))) | 621 | (unless (and (not (memq system-flag '(nil force))) |
| @@ -619,7 +635,7 @@ An obsolete but still supported calling form is: | |||
| 619 | (if (eq 'force system-flag) (plist-put props :system t) props)) | 635 | (if (eq 'force system-flag) (plist-put props :system t) props)) |
| 620 | (abbrev-table-put table :abbrev-table-modiff | 636 | (abbrev-table-put table :abbrev-table-modiff |
| 621 | (1+ (abbrev-table-get table :abbrev-table-modiff)))) | 637 | (1+ (abbrev-table-get table :abbrev-table-modiff)))) |
| 622 | name)) | 638 | abbrev)) |
| 623 | 639 | ||
| 624 | (defun abbrev--check-chars (abbrev global) | 640 | (defun abbrev--check-chars (abbrev global) |
| 625 | "Check if the characters in ABBREV have word syntax in either the | 641 | "Check if the characters in ABBREV have word syntax in either the |
| @@ -639,7 +655,7 @@ current (if global is nil) or standard syntax table." | |||
| 639 | (if global "in the standard syntax" "in this mode")))))) | 655 | (if global "in the standard syntax" "in this mode")))))) |
| 640 | 656 | ||
| 641 | (defun define-global-abbrev (abbrev expansion) | 657 | (defun define-global-abbrev (abbrev expansion) |
| 642 | "Define ABBREV as a global abbreviation for EXPANSION. | 658 | "Define ABBREV as a global abbreviation that expands into EXPANSION. |
| 643 | The characters in ABBREV must all be word constituents in the standard | 659 | The characters in ABBREV must all be word constituents in the standard |
| 644 | syntax table." | 660 | syntax table." |
| 645 | (interactive "sDefine global abbrev: \nsExpansion for %s: ") | 661 | (interactive "sDefine global abbrev: \nsExpansion for %s: ") |
| @@ -647,7 +663,7 @@ syntax table." | |||
| 647 | (define-abbrev global-abbrev-table (downcase abbrev) expansion)) | 663 | (define-abbrev global-abbrev-table (downcase abbrev) expansion)) |
| 648 | 664 | ||
| 649 | (defun define-mode-abbrev (abbrev expansion) | 665 | (defun define-mode-abbrev (abbrev expansion) |
| 650 | "Define ABBREV as a mode-specific abbreviation for EXPANSION. | 666 | "Define ABBREV as a mode-specific abbreviation that expands into EXPANSION. |
| 651 | The characters in ABBREV must all be word-constituents in the current mode." | 667 | The characters in ABBREV must all be word-constituents in the current mode." |
| 652 | (interactive "sDefine mode abbrev: \nsExpansion for %s: ") | 668 | (interactive "sDefine mode abbrev: \nsExpansion for %s: ") |
| 653 | (unless local-abbrev-table | 669 | (unless local-abbrev-table |
| @@ -656,8 +672,8 @@ The characters in ABBREV must all be word-constituents in the current mode." | |||
| 656 | (define-abbrev local-abbrev-table (downcase abbrev) expansion)) | 672 | (define-abbrev local-abbrev-table (downcase abbrev) expansion)) |
| 657 | 673 | ||
| 658 | (defun abbrev--active-tables (&optional tables) | 674 | (defun abbrev--active-tables (&optional tables) |
| 659 | "Return the list of abbrev tables currently active. | 675 | "Return the list of abbrev tables that are currently active. |
| 660 | TABLES if non-nil overrides the usual rules. It can hold | 676 | TABLES, if non-nil, overrides the usual rules. It can hold |
| 661 | either a single abbrev table or a list of abbrev tables." | 677 | either a single abbrev table or a list of abbrev tables." |
| 662 | ;; We could just remove the `tables' arg and let callers use | 678 | ;; We could just remove the `tables' arg and let callers use |
| 663 | ;; (or table (abbrev--active-tables)) but then they'd have to be careful | 679 | ;; (or table (abbrev--active-tables)) but then they'd have to be careful |
| @@ -683,7 +699,7 @@ either a single abbrev table or a list of abbrev tables." | |||
| 683 | "Return the symbol representing abbrev named ABBREV in TABLE. | 699 | "Return the symbol representing abbrev named ABBREV in TABLE. |
| 684 | This symbol's name is ABBREV, but it is not the canonical symbol of that name; | 700 | This symbol's name is ABBREV, but it is not the canonical symbol of that name; |
| 685 | it is interned in the abbrev-table TABLE rather than the normal obarray. | 701 | it is interned in the abbrev-table TABLE rather than the normal obarray. |
| 686 | The value is nil if that abbrev is not defined." | 702 | The value is nil if such an abbrev is not defined." |
| 687 | (let* ((case-fold (not (abbrev-table-get table :case-fixed))) | 703 | (let* ((case-fold (not (abbrev-table-get table :case-fixed))) |
| 688 | ;; In case the table doesn't set :case-fixed but some of the | 704 | ;; In case the table doesn't set :case-fixed but some of the |
| 689 | ;; abbrevs do, we have to be careful. | 705 | ;; abbrevs do, we have to be careful. |
| @@ -700,11 +716,11 @@ The value is nil if that abbrev is not defined." | |||
| 700 | sym))) | 716 | sym))) |
| 701 | 717 | ||
| 702 | (defun abbrev-symbol (abbrev &optional table) | 718 | (defun abbrev-symbol (abbrev &optional table) |
| 703 | "Return the symbol representing abbrev named ABBREV. | 719 | "Return the symbol representing the abbrev named ABBREV in TABLE. |
| 704 | This symbol's name is ABBREV, but it is not the canonical symbol of that name; | 720 | This symbol's name is ABBREV, but it is not the canonical symbol of that name; |
| 705 | it is interned in an abbrev-table rather than the normal obarray. | 721 | it is interned in an abbrev-table rather than the normal obarray. |
| 706 | The value is nil if that abbrev is not defined. | 722 | The value is nil if such an abbrev is not defined. |
| 707 | Optional second arg TABLE is abbrev table to look it up in. | 723 | Optional second arg TABLE is the abbrev table to look it up in. |
| 708 | The default is to try buffer's mode-specific abbrev table, then global table." | 724 | The default is to try buffer's mode-specific abbrev table, then global table." |
| 709 | (let ((tables (abbrev--active-tables table)) | 725 | (let ((tables (abbrev--active-tables table)) |
| 710 | sym) | 726 | sym) |
| @@ -717,7 +733,7 @@ The default is to try buffer's mode-specific abbrev table, then global table." | |||
| 717 | 733 | ||
| 718 | (defun abbrev-expansion (abbrev &optional table) | 734 | (defun abbrev-expansion (abbrev &optional table) |
| 719 | "Return the string that ABBREV expands into in the current buffer. | 735 | "Return the string that ABBREV expands into in the current buffer. |
| 720 | Optionally specify an abbrev table as second arg; | 736 | Optionally specify an abbrev TABLE as second arg; |
| 721 | then ABBREV is looked up in that table only." | 737 | then ABBREV is looked up in that table only." |
| 722 | (symbol-value (abbrev-symbol abbrev table))) | 738 | (symbol-value (abbrev-symbol abbrev table))) |
| 723 | 739 | ||
| @@ -781,9 +797,9 @@ then ABBREV is looked up in that table only." | |||
| 781 | (defun abbrev-insert (abbrev &optional name wordstart wordend) | 797 | (defun abbrev-insert (abbrev &optional name wordstart wordend) |
| 782 | "Insert abbrev ABBREV at point. | 798 | "Insert abbrev ABBREV at point. |
| 783 | If non-nil, NAME is the name by which this abbrev was found. | 799 | If non-nil, NAME is the name by which this abbrev was found. |
| 784 | If non-nil, WORDSTART is the place where to insert the abbrev. | 800 | If non-nil, WORDSTART is the buffer position where to insert the abbrev. |
| 785 | If WORDEND is non-nil, the abbrev replaces the previous text between | 801 | If WORDEND is non-nil, it is a buffer position; the abbrev replaces the |
| 786 | WORDSTART and WORDEND. | 802 | previous text between WORDSTART and WORDEND. |
| 787 | Return ABBREV if the expansion should be considered as having taken place. | 803 | Return ABBREV if the expansion should be considered as having taken place. |
| 788 | The return value can be influenced by a `no-self-insert' property; | 804 | The return value can be influenced by a `no-self-insert' property; |
| 789 | see `define-abbrev' for details." | 805 | see `define-abbrev' for details." |
| @@ -848,7 +864,8 @@ see `define-abbrev' for details." | |||
| 848 | 864 | ||
| 849 | (defvar abbrev-expand-function #'abbrev--default-expand | 865 | (defvar abbrev-expand-function #'abbrev--default-expand |
| 850 | "Function that `expand-abbrev' uses to perform abbrev expansion. | 866 | "Function that `expand-abbrev' uses to perform abbrev expansion. |
| 851 | Takes no argument and should return the abbrev symbol if expansion took place.") | 867 | Takes no arguments, and should return the abbrev symbol if expansion |
| 868 | took place.") | ||
| 852 | 869 | ||
| 853 | (defcustom abbrev-suggest nil | 870 | (defcustom abbrev-suggest nil |
| 854 | "Non-nil means suggest using abbrevs to save typing. | 871 | "Non-nil means suggest using abbrevs to save typing. |
| @@ -907,15 +924,17 @@ Expansion is a string of one or more words." | |||
| 907 | 924 | ||
| 908 | (defun abbrev--suggest-above-threshold (expansion) | 925 | (defun abbrev--suggest-above-threshold (expansion) |
| 909 | "Return non-nil if the abbrev in EXPANSION provides significant savings. | 926 | "Return non-nil if the abbrev in EXPANSION provides significant savings. |
| 910 | A significant saving, here, is the difference in length between | 927 | A significant saving, here, means the difference in length between |
| 911 | the abbrev and the abbrev expansion. EXPANSION is a cons cell | 928 | the abbrev and its expansion is not below the threshold specified |
| 912 | where the car is the expansion and the cdr is the abbrev." | 929 | by the value of `abbrev-suggest-hint-threshold'. |
| 930 | EXPANSION is a cons cell where the car is the expansion and the cdr is | ||
| 931 | the abbrev." | ||
| 913 | (>= (- (length (car expansion)) | 932 | (>= (- (length (car expansion)) |
| 914 | (length (cdr expansion))) | 933 | (length (cdr expansion))) |
| 915 | abbrev-suggest-hint-threshold)) | 934 | abbrev-suggest-hint-threshold)) |
| 916 | 935 | ||
| 917 | (defvar abbrev--suggest-saved-recommendations nil | 936 | (defvar abbrev--suggest-saved-recommendations nil |
| 918 | "Keeps a list of expansions that have abbrevs defined. | 937 | "Keeps the list of expansions that have abbrevs defined. |
| 919 | The user can show this list by calling | 938 | The user can show this list by calling |
| 920 | `abbrev-suggest-show-report'.") | 939 | `abbrev-suggest-show-report'.") |
| 921 | 940 | ||
| @@ -931,7 +950,7 @@ EXPANSION is a cons cell where the `car' is the expansion and the | |||
| 931 | (push expansion abbrev--suggest-saved-recommendations)) | 950 | (push expansion abbrev--suggest-saved-recommendations)) |
| 932 | 951 | ||
| 933 | (defun abbrev--suggest-shortest-abbrev (new current) | 952 | (defun abbrev--suggest-shortest-abbrev (new current) |
| 934 | "Return the shortest abbrev of NEW and CURRENT. | 953 | "Return the shortest of the two abbrevs given by NEW and CURRENT. |
| 935 | NEW and CURRENT are cons cells where the `car' is the expansion | 954 | NEW and CURRENT are cons cells where the `car' is the expansion |
| 936 | and the `cdr' is the abbrev." | 955 | and the `cdr' is the abbrev." |
| 937 | (if (not current) | 956 | (if (not current) |
| @@ -960,8 +979,8 @@ informed about the existing abbrev." | |||
| 960 | 979 | ||
| 961 | (defun abbrev--suggest-get-totals () | 980 | (defun abbrev--suggest-get-totals () |
| 962 | "Return a list of all expansions and how many times they were used. | 981 | "Return a list of all expansions and how many times they were used. |
| 963 | Each expansion is a cons cell where the `car' is the expansion | 982 | Each expansion in the returned list is a cons cell where the `car' is the |
| 964 | and the `cdr' is the number of times the expansion has been | 983 | expansion text and the `cdr' is the number of times the expansion has been |
| 965 | typed." | 984 | typed." |
| 966 | (let (total cell) | 985 | (let (total cell) |
| 967 | (dolist (expansion abbrev--suggest-saved-recommendations) | 986 | (dolist (expansion abbrev--suggest-saved-recommendations) |
| @@ -1089,11 +1108,11 @@ Presumes that `standard-output' points to `current-buffer'." | |||
| 1089 | (defun insert-abbrev-table-description (name &optional readable) | 1108 | (defun insert-abbrev-table-description (name &optional readable) |
| 1090 | "Insert before point a full description of abbrev table named NAME. | 1109 | "Insert before point a full description of abbrev table named NAME. |
| 1091 | NAME is a symbol whose value is an abbrev table. | 1110 | NAME is a symbol whose value is an abbrev table. |
| 1092 | If optional 2nd arg READABLE is non-nil, a human-readable description | 1111 | If optional 2nd arg READABLE is non-nil, insert a human-readable |
| 1093 | is inserted. | 1112 | description. |
| 1094 | 1113 | ||
| 1095 | If READABLE is nil, an expression is inserted. The expression is | 1114 | If READABLE is nil, insert an expression. The expression is |
| 1096 | a call to `define-abbrev-table' that when evaluated will define | 1115 | a call to `define-abbrev-table' that, when evaluated, will define |
| 1097 | the abbrev table NAME exactly as it is currently defined. | 1116 | the abbrev table NAME exactly as it is currently defined. |
| 1098 | Abbrevs marked as \"system abbrevs\" are ignored." | 1117 | Abbrevs marked as \"system abbrevs\" are ignored." |
| 1099 | (let ((symbols (abbrev--table-symbols name readable))) | 1118 | (let ((symbols (abbrev--table-symbols name readable))) |
| @@ -1140,10 +1159,10 @@ Properties with special meaning: | |||
| 1140 | case-folding, and the expansion is not capitalized/upcased. | 1159 | case-folding, and the expansion is not capitalized/upcased. |
| 1141 | - `:regexp' is a regular expression that specifies how to extract the | 1160 | - `:regexp' is a regular expression that specifies how to extract the |
| 1142 | name of the abbrev before point. The submatch 1 is treated | 1161 | name of the abbrev before point. The submatch 1 is treated |
| 1143 | as the potential name of an abbrev. If :regexp is nil, the default | 1162 | as the potential name of an abbrev. If `:regexp' is nil, the default |
| 1144 | behavior uses `backward-word' and `forward-word' to extract the name | 1163 | behavior uses `backward-word' and `forward-word' to extract the name |
| 1145 | of the abbrev, which can therefore only be a single word. | 1164 | of the abbrev, which can therefore by default only be a single word. |
| 1146 | - `:enable-function' can be set to a function of no argument which returns | 1165 | - `:enable-function' can be set to a function of no arguments which returns |
| 1147 | non-nil if and only if the abbrevs in this table should be used for this | 1166 | non-nil if and only if the abbrevs in this table should be used for this |
| 1148 | instance of `expand-abbrev'." | 1167 | instance of `expand-abbrev'." |
| 1149 | (declare (doc-string 3) (indent defun)) | 1168 | (declare (doc-string 3) (indent defun)) |
| @@ -1172,7 +1191,7 @@ Properties with special meaning: | |||
| 1172 | 1191 | ||
| 1173 | (defun abbrev-table-menu (table &optional prompt sortfun) | 1192 | (defun abbrev-table-menu (table &optional prompt sortfun) |
| 1174 | "Return a menu that shows all abbrevs in TABLE. | 1193 | "Return a menu that shows all abbrevs in TABLE. |
| 1175 | Selecting an entry runs `abbrev-insert'. | 1194 | Selecting an entry runs `abbrev-insert' for that entry's abbrev. |
| 1176 | PROMPT is the prompt to use for the keymap. | 1195 | PROMPT is the prompt to use for the keymap. |
| 1177 | SORTFUN is passed to `sort' to change the default ordering." | 1196 | SORTFUN is passed to `sort' to change the default ordering." |
| 1178 | (unless sortfun (setq sortfun 'string-lessp)) | 1197 | (unless sortfun (setq sortfun 'string-lessp)) |
diff --git a/lisp/desktop.el b/lisp/desktop.el index 1a4103e2090..947f7cff5cb 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el | |||
| @@ -44,10 +44,11 @@ | |||
| 44 | ;; (info "(emacs)Saving Emacs Sessions") in the GNU Emacs Manual. | 44 | ;; (info "(emacs)Saving Emacs Sessions") in the GNU Emacs Manual. |
| 45 | 45 | ||
| 46 | ;; When the desktop module is loaded, the function `desktop-kill' is | 46 | ;; When the desktop module is loaded, the function `desktop-kill' is |
| 47 | ;; added to the `kill-emacs-hook'. This function is responsible for | 47 | ;; added to the `kill-emacs-query-functions'. This function is |
| 48 | ;; saving the desktop when Emacs is killed. Furthermore an anonymous | 48 | ;; responsible for saving the desktop and deleting the desktop lock |
| 49 | ;; function is added to the `after-init-hook'. This function is | 49 | ;; file when Emacs is killed. In addition, an anonymous function is |
| 50 | ;; responsible for loading the desktop when Emacs is started. | 50 | ;; added to the `after-init-hook'. This function is responsible for |
| 51 | ;; loading the desktop when Emacs is started. | ||
| 51 | 52 | ||
| 52 | ;; Special handling. | 53 | ;; Special handling. |
| 53 | ;; ----------------- | 54 | ;; ----------------- |
diff --git a/lisp/kmacro.el b/lisp/kmacro.el index 3f1f12fad6f..5746b770a2e 100644 --- a/lisp/kmacro.el +++ b/lisp/kmacro.el | |||
| @@ -172,7 +172,7 @@ macro to be executed before appending to it." | |||
| 172 | (define-key map "\C-k" #'kmacro-end-or-call-macro-repeat) | 172 | (define-key map "\C-k" #'kmacro-end-or-call-macro-repeat) |
| 173 | (define-key map "r" #'apply-macro-to-region-lines) | 173 | (define-key map "r" #'apply-macro-to-region-lines) |
| 174 | (define-key map "q" #'kbd-macro-query) ;; Like C-x q | 174 | (define-key map "q" #'kbd-macro-query) ;; Like C-x q |
| 175 | (define-key map "d" #'kdb-macro-redisplay) | 175 | (define-key map "d" #'kmacro-redisplay) |
| 176 | 176 | ||
| 177 | ;; macro ring | 177 | ;; macro ring |
| 178 | (define-key map "\C-n" #'kmacro-cycle-ring-next) | 178 | (define-key map "\C-n" #'kmacro-cycle-ring-next) |
| @@ -1374,12 +1374,12 @@ To customize possible responses, change the \"bindings\" in | |||
| 1374 | (kmacro-push-ring) | 1374 | (kmacro-push-ring) |
| 1375 | (setq last-kbd-macro kmacro-step-edit-new-macro)))) | 1375 | (setq last-kbd-macro kmacro-step-edit-new-macro)))) |
| 1376 | 1376 | ||
| 1377 | (defun kdb-macro-redisplay () | 1377 | (defun kmacro-redisplay () |
| 1378 | "Force redisplay during kbd macro execution." | 1378 | "Force redisplay during keyboard macro execution." |
| 1379 | (interactive) | 1379 | (interactive) |
| 1380 | (or executing-kbd-macro | 1380 | (or executing-kbd-macro |
| 1381 | defining-kbd-macro | 1381 | defining-kbd-macro |
| 1382 | (user-error "Not defining or executing kbd macro")) | 1382 | (user-error "Not defining or executing keyboard macro")) |
| 1383 | (when executing-kbd-macro | 1383 | (when executing-kbd-macro |
| 1384 | (let ((executing-kbd-macro nil)) | 1384 | (let ((executing-kbd-macro nil)) |
| 1385 | (redisplay)))) | 1385 | (redisplay)))) |
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 8287007d322..6694340e021 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -1001,7 +1001,11 @@ and DOC describes the way this style of completion works.") | |||
| 1001 | The available styles are listed in `completion-styles-alist'. | 1001 | The available styles are listed in `completion-styles-alist'. |
| 1002 | 1002 | ||
| 1003 | Note that `completion-category-overrides' may override these | 1003 | Note that `completion-category-overrides' may override these |
| 1004 | styles for specific categories, such as files, buffers, etc." | 1004 | styles for specific categories, such as files, buffers, etc. |
| 1005 | |||
| 1006 | Note that Tramp host name completion (e.g., \"/ssh:ho<TAB>\") | ||
| 1007 | currently doesn't work if this list doesn't contain at least one | ||
| 1008 | of `basic', `emacs22' or `emacs21'." | ||
| 1005 | :type completion--styles-type | 1009 | :type completion--styles-type |
| 1006 | :version "23.1") | 1010 | :version "23.1") |
| 1007 | 1011 | ||
diff --git a/lisp/simple.el b/lisp/simple.el index 4fd6ea009d2..420718869a4 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -9207,9 +9207,10 @@ Valid values include: | |||
| 9207 | paraphernalia if Gnus is running, particularly | 9207 | paraphernalia if Gnus is running, particularly |
| 9208 | the Gcc: header for archiving. | 9208 | the Gcc: header for archiving. |
| 9209 | 9209 | ||
| 9210 | Additional valid symbols may be available; check with the author of | 9210 | Additional valid symbols may be available; check in the manual of |
| 9211 | your package for details. The function should return non-nil if it | 9211 | your mail user agent package for details. You may also define |
| 9212 | succeeds. | 9212 | your own symbol to be used as value for this variable using |
| 9213 | `define-mail-user-agent'. | ||
| 9213 | 9214 | ||
| 9214 | See also `read-mail-command' concerning reading mail." | 9215 | See also `read-mail-command' concerning reading mail." |
| 9215 | :type '(radio (function-item :tag "Message package" | 9216 | :type '(radio (function-item :tag "Message package" |
diff --git a/src/frame.c b/src/frame.c index 795dcb3ca66..252dc591bfa 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -1572,6 +1572,13 @@ do_switch_frame (Lisp_Object frame, int track, int for_deletion, Lisp_Object nor | |||
| 1572 | if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) | 1572 | if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame))) |
| 1573 | last_nonminibuf_frame = XFRAME (selected_frame); | 1573 | last_nonminibuf_frame = XFRAME (selected_frame); |
| 1574 | 1574 | ||
| 1575 | /* If the selected window in the target frame is its mini-window, we move | ||
| 1576 | to a different window, the most recently used one, unless there is a | ||
| 1577 | valid active minibuffer in the mini-window. */ | ||
| 1578 | if (EQ (f->selected_window, f->minibuffer_window) | ||
| 1579 | && NILP (Fminibufferp (XWINDOW (f->minibuffer_window)->contents, Qt))) | ||
| 1580 | Fset_frame_selected_window (frame, call1 (Qget_mru_window, frame), Qnil); | ||
| 1581 | |||
| 1575 | Fselect_window (f->selected_window, norecord); | 1582 | Fselect_window (f->selected_window, norecord); |
| 1576 | 1583 | ||
| 1577 | /* We want to make sure that the next event generates a frame-switch | 1584 | /* We want to make sure that the next event generates a frame-switch |
diff --git a/src/frame.h b/src/frame.h index 4942e640d27..a164853e09d 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -127,6 +127,7 @@ struct frame | |||
| 127 | /* This frame's selected window. | 127 | /* This frame's selected window. |
| 128 | Each frame has its own window hierarchy | 128 | Each frame has its own window hierarchy |
| 129 | and one of the windows in it is selected within the frame. | 129 | and one of the windows in it is selected within the frame. |
| 130 | This window may be the mini-window of the frame, if any. | ||
| 130 | The selected window of the selected frame is Emacs's selected window. */ | 131 | The selected window of the selected frame is Emacs's selected window. */ |
| 131 | Lisp_Object selected_window; | 132 | Lisp_Object selected_window; |
| 132 | 133 | ||
diff --git a/src/minibuf.c b/src/minibuf.c index 3f06ce7e0e3..79985b8d2bb 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -201,20 +201,12 @@ move_minibuffers_onto_frame (struct frame *of, bool for_deletion) | |||
| 201 | return; | 201 | return; |
| 202 | if (FRAME_LIVE_P (f) | 202 | if (FRAME_LIVE_P (f) |
| 203 | && !EQ (f->minibuffer_window, of->minibuffer_window) | 203 | && !EQ (f->minibuffer_window, of->minibuffer_window) |
| 204 | && WINDOW_LIVE_P (f->minibuffer_window) /* F not a tootip frame */ | 204 | && WINDOW_LIVE_P (f->minibuffer_window) /* F not a tooltip frame */ |
| 205 | && WINDOW_LIVE_P (of->minibuffer_window)) | 205 | && WINDOW_LIVE_P (of->minibuffer_window)) |
| 206 | { | 206 | { |
| 207 | zip_minibuffer_stacks (f->minibuffer_window, of->minibuffer_window); | 207 | zip_minibuffer_stacks (f->minibuffer_window, of->minibuffer_window); |
| 208 | if (for_deletion && XFRAME (MB_frame) != of) | 208 | if (for_deletion && XFRAME (MB_frame) != of) |
| 209 | MB_frame = selected_frame; | 209 | MB_frame = selected_frame; |
| 210 | if (!for_deletion | ||
| 211 | && MINI_WINDOW_P (XWINDOW (FRAME_SELECTED_WINDOW (of)))) | ||
| 212 | { | ||
| 213 | Lisp_Object old_frame; | ||
| 214 | XSETFRAME (old_frame, of); | ||
| 215 | Fset_frame_selected_window (old_frame, | ||
| 216 | Fframe_first_window (old_frame), Qnil); | ||
| 217 | } | ||
| 218 | } | 210 | } |
| 219 | } | 211 | } |
| 220 | 212 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index bbe64340d15..07324815d90 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13200,8 +13200,9 @@ gui_consider_frame_title (Lisp_Object frame) | |||
| 13200 | mode_line_noprop_buf; then display the title. */ | 13200 | mode_line_noprop_buf; then display the title. */ |
| 13201 | record_unwind_protect (unwind_format_mode_line, | 13201 | record_unwind_protect (unwind_format_mode_line, |
| 13202 | format_mode_line_unwind_data | 13202 | format_mode_line_unwind_data |
| 13203 | (NULL, current_buffer, Qnil, false)); | 13203 | (f, current_buffer, selected_window, false)); |
| 13204 | 13204 | ||
| 13205 | Fselect_window (f->selected_window, Qt); | ||
| 13205 | set_buffer_internal_1 | 13206 | set_buffer_internal_1 |
| 13206 | (XBUFFER (XWINDOW (f->selected_window)->contents)); | 13207 | (XBUFFER (XWINDOW (f->selected_window)->contents)); |
| 13207 | fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; | 13208 | fmt = FRAME_ICONIFIED_P (f) ? Vicon_title_format : Vframe_title_format; |