aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Whitton2025-11-25 22:08:19 +0000
committerSean Whitton2025-11-25 22:08:19 +0000
commit47aec3cbc9a2e9dbf7760cab9dbf80ee18e07ba9 (patch)
treeff28f1ec0c71535bf11a935213dd6c3a30253fa5
parent158bf5da779a30be4cde06929771715ef55e13c5 (diff)
downloademacs-47aec3cbc9a2e9dbf7760cab9dbf80ee18e07ba9.tar.gz
emacs-47aec3cbc9a2e9dbf7760cab9dbf80ee18e07ba9.zip
Make it easier to enable Abbrev mode by default
* lisp/cus-start.el: Make 'abbrev-mode' customizable. * doc/emacs/abbrevs.texi (Abbrev Concepts): * etc/NEWS: * src/buffer.c (syms_of_buffer): <abbrev-mode>: Document enabling Abbrev mode by default in all buffers by customizing 'abbrev-mode' to a non-nil value.
-rw-r--r--doc/emacs/abbrevs.texi12
-rw-r--r--etc/NEWS7
-rw-r--r--lisp/cus-start.el7
-rw-r--r--src/buffer.c6
4 files changed, 25 insertions, 7 deletions
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.}.
49@cindex Abbrev mode 49@cindex Abbrev mode
50@cindex mode, Abbrev 50@cindex mode, Abbrev
51 Abbrevs expand only when Abbrev mode, a buffer-local minor mode, is 51 Abbrevs expand only when Abbrev mode, a buffer-local minor mode, is
52enabled. Disabling Abbrev mode does not cause abbrev definitions to 52enabled. Disabling Abbrev mode does not cause abbrev definitions to be
53be forgotten, but they do not expand until Abbrev mode is enabled 53forgotten, but they do not expand until Abbrev mode is enabled again.
54again. The command @kbd{M-x abbrev-mode} toggles Abbrev mode; with a 54The command @kbd{M-x abbrev-mode} toggles Abbrev mode in the current
55numeric argument, it turns Abbrev mode on if the argument is positive, 55buffer; with a numeric argument, it turns Abbrev mode on if the argument
56off otherwise. @xref{Minor Modes}. 56is positive, off otherwise (@pxref{Minor Modes}). To enable Abbrev mode
57by default in all buffers, customize the variable @code{abbrev-mode} to
58a non-@code{nil} value (@pxref{Easy Customization}).
57 59
58 Abbrevs can have @dfn{mode-specific} definitions, active only in one major 60 Abbrevs can have @dfn{mode-specific} definitions, active only in one major
59mode. Abbrevs can also have @dfn{global} definitions that are active in 61mode. 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
3102is the "*scratch*" buffer. If it cannot locate any acceptable buffers, 3102is the "*scratch*" buffer. If it cannot locate any acceptable buffers,
3103it will begrudgingly use the scratch buffer. 3103it will begrudgingly use the scratch buffer.
3104 3104
3105** Abbrev mode
3106
3107+++
3108*** You can now enable Abbrev mode by default using Easy Customization.
3109Customize the variable 'abbrev-mode' to non-nil to enable Abbrev mode by
3110default in all buffers.
3111
3105 3112
3106* New Modes and Packages in Emacs 31.1 3113* New Modes and Packages in Emacs 31.1
3107 3114
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
173 "24.1") 173 "24.1")
174 (delete-auto-save-files auto-save boolean) 174 (delete-auto-save-files auto-save boolean)
175 (kill-buffer-delete-auto-save-files auto-save boolean "28.1") 175 (kill-buffer-delete-auto-save-files auto-save boolean "28.1")
176 (abbrev-mode abbrev boolean nil
177 ;; Not `custom-set-minor-mode' because it is a
178 ;; buffer-local minor mode. Customizing it to
179 ;; non-nil means enabling the mode in all
180 ;; buffers which don't locally disable it.
181 :initialize custom-initialize-default
182 :set custom-set-default)
176 ;; callint.c 183 ;; callint.c
177 (mark-even-if-inactive editing-basics boolean) 184 (mark-even-if-inactive editing-basics boolean)
178 ;; callproc.c 185 ;; 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. */);
5218 doc: /* Local (mode-specific) abbrev table of current buffer. */); 5218 doc: /* Local (mode-specific) abbrev table of current buffer. */);
5219 5219
5220 DEFVAR_PER_BUFFER ("abbrev-mode", &BVAR (current_buffer, abbrev_mode), Qnil, 5220 DEFVAR_PER_BUFFER ("abbrev-mode", &BVAR (current_buffer, abbrev_mode), Qnil,
5221 doc: /* Non-nil if Abbrev mode is enabled. 5221 doc: /* Non-nil if Abbrev mode is enabled.
5222Use the command `abbrev-mode' to change this variable. */); 5222Use the command `abbrev-mode' to change the value of this variable in
5223the current buffer. Customize this variable to non-nil to enable Abbrev
5224mode by default in all buffers. */);
5223 5225
5224 DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column), 5226 DEFVAR_PER_BUFFER ("fill-column", &BVAR (current_buffer, fill_column),
5225 Qintegerp, 5227 Qintegerp,