summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2013-06-13 18:24:52 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2013-06-13 18:24:52 -0400
commitde0503df97a507a523a192e877a8d5c7439c4846 (patch)
tree0753a678f85a7ea1a2eb46b81067e8a5d6dfc1e0 /src
parentbc5c8c5a6a1956122284468879862b1850dc3b5d (diff)
downloademacs-de0503df97a507a523a192e877a8d5c7439c4846.tar.gz
* lisp/subr.el (with-eval-after-load): New macro.
(eval-after-load): Allow form to be a function. take advantage of lexical-binding. (do-after-load-evaluation): Use dolist and adjust to new format. * lisp/simple.el (bad-packages-alist): Use dolist and with-eval-after-load. * doc/lispref/loading.texi (Hooks for Loading): Document with-eval-after-load instead of eval-after-load. Don't document after-load-alist. * src/lread.c (syms_of_lread): * src/fns.c (Fprovide): Adjust to new format of after-load-alist.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fns.c5
-rw-r--r--src/lread.c6
3 files changed, 12 insertions, 4 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4d6e669612f..827092e7f8a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * lread.c (syms_of_lread):
+ * fns.c (Fprovide): Adjust to new format of after-load-alist.
+
2013-06-13 Kelly Dean <kellydeanch@yahoo.com> (tiny change)
* fileio.c (Fdo_auto_save): Trap errors in auto-save-hook. (Bug#14479)
diff --git a/src/fns.c b/src/fns.c
index 08c6f055f38..06d4e358f10 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2545,6 +2545,8 @@ SUBFEATURE can be used to check a specific subfeature of FEATURE. */)
return (NILP (tem)) ? Qnil : Qt;
}
+static Lisp_Object Qfuncall;
+
DEFUN ("provide", Fprovide, Sprovide, 1, 2, 0,
doc: /* Announce that FEATURE is a feature of the current Emacs.
The optional argument SUBFEATURES should be a list of symbols listing
@@ -2567,7 +2569,7 @@ particular subfeatures supported in this version of FEATURE. */)
/* Run any load-hooks for this file. */
tem = Fassq (feature, Vafter_load_alist);
if (CONSP (tem))
- Fprogn (XCDR (tem));
+ Fmapc (Qfuncall, XCDR (tem));
return feature;
}
@@ -4866,6 +4868,7 @@ syms_of_fns (void)
Used by `featurep' and `require', and altered by `provide'. */);
Vfeatures = Fcons (intern_c_string ("emacs"), Qnil);
DEFSYM (Qsubfeatures, "subfeatures");
+ DEFSYM (Qfuncall, "funcall");
#ifdef HAVE_LANGINFO_CODESET
DEFSYM (Qcodeset, "codeset");
diff --git a/src/lread.c b/src/lread.c
index 3ca644bb45b..b57665e365c 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4485,15 +4485,15 @@ customize `jka-compr-load-suffixes' rather than the present variable. */);
DEFSYM (Qload_in_progress, "load-in-progress");
DEFVAR_LISP ("after-load-alist", Vafter_load_alist,
- doc: /* An alist of expressions to be evalled when particular files are loaded.
-Each element looks like (REGEXP-OR-FEATURE FORMS...).
+ doc: /* An alist of functions to be evalled when particular files are loaded.
+Each element looks like (REGEXP-OR-FEATURE FUNCS...).
REGEXP-OR-FEATURE is either a regular expression to match file names, or
a symbol \(a feature name).
When `load' is run and the file-name argument matches an element's
REGEXP-OR-FEATURE, or when `provide' is run and provides the symbol
-REGEXP-OR-FEATURE, the FORMS in the element are executed.
+REGEXP-OR-FEATURE, the FUNCS in the element are called.
An error in FORMS does not undo the load, but does prevent execution of
the rest of the FORMS. */);