Fix set-pretty-symbols! with multiple modes
(set-pretty-symbols! '(c-mode c++-mode objc-mode) RULES*) This fixes a logic bug that prevented RULES from applying to any but the first mode in the list (e.g. only c-mode will be affected).
This commit is contained in:
parent
cdf745e72a
commit
765ca10a92
1 changed files with 12 additions and 13 deletions
|
@ -88,19 +88,18 @@ Pretty symbols can be unset for emacs-lisp-mode with:
|
||||||
|
|
||||||
(set-pretty-symbols! 'emacs-lisp-mode nil)"
|
(set-pretty-symbols! 'emacs-lisp-mode nil)"
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
(dolist (mode (doom-enlist modes))
|
(if (null (car-safe rest))
|
||||||
(if (null (car-safe rest))
|
(delq (assq mode +pretty-code-symbols-alist)
|
||||||
(delq (assq mode +pretty-code-symbols-alist)
|
+pretty-code-symbols-alist)
|
||||||
+pretty-code-symbols-alist)
|
(let (results merge key)
|
||||||
(let (results merge key)
|
(while rest
|
||||||
(while rest
|
(pcase (setq key (pop rest))
|
||||||
(setq key (pop rest))
|
(:merge (setq merge (pop rest)))
|
||||||
(pcase key
|
(:alist (setq results (append (pop rest) results)))
|
||||||
(:merge (setq merge (pop rest)))
|
(_
|
||||||
(:alist (setq results (append (pop rest) results)))
|
(when-let* ((char (plist-get +pretty-code-symbols key)))
|
||||||
(_
|
(push (cons (pop rest) char) results)))))
|
||||||
(when-let* ((char (plist-get +pretty-code-symbols key)))
|
(dolist (mode (doom-enlist modes))
|
||||||
(push (cons (pop rest) char) results)))))
|
|
||||||
(unless merge
|
(unless merge
|
||||||
(delq (assq mode +pretty-code-symbols-alist)
|
(delq (assq mode +pretty-code-symbols-alist)
|
||||||
+pretty-code-symbols-alist))
|
+pretty-code-symbols-alist))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue