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

@ -36,7 +36,7 @@ string). Stops at the first function to return non-nil.")
(or (cdr (assq lang +org-babel-mode-alist))
lang)))
nil t)))
(map-put org-babel-load-languages lang t))
(add-to-list 'org-babel-load-languages (cons lang t)))
t)))
(advice-add #'org-babel-confirm-evaluate :around #'+org*babel-lazy-load-library)

View file

@ -341,7 +341,7 @@ between the two."
(defun +org|setup-hacks ()
"Getting org to behave."
;; Don't open separate windows
(map-put org-link-frame-setup 'file #'find-file)
(setf (alist-get 'file org-link-frame-setup) #'find-file)
;; Let OS decide what to do with files when opened
(setq org-file-apps
`(("pdf" . default)