mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
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:
@ -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
|
||||
(: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)))))
|
||||
(if (null (car-safe rest))
|
||||
(delq (assq mode +pretty-code-symbols-alist)
|
||||
+pretty-code-symbols-alist)
|
||||
(let (results merge key)
|
||||
(while rest
|
||||
(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))
|
||||
|
Reference in New Issue
Block a user