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:
parent
f602a1f607
commit
f6dc6ac74e
29 changed files with 177 additions and 146 deletions
|
@ -22,9 +22,9 @@
|
|||
(setq sh-indent-after-continuation 'always)
|
||||
|
||||
;; recognize function names with dashes in them
|
||||
(map-put sh-imenu-generic-expression
|
||||
'sh '((nil "^\\s-*function\\s-+\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*\\(?:()\\)?" 1)
|
||||
(nil "^\\s-*\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*()" 1)))
|
||||
(add-to-list 'sh-imenu-generic-expression
|
||||
'(sh (nil "^\\s-*function\\s-+\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*\\(?:()\\)?" 1)
|
||||
(nil "^\\s-*\\([[:alpha:]_-][[:alnum:]_-]*\\)\\s-*()" 1)))
|
||||
|
||||
;; `sh-set-shell' is chatty about setting up indentation rules
|
||||
(advice-add #'sh-set-shell :around #'doom*shut-up)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue