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)"
|
||||
(declare (indent defun))
|
||||
(dolist (mode (doom-enlist modes))
|
||||
(if (null (car-safe rest))
|
||||
(delq (assq mode +pretty-code-symbols-alist)
|
||||
+pretty-code-symbols-alist)
|
||||
(let (results merge key)
|
||||
(while rest
|
||||
(setq key (pop rest))
|
||||
(pcase key
|
||||
(pcase (setq key (pop rest))
|
||||
(: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)))))
|
||||
(dolist (mode (doom-enlist modes))
|
||||
(unless merge
|
||||
(delq (assq mode +pretty-code-symbols-alist)
|
||||
+pretty-code-symbols-alist))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue