mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
; Optimize shorthand insertion in loaddefs-generate--parse-file
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file): Optimize.
This commit is contained in:
parent
9a51fbb69f
commit
f266622cdb
1 changed files with 6 additions and 3 deletions
|
|
@ -404,10 +404,13 @@ don't include."
|
|||
(save-excursion
|
||||
;; since we're "open-coding" we have to repeat more
|
||||
;; complicated logic in `hack-local-variables'.
|
||||
(when (re-search-forward "read-symbol-shorthands: *" nil t)
|
||||
(let* ((commentless (replace-regexp-in-string
|
||||
(when-let ((beg
|
||||
(re-search-forward "read-symbol-shorthands: *" nil t)))
|
||||
;; `read-symbol-shorthands' alist ends with two parens.
|
||||
(let* ((end (re-search-forward ")[;\n\s]*)"))
|
||||
(commentless (replace-regexp-in-string
|
||||
"\n\\s-*;+" ""
|
||||
(buffer-substring (point) (point-max))))
|
||||
(buffer-substring beg end)))
|
||||
(unsorted-shorthands (car (read-from-string commentless))))
|
||||
(setq read-symbol-shorthands
|
||||
(sort unsorted-shorthands
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue