diff options
| author | Sean Whitton | 2025-11-25 22:08:19 +0000 |
|---|---|---|
| committer | Sean Whitton | 2025-11-25 22:08:19 +0000 |
| commit | 47aec3cbc9a2e9dbf7760cab9dbf80ee18e07ba9 (patch) | |
| tree | ff28f1ec0c71535bf11a935213dd6c3a30253fa5 | |
| parent | 158bf5da779a30be4cde06929771715ef55e13c5 (diff) | |
| download | emacs-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.texi | 12 | ||||
| -rw-r--r-- | etc/NEWS | 7 | ||||
| -rw-r--r-- | lisp/cus-start.el | 7 | ||||
| -rw-r--r-- | src/buffer.c | 6 |
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 |
| 52 | enabled. Disabling Abbrev mode does not cause abbrev definitions to | 52 | enabled. Disabling Abbrev mode does not cause abbrev definitions to be |
| 53 | be forgotten, but they do not expand until Abbrev mode is enabled | 53 | forgotten, but they do not expand until Abbrev mode is enabled again. |
| 54 | again. The command @kbd{M-x abbrev-mode} toggles Abbrev mode; with a | 54 | The command @kbd{M-x abbrev-mode} toggles Abbrev mode in the current |
| 55 | numeric argument, it turns Abbrev mode on if the argument is positive, | 55 | buffer; with a numeric argument, it turns Abbrev mode on if the argument |
| 56 | off otherwise. @xref{Minor Modes}. | 56 | is positive, off otherwise (@pxref{Minor Modes}). To enable Abbrev mode |
| 57 | by default in all buffers, customize the variable @code{abbrev-mode} to | ||
| 58 | a 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 |
| 59 | mode. Abbrevs can also have @dfn{global} definitions that are active in | 61 | mode. Abbrevs can also have @dfn{global} definitions that are active in |
| @@ -3102,6 +3102,13 @@ contains an encrypted file, is an empty buffer, is a hidden buffer, or | |||
| 3102 | is the "*scratch*" buffer. If it cannot locate any acceptable buffers, | 3102 | is the "*scratch*" buffer. If it cannot locate any acceptable buffers, |
| 3103 | it will begrudgingly use the scratch buffer. | 3103 | it 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. | ||
| 3109 | Customize the variable 'abbrev-mode' to non-nil to enable Abbrev mode by | ||
| 3110 | default 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. |
| 5222 | Use the command `abbrev-mode' to change this variable. */); | 5222 | Use the command `abbrev-mode' to change the value of this variable in |
| 5223 | the current buffer. Customize this variable to non-nil to enable Abbrev | ||
| 5224 | mode 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, |