unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Simplify `do-after-load-evaluation'
@ 2009-08-29 19:41 Juanma Barranquero
  2009-08-29 21:28 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Juanma Barranquero @ 2009-08-29 19:41 UTC (permalink / raw)
  To: Emacs developers

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)




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-29 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-29 19:41 Simplify `do-after-load-evaluation' Juanma Barranquero
2009-08-29 21:28 ` Stefan Monnier

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).