Minor refactors
+ cl-flet* -> cl-flet + refactor display-line-numbers-mode
This commit is contained in:
parent
9970fdac2c
commit
1e710e94e3
2 changed files with 4 additions and 4 deletions
|
@ -73,12 +73,12 @@ To change the type of line numbers displayed by default,
|
||||||
customize `display-line-numbers-type'. To change the type while
|
customize `display-line-numbers-type'. To change the type while
|
||||||
the mode is on, set `display-line-numbers' directly."
|
the mode is on, set `display-line-numbers' directly."
|
||||||
:lighter nil
|
:lighter nil
|
||||||
(cond ((eq display-line-numbers-type 'relative)
|
(cond ((null display-line-numbers-type))
|
||||||
|
((eq display-line-numbers-type 'relative)
|
||||||
(if display-line-numbers-mode
|
(if display-line-numbers-mode
|
||||||
(nlinum-relative-off)
|
(nlinum-relative-off)
|
||||||
(nlinum-relative-on)))
|
(nlinum-relative-on)))
|
||||||
((not (null display-line-numbers-type))
|
((nlinum-mode (if display-line-numbers-mode +1 -1)))))
|
||||||
(nlinum-mode (if display-line-numbers-mode +1 -1)))))
|
|
||||||
|
|
||||||
(defun display-line-numbers--turn-on ()
|
(defun display-line-numbers--turn-on ()
|
||||||
"Turn on `display-line-numbers-mode'."
|
"Turn on `display-line-numbers-mode'."
|
||||||
|
|
|
@ -57,7 +57,7 @@ Otherwise, it maps colors to a term-color-* face."
|
||||||
(defmacro format! (message &rest args)
|
(defmacro format! (message &rest args)
|
||||||
"An alternative to `format' that understands (color ...) and converts them
|
"An alternative to `format' that understands (color ...) and converts them
|
||||||
into faces or ANSI codes depending on the type of sesssion we're in."
|
into faces or ANSI codes depending on the type of sesssion we're in."
|
||||||
`(cl-flet*
|
`(cl-flet
|
||||||
(,@(mapcar (lambda (rule) `(,(car rule)
|
(,@(mapcar (lambda (rule) `(,(car rule)
|
||||||
(lambda (message)
|
(lambda (message)
|
||||||
(doom-ansi-apply ',(car rule) message))))
|
(doom-ansi-apply ',(car rule) message))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue