Sync up with README.en.
[elisp/apel.git] / pym.el
diff --git a/pym.el b/pym.el
index c58ada7..ca6676d 100644 (file)
--- a/pym.el
+++ b/pym.el
 
 ;;; Code:
 
+;; for `load-history'.
 (or (boundp 'current-load-list) (setq current-load-list nil))
 
-;; We cannot use `eval-when-compile' here because v18 does not have it.
-;; (eval-when-compile (require 'static))
-;; Should we use these two macros to emulate `eval-when-compile' ?
-;; (defmacro pym-dummy-require-static ()
-;;   (list 'quote (eval '(require 'static))))
-;; (defmacro pym-dummy-require-static-at-compile-time ()
-;;   (pym-dummy-require-static))
 (require 'static)
 
 
@@ -69,8 +63,8 @@ See also the function `defun'."
       (` (or (fboundp (quote (, name)))
             (prog1
                 (defun (, name) (,@ everything-else))
-              ;; This `defun' will be compiled to `fset', which does
-              ;; not update `load-history'.
+              ;; This `defun' will be compiled to `fset',
+              ;; which does not update `load-history'.
               ;; We must update `current-load-list' explicitly.
               (setq current-load-list
                     (cons (quote (, name)) current-load-list))
@@ -85,6 +79,9 @@ See also the function `defmacro'."
       (` (or (fboundp (quote (, name)))
             (prog1
                 (defmacro (, name) (,@ everything-else))
+              ;; This `defmacro' will be compiled to `fset',
+              ;; which does not update `load-history'.
+              ;; We must update `current-load-list' explicitly.
               (setq current-load-list
                     (cons (quote (, name)) current-load-list))
               (put (quote (, name)) 'defmacro-maybe t))))))
@@ -98,6 +95,9 @@ See also the macro `defsubst'."
       (` (or (fboundp (quote (, name)))
             (prog1
                 (defsubst (, name) (,@ everything-else))
+              ;; This `defsubst' will be compiled to `fset',
+              ;; which does not update `load-history'.
+              ;; We must update `current-load-list' explicitly.
               (setq current-load-list
                     (cons (quote (, name)) current-load-list))
               (put (quote (, name)) 'defsubst-maybe t))))))
@@ -111,8 +111,7 @@ See also the function `defalias'."
       (` (or (fboundp (quote (, symbol)))
             (prog1
                 (defalias (quote (, symbol)) (, definition))
-              (setq current-load-list
-                    (cons (quote (, symbol)) current-load-list))
+              ;; `defalias' updates `load-history' internally.
               (put (quote (, symbol)) 'defalias-maybe t))))))
 
 (defmacro defvar-maybe (name &rest everything-else)
@@ -135,6 +134,8 @@ See also the function `defconst'."
       (` (or (boundp (quote (, name)))
             (prog1
                 (defconst (, name) (,@ everything-else))
+              ;; byte-compiler will generate code to update
+              ;; `load-history'.
               (put (quote (, name)) 'defconst-maybe t))))))
 
 (defmacro defun-maybe-cond (name args &optional doc &rest clauses)
@@ -162,6 +163,9 @@ See also the function `defun'."
                                  (` (defun (, name) (, args)
                                       (,@ (cdr case))))))))
                       clauses)))
+              ;; This `defun' will be compiled to `fset',
+              ;; which does not update `load-history'.
+              ;; We must update `current-load-list' explicitly.
               (setq current-load-list
                     (cons (quote (, name)) current-load-list))
               (put (quote (, name)) 'defun-maybe t))))))
@@ -191,6 +195,9 @@ See also the function `defmacro'."
                                  (` (defmacro (, name) (, args)
                                       (,@ (cdr case))))))))
                       clauses)))
+              ;; This `defmacro' will be compiled to `fset',
+              ;; which does not update `load-history'.
+              ;; We must update `current-load-list' explicitly.
               (setq current-load-list
                     (cons (quote (, name)) current-load-list))
               (put (quote (, name)) 'defmacro-maybe t))))))
@@ -220,6 +227,9 @@ See also the macro `defsubst'."
                                  (` (defsubst (, name) (, args)
                                       (,@ (cdr case))))))))
                       clauses)))
+              ;; This `defsubst' will be compiled to `fset',
+              ;; which does not update `load-history'.
+              ;; We must update `current-load-list' explicitly.
               (setq current-load-list
                     (cons (quote (, name)) current-load-list))
               (put (quote (, name)) 'defsubst-maybe t))))))
@@ -267,6 +277,15 @@ Both SYMBOL and SPEC are unevaluated. The SPEC can be 0, t, a symbol
 ;; (def-edebug-spec static-cond ...)
 
 
+;;; for backward compatibility.
+
+(defun subr-fboundp (symbol)
+  "Return t if SYMBOL's function definition is a built-in function."
+  (and (fboundp symbol)
+       (subrp (symbol-function symbol))))
+;; (make-obsolete 'subr-fboundp "don't use it.")
+
+
 ;;; End.
 
 (provide 'pym)