diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi index d2799a78e09..4ee8e759570 100644 --- a/doc/emacs/abbrevs.texi +++ b/doc/emacs/abbrevs.texi @@ -49,11 +49,13 @@ insert @samp{find outer otter.}. @cindex Abbrev mode @cindex mode, Abbrev Abbrevs expand only when Abbrev mode, a buffer-local minor mode, is -enabled. Disabling Abbrev mode does not cause abbrev definitions to -be forgotten, but they do not expand until Abbrev mode is enabled -again. The command @kbd{M-x abbrev-mode} toggles Abbrev mode; with a -numeric argument, it turns Abbrev mode on if the argument is positive, -off otherwise. @xref{Minor Modes}. +enabled. Disabling Abbrev mode does not cause abbrev definitions to be +forgotten, but they do not expand until Abbrev mode is enabled again. +The command @kbd{M-x abbrev-mode} toggles Abbrev mode in the current +buffer; with a numeric argument, it turns Abbrev mode on if the argument +is positive, off otherwise (@pxref{Minor Modes}). To enable Abbrev mode +by default in all buffers, customize the variable @code{abbrev-mode} to +a non-@code{nil} value (@pxref{Easy Customization}). Abbrevs can have @dfn{mode-specific} definitions, active only in one major mode. Abbrevs can also have @dfn{global} definitions that are active in diff --git a/etc/NEWS b/etc/NEWS index 7f94998bc77..d10bc520388 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3102,6 +3102,13 @@ contains an encrypted file, is an empty buffer, is a hidden buffer, or is the "*scratch*" buffer. If it cannot locate any acceptable buffers, it will begrudgingly use the scratch buffer. +** Abbrev mode + ++++ +*** You can now enable Abbrev mode by default using Easy Customization. +Customize the variable 'abbrev-mode' to non-nil to enable Abbrev mode by +default in all buffers. + * New Modes and Packages in Emacs 31.1 diff --git a/lisp/cus-start.el b/lisp/cus-start.el index c4ab23bec61..19ac478e21a 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -173,6 +173,13 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of "24.1") (delete-auto-save-files auto-save boolean) (kill-buffer-delete-auto-save-files auto-save boolean "28.1") + (abbrev-mode abbrev boolean nil + ;; Not `custom-set-minor-mode' because it is a + ;; buffer-local minor mode. Customizing it to + ;; non-nil means enabling the mode in all + ;; buffers which don't locally disable it. + :initialize custom-initialize-default + :set custom-set-default) ;; callint.c (mark-even-if-inactive editing-basics boolean) ;; callproc.c diff --git a/src/buffer.c b/src/buffer.c index e44b6daf587..3ef95626600 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -5218,8 +5218,10 @@ Format with `format-mode-line' to produce a string value. */); doc: /* Local (mode-specific) abbrev table of current buffer. */); DEFVAR_PER_BUFFER ("abbrev-mode", &BVAR (current_buffer, abbrev_mode), Qnil, - doc: /* Non-nil if Abbrev mode is enabled. -Use the command `abbrev-mode' to change this variable. */); + doc: /* Non-nil if Abbrev mode is enabled. +Use the command `abbrev-mode' to change the value of this variable in +the current buffer. Customize this variable to non-nil to enable Abbrev +mode by default in all buffers. */); DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column), Qintegerp,