From: Juanma Barranquero <lekktu@gmail.com>
To: Emacs developers <emacs-devel@gnu.org>
Subject: Simplify `do-after-load-evaluation'
Date: Sat, 29 Aug 2009 21:41:57 +0200 [thread overview]
Message-ID: <f7ccd24b0908291241p613279bam51cb671d53487abb@mail.gmail.com> (raw)
I was going to remove unused local vars file-element and file-elements
from `do-after-load-evaluation', but on second thought, would someone
object to the following simplification? (The original code is a bit
opaque for the really simple work it does):
Index: subr.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/subr.el,v
retrieving revision 1.646
diff -u -2 -r1.646 subr.el
--- subr.el 27 Aug 2009 04:24:08 -0000 1.646
+++ subr.el 29 Aug 2009 19:36:31 -0000
@@ -1689,14 +1689,9 @@
"Evaluate all `eval-after-load' forms, if any, for ABS-FILE.
ABS-FILE, a string, should be the absolute true name of a file just loaded."
- (let ((after-load-elts after-load-alist)
- a-l-element file-elements file-element form)
- (while after-load-elts
- (setq a-l-element (car after-load-elts)
- after-load-elts (cdr after-load-elts))
- (when (and (stringp (car a-l-element))
- (string-match (car a-l-element) abs-file))
- (while (setq a-l-element (cdr a-l-element)) ; discard the file name
- (setq form (car a-l-element))
- (eval form))))))
+ (dolist (a-l-element after-load-alist)
+ (when (and (stringp (car a-l-element))
+ (string-match-p (car a-l-element) abs-file))
+ ;; discard the file name regexp
+ (mapc #'eval (cdr a-l-element)))))
(defun eval-next-after-load (file)
next reply other threads:[~2009-08-29 19:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-29 19:41 Juanma Barranquero [this message]
2009-08-29 21:28 ` Simplify `do-after-load-evaluation' Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7ccd24b0908291241p613279bam51cb671d53487abb@mail.gmail.com \
--to=lekktu@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).