diff options
| author | Jonas Bernoulli | 2025-04-15 00:57:37 +0200 |
|---|---|---|
| committer | Jonas Bernoulli | 2025-04-26 10:22:00 +0200 |
| commit | 7bb648eb804c6420cd0f76cd8075a0faa30a4bfd (patch) | |
| tree | 9d7bef56101b5b5663592f39d20bfd7a9966a40c | |
| parent | a4bff5755120aebe6c240271b93e0f0cd8972c2a (diff) | |
| download | emacs-7bb648eb804c6420cd0f76cd8075a0faa30a4bfd.tar.gz emacs-7bb648eb804c6420cd0f76cd8075a0faa30a4bfd.zip | |
mode-line-modes-delimiters: New option
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/bindings.el | 13 |
2 files changed, 16 insertions, 2 deletions
| @@ -336,6 +336,11 @@ single button. The value could also be a list to specify minor mode | |||
| 336 | lighters to hide or show. The default value is nil, which retains the | 336 | lighters to hide or show. The default value is nil, which retains the |
| 337 | previous behavior of showing all minor mode lighters. | 337 | previous behavior of showing all minor mode lighters. |
| 338 | 338 | ||
| 339 | *** New user option 'mode-line-modes-delimiters'. | ||
| 340 | This option allows changing or removing the delimiters shown around | ||
| 341 | the major mode and list of minor modes in the mode line. The default | ||
| 342 | retains the existing behavior of inserting parentheses. | ||
| 343 | |||
| 339 | ** Tab Bars and Tab Lines | 344 | ** Tab Bars and Tab Lines |
| 340 | 345 | ||
| 341 | --- | 346 | --- |
diff --git a/lisp/bindings.el b/lisp/bindings.el index 2d6e1579e10..8fde7ad6d4b 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -445,6 +445,15 @@ lighters hidden." | |||
| 445 | :group 'mode-line | 445 | :group 'mode-line |
| 446 | :version "31.1") | 446 | :version "31.1") |
| 447 | 447 | ||
| 448 | (defcustom mode-line-modes-delimiters '("(" . ")") | ||
| 449 | "Strings placed around the modes displayed in the mode line. | ||
| 450 | These elements are placed around `mode-name' and `mode-line-modes'." | ||
| 451 | :type '(choice (const :tag "No delimiters") | ||
| 452 | (cons (string :tag "Left delimiter") | ||
| 453 | (string :tag "Right delimiter"))) | ||
| 454 | :group 'mode-line | ||
| 455 | :version "31.1") | ||
| 456 | |||
| 448 | (defvar mode-line-minor-modes '(:eval (mode-line--minor-modes)) | 457 | (defvar mode-line-minor-modes '(:eval (mode-line--minor-modes)) |
| 449 | "Mode line construct for minor mode lighters.") | 458 | "Mode line construct for minor mode lighters.") |
| 450 | ;;;###autoload | 459 | ;;;###autoload |
| @@ -577,7 +586,7 @@ Keymap to display on minor modes.") | |||
| 577 | (let ((recursive-edit-help-echo | 586 | (let ((recursive-edit-help-echo |
| 578 | "Recursive edit, type C-M-c to get out")) | 587 | "Recursive edit, type C-M-c to get out")) |
| 579 | (list (propertize "%[" 'help-echo recursive-edit-help-echo) | 588 | (list (propertize "%[" 'help-echo recursive-edit-help-echo) |
| 580 | "(" | 589 | '(:eval (car mode-line-modes-delimiters)) |
| 581 | `(:propertize ("" mode-name) | 590 | `(:propertize ("" mode-name) |
| 582 | help-echo "Major mode\n\ | 591 | help-echo "Major mode\n\ |
| 583 | mouse-1: Display major mode menu\n\ | 592 | mouse-1: Display major mode menu\n\ |
| @@ -591,7 +600,7 @@ mouse-3: Toggle minor modes" | |||
| 591 | 'local-map (make-mode-line-mouse-map | 600 | 'local-map (make-mode-line-mouse-map |
| 592 | 'mouse-2 #'mode-line-widen)) | 601 | 'mouse-2 #'mode-line-widen)) |
| 593 | '("" mode-line-minor-modes) | 602 | '("" mode-line-minor-modes) |
| 594 | ")" | 603 | '(:eval (cdr mode-line-modes-delimiters)) |
| 595 | (propertize "%]" 'help-echo recursive-edit-help-echo) | 604 | (propertize "%]" 'help-echo recursive-edit-help-echo) |
| 596 | " ")) | 605 | " ")) |
| 597 | "Mode line construct for displaying major and minor modes.") | 606 | "Mode line construct for displaying major and minor modes.") |