Refactor out map.el usage

After some profiling, it turns out map-put and map-delete are 5-7x
slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for
small lists (under 250 items), which is exactly how I've been using
them.

The only caveat is alist-get's signature is different on Emacs 25, thus
a polyfill is necessary in core-lib.
This commit is contained in:
Henrik Lissner 2018-06-23 16:48:58 +02:00
parent f602a1f607
commit f6dc6ac74e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
29 changed files with 177 additions and 146 deletions

View file

@ -21,11 +21,12 @@
:after-call (doom-before-switch-buffer after-find-file)
:config
;; Register missing indent variables
(setq editorconfig-indentation-alist
(append '((mips-mode mips-tab-width)
(haxor-mode haxor-tab-width)
(nasm-mode nasm-basic-offset))
editorconfig-indentation-alist))
(unless (assq 'mips-mode editorconfig-indentation-alist)
(setq editorconfig-indentation-alist
(append '((mips-mode mips-tab-width)
(haxor-mode haxor-tab-width)
(nasm-mode nasm-basic-offset))
editorconfig-indentation-alist)))
(defun doom*editorconfig-smart-detection (orig-fn &rest args)
"Retrieve the properties for the current file. If it doesn't have an
@ -51,7 +52,8 @@ extension, try to guess one."
;; editorconfig to ignore indentation there. I prefer dynamic indentation
;; support built into Emacs.
(dolist (mode '(emacs-lisp-mode lisp-mode))
(map-delete editorconfig-indentation-alist mode))
(delq (assq mode editorconfig-indentation-alist)
editorconfig-indentation-alist))
;;
(editorconfig-mode +1))