[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f266622cdb3 8/8: ; Optimize shorthand insertion in loaddefs-gener
From: |
João Távora |
Subject: |
master f266622cdb3 8/8: ; Optimize shorthand insertion in loaddefs-generate--parse-file |
Date: |
Sat, 3 Feb 2024 09:44:08 -0500 (EST) |
branch: master
commit f266622cdb34044f364976796a4e7ac003d7a1b3
Author: Joseph Turner <joseph@ushin.org>
Commit: João Távora <joaotavora@gmail.com>
; Optimize shorthand insertion in loaddefs-generate--parse-file
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--parse-file):
Optimize.
---
lisp/emacs-lisp/loaddefs-gen.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/emacs-lisp/loaddefs-gen.el b/lisp/emacs-lisp/loaddefs-gen.el
index 8aacbf406b6..fe29469d08c 100644
--- a/lisp/emacs-lisp/loaddefs-gen.el
+++ b/lisp/emacs-lisp/loaddefs-gen.el
@@ -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
- master updated (25bf8d3cdc6 -> f266622cdb3), João Távora, 2024/02/03
- master c2aaa8f15aa 2/8: Process read-symbol-shorthands from longest to shortest (bug#67390), João Távora, 2024/02/03
- master 17c3610c561 3/8: Consider read-symbol-shorthands in check-declare.el (bug#67523), João Távora, 2024/02/03
- master 817140a852e 6/8: Fix prefix discovery for files with read-symbol-shorthands (bug#67325), João Távora, 2024/02/03
- master 9a51fbb69fc 7/8: ; Also consider shorthands in check-declare-scan (bug#67523), João Távora, 2024/02/03
- master 5e4a0a29fa3 1/8: Make sure read-symbol-shorthands is permanently local, João Távora, 2024/02/03
- master 0f715f9c154 4/8: Improve shorthands-font-lock-shorthands (bug#67390), João Távora, 2024/02/03
- master c52d17d91ad 5/8: Also teach loaddefs-gen.el about shorthands (bug#63480), João Távora, 2024/02/03
- master f266622cdb3 8/8: ; Optimize shorthand insertion in loaddefs-generate--parse-file,
João Távora <=