Minor, general refactor

In some contexts, map-put is superior to add-to-list.
This commit is contained in:
Henrik Lissner 2018-05-29 15:34:12 +02:00
parent 592d83a968
commit 947fe345c3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
7 changed files with 10 additions and 12 deletions

View file

@ -363,7 +363,7 @@ directory, the file name, and its state (modified, read-only or non-existent)."
(concat (format-mode-line mode-name)
(when (stringp mode-line-process)
mode-line-process)
(and (featurep 'face-remap)
(and (boundp 'text-scale-mode-amount)
(/= text-scale-mode-amount 0)
(format " (%+d)" text-scale-mode-amount)))
'face (if (active) 'doom-modeline-buffer-major-mode)))
@ -495,8 +495,7 @@ lines are selected, or the NxM dimensions of a block selection."
(format "%dL" lines))
((> lines 1)
(format "%dC %dL" (- end beg) lines))
(t
(format "%dC" (- end beg))))
((format "%dC" (- end beg))))
(when +doom-modeline-enable-word-count
(format " %dW" (count-words beg end)))))
'face 'doom-modeline-highlight))))

View file

@ -591,11 +591,11 @@ and may be called only if no window on SIDE exists yet."
;; Initialize `window-side' parameter of new window to SIDE and
;; make that parameter persistent.
(set-window-parameter window 'window-side side)
(add-to-list 'window-persistent-parameters '(window-side . writable))
(map-put window-persistent-parameters 'window-side 'writable)
;; Install `window-slot' parameter of new window and make that
;; parameter persistent.
(set-window-parameter window 'window-slot slot)
(add-to-list 'window-persistent-parameters '(window-slot . writable))
(map-put window-persistent-parameters 'window-slot 'writable)
;; Auto-adjust height/width of new window unless a size has been
;; explicitly requested.
(unless (if left-or-right
@ -671,7 +671,7 @@ Accepts the same arguments as `display-buffer-in-side-window'. You must set
(lambda (_side) (frame-root-window (selected-frame)))))
(when-let* ((window (window--make-major-side-window buffer side slot alist)))
(set-window-parameter window 'window-vslot vslot)
(add-to-list 'window-persistent-parameters '(window-vslot . writable))
(map-put window-persistent-parameters 'window-vslot 'writable)
window)))
(t
;; Scan windows on SIDE.