diff options
author | Ulrich Müller <ulm@gentoo.org> | 2024-10-14 20:17:21 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2024-10-14 20:17:21 +0200 |
commit | 6291987bf6c802460671b28b98f2e669d78e0e05 (patch) | |
tree | 2a0373b175dc18606b85fbe51ef8158e83f7f793 | |
parent | Update a comment (diff) | |
download | ebuild-mode-6291987bf6c802460671b28b98f2e669d78e0e05.tar.gz ebuild-mode-6291987bf6c802460671b28b98f2e669d78e0e05.tar.bz2 ebuild-mode-6291987bf6c802460671b28b98f2e669d78e0e05.zip |
Avoid e as variable name
* ebuild-mode.el:
* test/ebuild-mode-tests.el: Avoid e as variable name because some
Emacs versions define it as a global constant for Euler's number.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ebuild-mode.el | 30 | ||||
-rw-r--r-- | test/ebuild-mode-tests.el | 8 |
3 files changed, 24 insertions, 20 deletions
@@ -1,3 +1,9 @@ +2024-10-14 Ulrich Müller <ulm@gentoo.org> + + * ebuild-mode.el: + * test/ebuild-mode-tests.el: Avoid e as variable name because some + Emacs versions define it as a global constant for Euler's number. + 2024-10-12 Ulrich Müller <ulm@gentoo.org> * devbook-mode.el (rng-loc): Require. diff --git a/ebuild-mode.el b/ebuild-mode.el index 27067a5..589fdaa 100644 --- a/ebuild-mode.el +++ b/ebuild-mode.el @@ -285,13 +285,13 @@ Optional argument LIMIT specifies the maximum length for the car of the elements." (let (dst) (dolist (c src) - (let ((e (rassoc (cdr c) dst))) + (let ((d (rassoc (cdr c) dst))) (cond - ((and e (or (not limit) - (<= (+ (length (car e)) (length (car c))) limit))) - ;; cdrs of new element C and previous element E are equal, - ;; and their combined length is below LIMIT => append to E - (setcar e (append (car e) (car c)))) + ((and d (or (not limit) + (<= (+ (length (car d)) (length (car c))) limit))) + ;; cdrs of new element C and previous element D are equal, + ;; and their combined length is below LIMIT => append to D + (setcar d (append (car d) (car c)))) ((or (not limit) (<= (length (car c)) limit)) ;; new element C is small enough => push to DST @@ -744,8 +744,8 @@ optional second argument NOERROR is non-nil." (save-excursion (goto-char (point-min)) (let ((case-fold-search nil) - (kwstring (mapconcat - (lambda (e) (concat (cdr e) (car e))) kw " "))) + (kwstring (mapconcat (lambda (x) (concat (cdr x) (car x))) + kw " "))) (cond ((not (re-search-forward ebuild-mode-arch-regexp nil t)) (unless noerror (error "No KEYWORDS assignment found"))) @@ -769,14 +769,12 @@ optional second argument NOERROR is non-nil." (delq oldk keywords)))) ;; modify all non-masked keywords in the list ((string-equal arch "all") - (dolist (e keywords) - (and (or (equal (cdr e) "") - (equal (cdr e) "~")) - (member (car e) - (if (equal leader "") - ebuild-mode-arch-stable-list - ebuild-mode-arch-list)) - (setcdr e leader)))) + (dolist (j keywords) + (and (member (cdr j) '("" "~")) + (member (car j) (if (equal leader "") + ebuild-mode-arch-stable-list + ebuild-mode-arch-list)) + (setcdr j leader)))) ;; modify keyword (oldk (setcdr oldk leader)) ;; add keyword diff --git a/test/ebuild-mode-tests.el b/test/ebuild-mode-tests.el index d753a60..a295e8b 100644 --- a/test/ebuild-mode-tests.el +++ b/test/ebuild-mode-tests.el @@ -84,14 +84,14 @@ (let ((case-fold-search nil) (findkey (lambda (key) (catch 'found - (dolist (e ebuild-mode-font-lock-keywords) - (if (string-match (car e) key) - (throw 'found (cdr e)))))))) + (dolist (c ebuild-mode-font-lock-keywords) + (if (string-match (car c) key) + (throw 'found (cdr c)))))))) ;; Verify that all regexps are below the 32 KiB limit. ;; Our regexps are ASCII only, so don't bother with string-bytes ;; (GNU Emacs), string-char-byte-conversion-info (XEmacs 21.5), ;; or other horrid incompatibilities. - (should (< (apply #'max (mapcar (lambda (e) (length (car e))) + (should (< (apply #'max (mapcar (lambda (c) (length (car c))) ebuild-mode-font-lock-keywords)) 32768)) (should (equal (funcall findkey "doins") 'font-lock-builtin-face)) |