diff options
| author | Lars Ingebrigtsen | 2021-07-23 14:40:53 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2021-07-23 14:40:53 +0200 |
| commit | bb68faed02d6c0eef48923b4ef4e4eda5e6486ba (patch) | |
| tree | f4addaa226c24b6321dcddbf733987cd13b3530d | |
| parent | f3806ee149c698e2a87258c5ecdea8bc8aa88664 (diff) | |
| download | emacs-bb68faed02d6c0eef48923b4ef4e4eda5e6486ba.tar.gz emacs-bb68faed02d6c0eef48923b4ef4e4eda5e6486ba.zip | |
'global-mode-string' elements should have a space at the end
* lisp/time.el (display-time-string-forms):
* lisp/battery.el (battery-mode-line-format): Add a space to the
end (bug#30056).
* lisp/bindings.el (mode-line-misc-info): Remove space from end.
This will make the default format have one space before the
line-of-dashes (instead of two) on terminals.
| -rw-r--r-- | doc/lispref/modes.texi | 11 | ||||
| -rw-r--r-- | etc/NEWS | 5 | ||||
| -rw-r--r-- | lisp/battery.el | 4 | ||||
| -rw-r--r-- | lisp/bindings.el | 2 | ||||
| -rw-r--r-- | lisp/time.el | 3 |
5 files changed, 17 insertions, 8 deletions
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 72149488506..b0dc0ff9166 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -2287,11 +2287,14 @@ enabled separately in each buffer. | |||
| 2287 | 2287 | ||
| 2288 | @defvar global-mode-string | 2288 | @defvar global-mode-string |
| 2289 | This variable holds a mode line construct that, by default, appears in | 2289 | This variable holds a mode line construct that, by default, appears in |
| 2290 | the mode line just after the @code{which-function-mode} minor mode if set, | 2290 | the mode line just after the @code{which-function-mode} minor mode if |
| 2291 | else after @code{mode-line-modes}. The command @code{display-time} sets | 2291 | set, else after @code{mode-line-modes}. Elements that are added to |
| 2292 | this construct should normally end in a space (to ensure that | ||
| 2293 | consecutive @code{global-mode-string} elements display properly). For | ||
| 2294 | instance, the command @code{display-time} sets | ||
| 2292 | @code{global-mode-string} to refer to the variable | 2295 | @code{global-mode-string} to refer to the variable |
| 2293 | @code{display-time-string}, which holds a string containing the time and | 2296 | @code{display-time-string}, which holds a string containing the time |
| 2294 | load information. | 2297 | and load information. |
| 2295 | 2298 | ||
| 2296 | The @samp{%M} construct substitutes the value of | 2299 | The @samp{%M} construct substitutes the value of |
| 2297 | @code{global-mode-string}, but that is obsolete, since the variable is | 2300 | @code{global-mode-string}, but that is obsolete, since the variable is |
| @@ -2506,6 +2506,11 @@ If non-nil, repeating spaces are compressed into a single space. If | |||
| 2506 | current window width (in characters). | 2506 | current window width (in characters). |
| 2507 | 2507 | ||
| 2508 | +++ | 2508 | +++ |
| 2509 | *** 'global-mode-string' constructs should end with a space. | ||
| 2510 | This was previously not formalized, which led to combinations of modes | ||
| 2511 | displaying data "smushed together" on the mode line. | ||
| 2512 | |||
| 2513 | +++ | ||
| 2509 | *** New command 'submit-emacs-patch'. | 2514 | *** New command 'submit-emacs-patch'. |
| 2510 | This works like 'report-emacs-bug', but is more geared towards sending | 2515 | This works like 'report-emacs-bug', but is more geared towards sending |
| 2511 | patches to the Emacs issue tracker. | 2516 | patches to the Emacs issue tracker. |
diff --git a/lisp/battery.el b/lisp/battery.el index 59f6987ad16..bf864c2bd4a 100644 --- a/lisp/battery.el +++ b/lisp/battery.el | |||
| @@ -161,9 +161,9 @@ The full `format-spec' formatting syntax is supported." | |||
| 161 | 161 | ||
| 162 | (defcustom battery-mode-line-format | 162 | (defcustom battery-mode-line-format |
| 163 | (cond ((eq battery-status-function #'battery-linux-proc-acpi) | 163 | (cond ((eq battery-status-function #'battery-linux-proc-acpi) |
| 164 | "[%b%p%%,%d°C]") | 164 | "[%b%p%%,%d°C] ") |
| 165 | (battery-status-function | 165 | (battery-status-function |
| 166 | "[%b%p%%]")) | 166 | "[%b%p%%] ")) |
| 167 | "Control string formatting the string to display in the mode line. | 167 | "Control string formatting the string to display in the mode line. |
| 168 | Ordinary characters in the control string are printed as-is, while | 168 | Ordinary characters in the control string are printed as-is, while |
| 169 | conversion specifications introduced by a `%' character in the control | 169 | conversion specifications introduced by a `%' character in the control |
diff --git a/lisp/bindings.el b/lisp/bindings.el index 06ba5d06e72..4b194c0c015 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -580,7 +580,7 @@ Major modes that edit things other than ordinary files may change this | |||
| 580 | (put 'mode-line-buffer-identification 'risky-local-variable t) | 580 | (put 'mode-line-buffer-identification 'risky-local-variable t) |
| 581 | 581 | ||
| 582 | (defvar mode-line-misc-info | 582 | (defvar mode-line-misc-info |
| 583 | '((global-mode-string ("" global-mode-string " "))) | 583 | '((global-mode-string ("" global-mode-string))) |
| 584 | "Mode line construct for miscellaneous information. | 584 | "Mode line construct for miscellaneous information. |
| 585 | By default, this shows the information specified by `global-mode-string'.") | 585 | By default, this shows the information specified by `global-mode-string'.") |
| 586 | (put 'mode-line-misc-info 'risky-local-variable t) | 586 | (put 'mode-line-misc-info 'risky-local-variable t) |
diff --git a/lisp/time.el b/lisp/time.el index fd53f634c69..9f25f99a149 100644 --- a/lisp/time.el +++ b/lisp/time.el | |||
| @@ -205,7 +205,8 @@ depend on `display-time-day-and-date' and `display-time-24hr-format'." | |||
| 205 | 'mouse-face 'mode-line-highlight | 205 | 'mouse-face 'mode-line-highlight |
| 206 | 'local-map (make-mode-line-mouse-map 'mouse-2 | 206 | 'local-map (make-mode-line-mouse-map 'mouse-2 |
| 207 | read-mail-command))) | 207 | read-mail-command))) |
| 208 | "")) | 208 | "") |
| 209 | " ") | ||
| 209 | "List of expressions governing display of the time in the mode line. | 210 | "List of expressions governing display of the time in the mode line. |
| 210 | For most purposes, you can control the time format using `display-time-format' | 211 | For most purposes, you can control the time format using `display-time-format' |
| 211 | which is a more standard interface. | 212 | which is a more standard interface. |