diff options
author | Case Duckworth | 2022-05-06 13:16:16 -0500 |
---|---|---|
committer | Case Duckworth | 2022-05-06 13:16:16 -0500 |
commit | 222a20c7c1cc93e8eb4efc71505ca1ce3313ed3c (patch) | |
tree | d8cb46a39eb62b50015d13debc8363bf905ff806 /lisp | |
parent | Remove echo messages from jabber (diff) | |
download | emacs-222a20c7c1cc93e8eb4efc71505ca1ce3313ed3c.tar.gz emacs-222a20c7c1cc93e8eb4efc71505ca1ce3313ed3c.zip |
Further modeline changes
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/+modeline.el | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/lisp/+modeline.el b/lisp/+modeline.el index e5b5bc6..df9d504 100644 --- a/lisp/+modeline.el +++ b/lisp/+modeline.el | |||
@@ -126,9 +126,18 @@ and appended with `truncate-string-ellipsis'." | |||
126 | (propertize ;; (+string-truncate (format-mode-line mode-name) 16) | 126 | (propertize ;; (+string-truncate (format-mode-line mode-name) 16) |
127 | (format-mode-line mode-name) | 127 | (format-mode-line mode-name) |
128 | 'face 'font-lock-keyword-face | 128 | 'face 'font-lock-keyword-face |
129 | 'keymap mode-line-major-mode-keymap | 129 | 'keymap (let ((map (make-sparse-keymap))) |
130 | 'help-echo (concat (format-mode-line mode-name) | 130 | (bindings--define-key map [mode-line down-mouse-1] |
131 | " mode\nmouse-1: show menu.") | 131 | `(menu-item "Menu Bar" ignore |
132 | :filter ,(lambda (_) (mouse-menu-major-mode-map)))) | ||
133 | (define-key map [mode-line mouse-2] 'describe-mode) | ||
134 | (bindings--define-key map [mode-line down-mouse-3] | ||
135 | `(menu-item "Minions" minions-minor-modes-menu)) | ||
136 | map) | ||
137 | 'help-echo (+concat (list (format-mode-line mode-name) " mode") | ||
138 | "mouse-1: show menu" | ||
139 | "mouse-2: describe mode" | ||
140 | "mouse-3: display minor modes") | ||
132 | 'mouse-face 'mode-line-highlight))) | 141 | 'mouse-face 'mode-line-highlight))) |
133 | 142 | ||
134 | (defcustom +modeline-modified-icon-alist '((ephemeral . "*") | 143 | (defcustom +modeline-modified-icon-alist '((ephemeral . "*") |
@@ -302,9 +311,10 @@ The order of elements matters: whichever one matches first is applied." | |||
302 | 311 | ||
303 | (defun +modeline-line-column (&optional spacer) ; adapted from `simple-modeline' | 312 | (defun +modeline-line-column (&optional spacer) ; adapted from `simple-modeline' |
304 | "Display the current cursor line and column depending on modes." | 313 | "Display the current cursor line and column depending on modes." |
305 | (funcall (+modeline-concat '(+modeline-line | 314 | (concat (or spacer +modeline-default-spacer) |
306 | +modeline-column) | 315 | (+modeline-line "") |
307 | "|"))) | 316 | "|" |
317 | (+modeline-column ""))) | ||
308 | 318 | ||
309 | (defcustom +modeline-position-function nil | 319 | (defcustom +modeline-position-function nil |
310 | "Function to use instead of `+modeline-position' in modeline." | 320 | "Function to use instead of `+modeline-position' in modeline." |
@@ -312,17 +322,16 @@ The order of elements matters: whichever one matches first is applied." | |||
312 | function) | 322 | function) |
313 | :local t) | 323 | :local t) |
314 | 324 | ||
315 | (defun +modeline-position (&optional _) | 325 | (defun +modeline-position (&optional spacer) |
316 | "Display the current cursor position. | 326 | "Display the current cursor position. |
317 | See `line-number-mode', `column-number-mode', and | 327 | See `line-number-mode', `column-number-mode', and |
318 | `file-percentage-mode'. If `+modeline-position-function' is set | 328 | `file-percentage-mode'. If `+modeline-position-function' is set |
319 | to a function in the current buffer, call that function instead." | 329 | to a function in the current buffer, call that function instead." |
320 | (funcall (if +modeline-position-function | 330 | (concat (or spacer +modeline-default-spacer) |
321 | +modeline-position-function | 331 | (if +modeline-position-function |
322 | (+modeline-concat '(+modeline-region | 332 | (funcall +modeline-position-function) |
323 | +modeline-line-column | 333 | (concat (+modeline-region) |
324 | ;; +modeline-file-percentage | 334 | (+modeline-line-column))))) |
325 | ))))) | ||
326 | 335 | ||
327 | (defun +modeline-vc (&optional spacer) | 336 | (defun +modeline-vc (&optional spacer) |
328 | "Display the version control branch of the current buffer in the modeline." | 337 | "Display the version control branch of the current buffer in the modeline." |