set-pretty-symbols!: rename rest -> plist

A more sensibile name.
This commit is contained in:
Henrik Lissner 2018-10-16 17:32:41 -04:00
parent 3d6b30675c
commit e3a0ad0b33
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -58,7 +58,7 @@ correct width of the symbols instead of the width measured by `char-width'."
(cons (car ligature-alist) acc))) (cons (car ligature-alist) acc)))
;;;###autodef ;;;###autodef
(defun set-pretty-symbols! (modes &rest rest) (defun set-pretty-symbols! (modes &rest plist)
"Associates string patterns with icons in certain major-modes. "Associates string patterns with icons in certain major-modes.
MODES is a major mode symbol or a list of them. MODES is a major mode symbol or a list of them.
@ -88,17 +88,17 @@ 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))
(if (null (car-safe rest)) (if (null (car-safe plist))
(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 plist
(pcase (setq key (pop rest)) (pcase (setq key (pop plist))
(:merge (setq merge (pop rest))) (:merge (setq merge (pop plist)))
(:alist (setq results (append (pop rest) results))) (:alist (setq results (append (pop plist) results)))
(_ (_
(when-let* ((char (plist-get +pretty-code-symbols key))) (when-let* ((char (plist-get +pretty-code-symbols key)))
(push (cons (pop rest) char) results))))) (push (cons (pop plist) char) results)))))
(dolist (mode (doom-enlist modes)) (dolist (mode (doom-enlist modes))
(unless merge (unless merge
(delq (assq mode +pretty-code-symbols-alist) (delq (assq mode +pretty-code-symbols-alist)