Further mode line changes
This commit is contained in:
parent
a6085b58a2
commit
1492d153f0
|
@ -51,8 +51,8 @@ This function makes a lambda, so you can throw it straight into
|
||||||
(not (equal (car result-list) ""))))
|
(not (equal (car result-list) ""))))
|
||||||
(setq this-sep separator)
|
(setq this-sep separator)
|
||||||
(setq this-sep nil)))
|
(setq this-sep nil)))
|
||||||
(unless (seq-some #'null result-list)
|
;; (unless (seq-some #'null result-list)
|
||||||
(push +modeline-default-spacer result-list))
|
;; (push +modeline-default-spacer result-list))
|
||||||
(nreverse result-list)))))
|
(nreverse result-list)))))
|
||||||
|
|
||||||
(defun +modeline-spacer (&optional n spacer &rest strings)
|
(defun +modeline-spacer (&optional n spacer &rest strings)
|
||||||
|
@ -64,11 +64,12 @@ should form a mode-line construct when `concat'ed."
|
||||||
(declare (indent 2))
|
(declare (indent 2))
|
||||||
(let ((spacer (or spacer +modeline-default-spacer))
|
(let ((spacer (or spacer +modeline-default-spacer))
|
||||||
(n (or n 1))
|
(n (or n 1))
|
||||||
(strings (cond ((null strings) '(""))
|
(strings (cond((null strings) '(""))
|
||||||
((atom strings) (list strings))
|
((equal strings '("")) nil)
|
||||||
(t strings)))
|
((atom strings) (list strings))
|
||||||
|
(t strings)))
|
||||||
r)
|
r)
|
||||||
(dotimes (_ n) (push spacer r))
|
(when strings (dotimes (_ n) (push spacer r)))
|
||||||
(apply #'concat (apply #'concat r) strings)))
|
(apply #'concat (apply #'concat r) strings)))
|
||||||
|
|
||||||
;;; Modeline segments
|
;;; Modeline segments
|
||||||
|
@ -96,7 +97,7 @@ and appended with `truncate-string-ellipsis'."
|
||||||
(defun +modeline-buffer-name (&optional spacer) ; gonsie
|
(defun +modeline-buffer-name (&optional spacer) ; gonsie
|
||||||
"Display the buffer name."
|
"Display the buffer name."
|
||||||
(let ((bufname (string-trim (string-replace "%" "" (buffer-name)))))
|
(let ((bufname (string-trim (string-replace "%" "" (buffer-name)))))
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(if (and +modeline-buffer-position (fboundp +modeline-buffer-position))
|
(if (and +modeline-buffer-position (fboundp +modeline-buffer-position))
|
||||||
(funcall +modeline-buffer-position)
|
(funcall +modeline-buffer-position)
|
||||||
(propertize (cond
|
(propertize (cond
|
||||||
|
@ -123,7 +124,7 @@ and appended with `truncate-string-ellipsis'."
|
||||||
|
|
||||||
(defun +modeline-minions (&optional spacer)
|
(defun +modeline-minions (&optional spacer)
|
||||||
"Display a button for `minions-minor-modes-menu'."
|
"Display a button for `minions-minor-modes-menu'."
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(propertize
|
(propertize
|
||||||
+modeline-minions-icon
|
+modeline-minions-icon
|
||||||
'help-echo "Minor modes menu\nmouse-1: show menu."
|
'help-echo "Minor modes menu\nmouse-1: show menu."
|
||||||
|
@ -147,34 +148,34 @@ in the cdr will be applied to the major-mode in the mode line."
|
||||||
|
|
||||||
(defun +modeline-major-mode (&optional spacer)
|
(defun +modeline-major-mode (&optional spacer)
|
||||||
"Display the current `major-mode'."
|
"Display the current `major-mode'."
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
"("
|
"("
|
||||||
(propertize ;; (+string-truncate (format-mode-line mode-name) 16)
|
(propertize ;; (+string-truncate (format-mode-line mode-name) 16)
|
||||||
(format-mode-line mode-name)
|
(format-mode-line mode-name)
|
||||||
'face (if (actually-selected-window-p)
|
'face (if (actually-selected-window-p)
|
||||||
;; XXX: This is probably really inefficient. I need to
|
;; XXX: This is probably really inefficient. I need to
|
||||||
;; simply detect which mode it's in when I change major
|
;; simply detect which mode it's in when I change major
|
||||||
;; modes (`change-major-mode-hook') and change the face
|
;; modes (`change-major-mode-hook') and change the face
|
||||||
;; there, probably.
|
;; there, probably.
|
||||||
(catch :done (dolist (cel +modeline-major-mode-faces)
|
(catch :done (dolist (cel +modeline-major-mode-faces)
|
||||||
(when (derived-mode-p (car cel))
|
(when (derived-mode-p (car cel))
|
||||||
(throw :done (cdr cel))))
|
(throw :done (cdr cel))))
|
||||||
(alist-get t +modeline-major-mode-faces))
|
(alist-get t +modeline-major-mode-faces))
|
||||||
'mode-line-inactive)
|
'unspecified)
|
||||||
'keymap (let ((map (make-sparse-keymap)))
|
'keymap (let ((map (make-sparse-keymap)))
|
||||||
(bindings--define-key map [mode-line down-mouse-1]
|
(bindings--define-key map [mode-line down-mouse-1]
|
||||||
`(menu-item "Menu Bar" ignore
|
`(menu-item "Menu Bar" ignore
|
||||||
:filter ,(lambda (_) (mouse-menu-major-mode-map))))
|
:filter ,(lambda (_) (mouse-menu-major-mode-map))))
|
||||||
(define-key map [mode-line mouse-2] 'describe-mode)
|
(define-key map [mode-line mouse-2] 'describe-mode)
|
||||||
(bindings--define-key map [mode-line down-mouse-3]
|
(bindings--define-key map [mode-line down-mouse-3]
|
||||||
`(menu-item "Minions" minions-minor-modes-menu))
|
`(menu-item "Minions" minions-minor-modes-menu))
|
||||||
map)
|
map)
|
||||||
'help-echo (+concat (list (format-mode-line mode-name) " mode")
|
'help-echo (+concat (list (format-mode-line mode-name) " mode")
|
||||||
"mouse-1: show menu"
|
"mouse-1: show menu"
|
||||||
"mouse-2: describe mode"
|
"mouse-2: describe mode"
|
||||||
"mouse-3: display minor modes")
|
"mouse-3: display minor modes")
|
||||||
'mouse-face 'mode-line-highlight)
|
'mouse-face 'mode-line-highlight)
|
||||||
")"))
|
")"))
|
||||||
|
|
||||||
(defcustom +modeline-modified-icon-alist '((ephemeral . "*")
|
(defcustom +modeline-modified-icon-alist '((ephemeral . "*")
|
||||||
(readonly . "=")
|
(readonly . "=")
|
||||||
|
@ -216,48 +217,48 @@ The order of elements matters: whichever one matches first is applied."
|
||||||
('t t)
|
('t t)
|
||||||
(_ nil))
|
(_ nil))
|
||||||
(throw :icon cell))))))
|
(throw :icon cell))))))
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(propertize (or (cdr-safe icon) "")
|
(propertize (or (cdr-safe icon) "")
|
||||||
'help-echo (format "Buffer \"%s\" is %s."
|
'help-echo (format "Buffer \"%s\" is %s."
|
||||||
(buffer-name)
|
(buffer-name)
|
||||||
(pcase (car-safe icon)
|
(pcase (car-safe icon)
|
||||||
('t "unmodified")
|
('t "unmodified")
|
||||||
('nil "unknown")
|
('nil "unknown")
|
||||||
(_ (car-safe icon))))))))
|
(_ (car-safe icon))))))))
|
||||||
|
|
||||||
(defun +modeline-narrowed (&optional spacer)
|
(defun +modeline-narrowed (&optional spacer)
|
||||||
"Display an indication that the buffer is narrowed."
|
"Display an indication that the buffer is narrowed."
|
||||||
(when (buffer-narrowed-p)
|
(when (buffer-narrowed-p)
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(propertize "N"
|
(propertize "N"
|
||||||
'help-echo (format "%s\n%s"
|
'help-echo (format "%s\n%s"
|
||||||
"Buffer is narrowed."
|
"Buffer is narrowed."
|
||||||
"mouse-2: widen buffer.")
|
"mouse-2: widen buffer.")
|
||||||
'local-map (purecopy (simple-modeline-make-mouse-map
|
'local-map (purecopy (simple-modeline-make-mouse-map
|
||||||
'mouse-2 'mode-line-widen))
|
'mouse-2 'mode-line-widen))
|
||||||
'face 'font-lock-doc-face
|
'face 'font-lock-doc-face
|
||||||
'mouse-face 'mode-line-highlight))))
|
'mouse-face 'mode-line-highlight))))
|
||||||
|
|
||||||
(defun +modeline-reading-mode (&optional spacer)
|
(defun +modeline-reading-mode (&optional spacer)
|
||||||
"Display an indication that the buffer is in `reading-mode'."
|
"Display an indication that the buffer is in `reading-mode'."
|
||||||
(when reading-mode
|
(when reading-mode
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(propertize
|
(propertize
|
||||||
(concat "R" (when (bound-and-true-p +eww-readable-p) "w"))
|
(concat "R" (when (bound-and-true-p +eww-readable-p) "w"))
|
||||||
'help-echo (format "%s\n%s"
|
'help-echo (format "%s\n%s"
|
||||||
"Buffer is in reading-mode."
|
"Buffer is in reading-mode."
|
||||||
"mouse-2: disable reading-mode.")
|
"mouse-2: disable reading-mode.")
|
||||||
'local-map (purecopy
|
'local-map (purecopy
|
||||||
(simple-modeline-make-mouse-map
|
(simple-modeline-make-mouse-map
|
||||||
'mouse-2 (lambda (ev)
|
'mouse-2 (lambda (ev)
|
||||||
(interactive "e")
|
(interactive "e")
|
||||||
(with-selected-window
|
(with-selected-window
|
||||||
(posn-window
|
(posn-window
|
||||||
(event-start ev))
|
(event-start ev))
|
||||||
(reading-mode -1)
|
(reading-mode -1)
|
||||||
(force-mode-line-update)))))
|
(force-mode-line-update)))))
|
||||||
'face 'font-lock-doc-face
|
'face 'font-lock-doc-face
|
||||||
'mouse-face 'mode-line-highlight))))
|
'mouse-face 'mode-line-highlight))))
|
||||||
|
|
||||||
(define-minor-mode file-percentage-mode
|
(define-minor-mode file-percentage-mode
|
||||||
"Toggle the percentage display in the mode line (File Percentage Mode)."
|
"Toggle the percentage display in the mode line (File Percentage Mode)."
|
||||||
|
@ -279,7 +280,7 @@ The order of elements matters: whichever one matches first is applied."
|
||||||
"Display the position in the current file."
|
"Display the position in the current file."
|
||||||
(when file-percentage-mode
|
(when file-percentage-mode
|
||||||
;; (let ((perc (+modeline--percentage)))
|
;; (let ((perc (+modeline--percentage)))
|
||||||
;; (propertize (+modeline-spacer nil nil
|
;; (propertize (+modeline-spacer nil spacer
|
||||||
;; (cond
|
;; (cond
|
||||||
;; ((+modeline--buffer-contained-in-window-p) "All")
|
;; ((+modeline--buffer-contained-in-window-p) "All")
|
||||||
;; ((= (line-number-at-pos) (line-number-at-pos (point-min))) "Top")
|
;; ((= (line-number-at-pos) (line-number-at-pos (point-min))) "Top")
|
||||||
|
@ -293,25 +294,27 @@ The order of elements matters: whichever one matches first is applied."
|
||||||
;; ;; TODO: add scroll-up and scroll-down bindings.
|
;; ;; TODO: add scroll-up and scroll-down bindings.
|
||||||
;; ))
|
;; ))
|
||||||
(let ((perc (format-mode-line '(-3 "%p"))))
|
(let ((perc (format-mode-line '(-3 "%p"))))
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(pcase perc
|
(pcase perc
|
||||||
((or "Top" "Bot" "All") perc)
|
("Top" ".^^")
|
||||||
|
("Bot" ".__")
|
||||||
|
("All" ".::")
|
||||||
(_ (format ".%02d" (string-to-number (substring perc 0 2)))))))))
|
(_ (format ".%02d" (string-to-number (substring perc 0 2)))))))))
|
||||||
|
|
||||||
(defun +modeline-file-percentage-icon (&optional spacer)
|
(defun +modeline-file-percentage-icon (&optional spacer)
|
||||||
"Display the position in the current file as an icon."
|
"Display the position in the current file as an icon."
|
||||||
(when file-percentage-mode
|
(when file-percentage-mode
|
||||||
(let ((perc (+modeline--percentage)))
|
(let ((perc (+modeline--percentage)))
|
||||||
(propertize (+modeline-spacer nil nil
|
(propertize (+modeline-spacer nil spacer
|
||||||
(cond
|
(cond
|
||||||
((+modeline--buffer-contained-in-window-p) "⏹")
|
((+modeline--buffer-contained-in-window-p) "⏹")
|
||||||
((= perc 0) "▇")
|
((= perc 0) "▇")
|
||||||
((< perc 20) "▆")
|
((< perc 20) "▆")
|
||||||
((< perc 40) "▅")
|
((< perc 40) "▅")
|
||||||
((< perc 60) "▄")
|
((< perc 60) "▄")
|
||||||
((< perc 80) "▃")
|
((< perc 80) "▃")
|
||||||
((< perc 100) "▂")
|
((< perc 100) "▂")
|
||||||
((>= perc 100) "▁")))
|
((>= perc 100) "▁")))
|
||||||
'help-echo (format "Point is %d%% through the buffer."
|
'help-echo (format "Point is %d%% through the buffer."
|
||||||
perc)))))
|
perc)))))
|
||||||
|
|
||||||
|
@ -321,34 +324,32 @@ The order of elements matters: whichever one matches first is applied."
|
||||||
|
|
||||||
(defun +modeline-region (&optional spacer)
|
(defun +modeline-region (&optional spacer)
|
||||||
"Display an indicator if the region is active."
|
"Display an indicator if the region is active."
|
||||||
(if (and region-indicator-mode
|
(when (and region-indicator-mode
|
||||||
(region-active-p))
|
(region-active-p))
|
||||||
(format "%s%s"
|
(+modeline-spacer nil spacer
|
||||||
(or spacer +modeline-default-spacer)
|
(propertize (format "%s%d"
|
||||||
(propertize (format "%s%d"
|
(if (and (< (point) (mark))) "-" "+")
|
||||||
(if (and (< (point) (mark))) "-" "+")
|
(apply '+ (mapcar (lambda (pos)
|
||||||
(apply '+ (mapcar (lambda (pos)
|
(- (cdr pos)
|
||||||
(- (cdr pos)
|
(car pos)))
|
||||||
(car pos)))
|
(region-bounds))))
|
||||||
(region-bounds))))
|
'font-lock-face 'font-lock-variable-name-face))))
|
||||||
'font-lock-face 'font-lock-variable-name-face))
|
|
||||||
""))
|
|
||||||
|
|
||||||
(defun +modeline-line (&optional spacer)
|
(defun +modeline-line (&optional spacer)
|
||||||
(when line-number-mode
|
(when line-number-mode
|
||||||
(+modeline-spacer nil nil "%2l")))
|
(+modeline-spacer nil spacer "%2l")))
|
||||||
|
|
||||||
(defun +modeline-column (&optional spacer)
|
(defun +modeline-column (&optional spacer)
|
||||||
(when column-number-mode
|
(when column-number-mode
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(if column-number-indicator-zero-based "%2c" "%2C"))))
|
(if column-number-indicator-zero-based "%2c" "%2C"))))
|
||||||
|
|
||||||
(defun +modeline-line-column (&optional spacer) ; adapted from `simple-modeline'
|
(defun +modeline-line-column (&optional spacer) ; adapted from `simple-modeline'
|
||||||
"Display the current cursor line and column depending on modes."
|
"Display the current cursor line and column depending on modes."
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(+modeline-line "")
|
(+modeline-line "")
|
||||||
"|"
|
"|"
|
||||||
(+modeline-column "")))
|
(+modeline-column "")))
|
||||||
|
|
||||||
(defcustom +modeline-position-function nil
|
(defcustom +modeline-position-function nil
|
||||||
"Function to use instead of `+modeline-position' in modeline."
|
"Function to use instead of `+modeline-position' in modeline."
|
||||||
|
@ -361,18 +362,18 @@ The order of elements matters: whichever one matches first is applied."
|
||||||
See `line-number-mode', `column-number-mode', and
|
See `line-number-mode', `column-number-mode', and
|
||||||
`file-percentage-mode'. If `+modeline-position-function' is set
|
`file-percentage-mode'. If `+modeline-position-function' is set
|
||||||
to a function in the current buffer, call that function instead."
|
to a function in the current buffer, call that function instead."
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(cond ((functionp +modeline-position-function)
|
(cond ((functionp +modeline-position-function)
|
||||||
(funcall +modeline-position-function))
|
(funcall +modeline-position-function))
|
||||||
(t (concat (+modeline-region)
|
(t (concat (+modeline-region)
|
||||||
(+modeline-line-column))))))
|
(+modeline-line-column))))))
|
||||||
|
|
||||||
(defun +modeline-vc (&optional spacer)
|
(defun +modeline-vc (&optional spacer)
|
||||||
"Display the version control branch of the current buffer in the modeline."
|
"Display the version control branch of the current buffer in the modeline."
|
||||||
;; from https://www.gonsie.com/blorg/modeline.html, from Doom
|
;; from https://www.gonsie.com/blorg/modeline.html, from Doom
|
||||||
(if-let ((backend (vc-backend buffer-file-name)))
|
(if-let ((backend (vc-backend buffer-file-name)))
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2)))
|
(substring vc-mode (+ (if (eq backend 'Hg) 2 3) 2)))
|
||||||
""))
|
""))
|
||||||
|
|
||||||
(defun +modeline-track (&optional spacer)
|
(defun +modeline-track (&optional spacer)
|
||||||
|
@ -382,8 +383,8 @@ to a function in the current buffer, call that function instead."
|
||||||
|
|
||||||
(defun +modeline-anzu (&optional spacer)
|
(defun +modeline-anzu (&optional spacer)
|
||||||
"Display `anzu--update-mode-line'."
|
"Display `anzu--update-mode-line'."
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(anzu--update-mode-line)))
|
(anzu--update-mode-line)))
|
||||||
|
|
||||||
(defun +modeline-text-scale (&optional spacer)
|
(defun +modeline-text-scale (&optional spacer)
|
||||||
"Display text scaling level."
|
"Display text scaling level."
|
||||||
|
@ -398,51 +399,51 @@ to a function in the current buffer, call that function instead."
|
||||||
"Display `ace-window-display-mode' information in the modeline."
|
"Display `ace-window-display-mode' information in the modeline."
|
||||||
(when (and +ace-window-display-mode
|
(when (and +ace-window-display-mode
|
||||||
ace-window-mode)
|
ace-window-mode)
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(window-parameter (selected-window) 'ace-window-path))))
|
(window-parameter (selected-window) 'ace-window-path))))
|
||||||
|
|
||||||
(defun +modeline-god-mode (&optional spacer)
|
(defun +modeline-god-mode (&optional spacer)
|
||||||
"Display an icon when `god-mode' is active."
|
"Display an icon when `god-mode' is active."
|
||||||
(when (and (boundp 'god-local-mode) god-local-mode)
|
(when (and (boundp 'god-local-mode) god-local-mode)
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(propertize "Ω"
|
(propertize "Ω"
|
||||||
'help-echo (concat "God mode is active."
|
'help-echo (concat "God mode is active."
|
||||||
"\nmouse-1: exit God mode.")
|
"\nmouse-1: exit God mode.")
|
||||||
'local-map (purecopy
|
'local-map (purecopy
|
||||||
(simple-modeline-make-mouse-map
|
(simple-modeline-make-mouse-map
|
||||||
'mouse-1 (lambda (e)
|
'mouse-1 (lambda (e)
|
||||||
(interactive "e")
|
(interactive "e")
|
||||||
(with-selected-window
|
(with-selected-window
|
||||||
(posn-window
|
(posn-window
|
||||||
(event-start e))
|
(event-start e))
|
||||||
(god-local-mode -1)
|
(god-local-mode -1)
|
||||||
(force-mode-line-update)))))
|
(force-mode-line-update)))))
|
||||||
'mouse-face 'mode-line-highlight))))
|
'mouse-face 'mode-line-highlight))))
|
||||||
|
|
||||||
(defun +modeline-input-method (&optional spacer)
|
(defun +modeline-input-method (&optional spacer)
|
||||||
"Display which input method is active."
|
"Display which input method is active."
|
||||||
(when current-input-method
|
(when current-input-method
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(propertize current-input-method-title
|
(propertize current-input-method-title
|
||||||
'help-echo (format
|
'help-echo (format
|
||||||
(concat "Current input method: %s\n"
|
(concat "Current input method: %s\n"
|
||||||
"mouse-1: Describe current input method\n"
|
"mouse-1: Describe current input method\n"
|
||||||
"mouse-3: Toggle input method")
|
"mouse-3: Toggle input method")
|
||||||
current-input-method)
|
current-input-method)
|
||||||
'local-map (purecopy
|
'local-map (purecopy
|
||||||
(let ((map (make-sparse-keymap)))
|
(let ((map (make-sparse-keymap)))
|
||||||
(define-key map [mode-line mouse-1]
|
(define-key map [mode-line mouse-1]
|
||||||
(lambda (e)
|
(lambda (e)
|
||||||
(interactive "e")
|
(interactive "e")
|
||||||
(with-selected-window (posn-window (event-start e))
|
(with-selected-window (posn-window (event-start e))
|
||||||
(describe-current-input-method))))
|
(describe-current-input-method))))
|
||||||
(define-key map [mode-line mouse-3]
|
(define-key map [mode-line mouse-3]
|
||||||
(lambda (e)
|
(lambda (e)
|
||||||
(interactive "e")
|
(interactive "e")
|
||||||
(with-selected-window (posn-window (event-start e))
|
(with-selected-window (posn-window (event-start e))
|
||||||
(toggle-input-method nil :interactive))))
|
(toggle-input-method nil :interactive))))
|
||||||
map))
|
map))
|
||||||
'mouse-face 'mode-line-highlight))))
|
'mouse-face 'mode-line-highlight))))
|
||||||
|
|
||||||
(defface +modeline-kmacro-indicator '((t :foreground "Firebrick"))
|
(defface +modeline-kmacro-indicator '((t :foreground "Firebrick"))
|
||||||
"Face for the kmacro indicator in the modeline.")
|
"Face for the kmacro indicator in the modeline.")
|
||||||
|
@ -450,20 +451,20 @@ to a function in the current buffer, call that function instead."
|
||||||
(defun +modeline-kmacro-indicator (&optional spacer)
|
(defun +modeline-kmacro-indicator (&optional spacer)
|
||||||
"Display an indicator when recording a kmacro."
|
"Display an indicator when recording a kmacro."
|
||||||
(when defining-kbd-macro
|
(when defining-kbd-macro
|
||||||
(+modeline-spacer nil nil
|
(+modeline-spacer nil spacer
|
||||||
(propertize "●"
|
(propertize "●"
|
||||||
'face '+modeline-kmacro-indicator
|
'face '+modeline-kmacro-indicator
|
||||||
'help-echo (format (concat "Defining a macro\n"
|
'help-echo (format (concat "Defining a macro\n"
|
||||||
"Current step: %d\n"
|
"Current step: %d\n"
|
||||||
"mouse-1: Stop recording")
|
"mouse-1: Stop recording")
|
||||||
kmacro-counter)
|
kmacro-counter)
|
||||||
'local-map (purecopy (simple-modeline-make-mouse-map
|
'local-map (purecopy (simple-modeline-make-mouse-map
|
||||||
'mouse-1 (lambda (e)
|
'mouse-1 (lambda (e)
|
||||||
(interactive "e")
|
(interactive "e")
|
||||||
(with-selected-window
|
(with-selected-window
|
||||||
(posn-window (event-start e))
|
(posn-window (event-start e))
|
||||||
(kmacro-end-macro nil)))))
|
(kmacro-end-macro nil)))))
|
||||||
'mouse-face 'mode-line-highlight))))
|
'mouse-face 'mode-line-highlight))))
|
||||||
|
|
||||||
(provide '+modeline)
|
(provide '+modeline)
|
||||||
;;; +modeline.el ends here
|
;;; +modeline.el ends here
|
||||||
|
|
Loading…
Reference in New Issue