aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2016-04-23 17:59:06 -0700
committerGlenn Morris2016-04-23 17:59:06 -0700
commit5d1e62e32989399fd2a073cc8efc07f869a1b438 (patch)
treec67979129e6e7f0b0d07a26a9eea8c95d10f962e
parentb4c135f1217a0da26b792981b2132bca69d72145 (diff)
downloademacs-5d1e62e32989399fd2a073cc8efc07f869a1b438.tar.gz
emacs-5d1e62e32989399fd2a073cc8efc07f869a1b438.zip
When autoload-timestamps is nil, use a dummy timestamp rather than "t".
* lisp/emacs-lisp/autoload.el (autoload--non-timestamp): New constant. (autoload-generate-file-autoloads, autoload-find-destination) (update-directory-autoloads): Use autoload--non-timestamp.
-rw-r--r--lisp/emacs-lisp/autoload.el30
1 files changed, 20 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 14e584df672..1ab3de5f2fd 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -87,6 +87,12 @@ that text will be copied verbatim to `generated-autoload-file'.")
87(defconst generate-autoload-section-continuation ";;;;;; " 87(defconst generate-autoload-section-continuation ";;;;;; "
88 "String to add on each continuation of the section header form.") 88 "String to add on each continuation of the section header form.")
89 89
90;; In some ways it would be nicer to use a value that is recognisably
91;; not a time-value, eg t, but that can cause issues if an older Emacs
92;; that does not expect non-time-values loads the file.
93(defconst autoload--non-timestamp '(0 0 0 0)
94 "Value to insert when `autoload-timestamps' is nil.")
95
90(defvar autoload-timestamps nil ; experimental, see bug#22213 96(defvar autoload-timestamps nil ; experimental, see bug#22213
91 "Non-nil means insert a timestamp for each input file into the output. 97 "Non-nil means insert a timestamp for each input file into the output.
92We use these in incremental updates of the output file to decide 98We use these in incremental updates of the output file to decide
@@ -657,7 +663,7 @@ FILE's modification time."
657 nil nil 'emacs-mule-unix) 663 nil nil 'emacs-mule-unix)
658 (if autoload-timestamps 664 (if autoload-timestamps
659 (nth 5 (file-attributes relfile)) 665 (nth 5 (file-attributes relfile))
660 t))) 666 autoload--non-timestamp)))
661 (insert ";;; Generated autoloads from " relfile "\n"))) 667 (insert ";;; Generated autoloads from " relfile "\n")))
662 (insert generate-autoload-section-trailer)))) 668 (insert generate-autoload-section-trailer))))
663 (or noninteractive 669 (or noninteractive
@@ -755,11 +761,6 @@ removes any prior now out-of-date autoload entries."
755 (if (and (or (null existing-buffer) 761 (if (and (or (null existing-buffer)
756 (not (buffer-modified-p existing-buffer))) 762 (not (buffer-modified-p existing-buffer)))
757 (cond 763 (cond
758 ;; last-time is the time-stamp (specifying
759 ;; the last time we looked at the file) and
760 ;; the file hasn't been changed since.
761 ((listp last-time)
762 (not (time-less-p last-time file-time)))
763 ;; FIXME? Arguably we should throw a 764 ;; FIXME? Arguably we should throw a
764 ;; user error, or some kind of warning, 765 ;; user error, or some kind of warning,
765 ;; if we were called from update-file-autoloads, 766 ;; if we were called from update-file-autoloads,
@@ -768,8 +769,15 @@ removes any prior now out-of-date autoload entries."
768 ;; file modtime in such a case, 769 ;; file modtime in such a case,
769 ;; if there are multiple input files 770 ;; if there are multiple input files
770 ;; contributing to the output. 771 ;; contributing to the output.
771 ((and output-time (eq t last-time)) 772 ((and output-time
773 (member last-time
774 (list t autoload--non-timestamp)))
772 (not (time-less-p output-time file-time))) 775 (not (time-less-p output-time file-time)))
776 ;; last-time is the time-stamp (specifying
777 ;; the last time we looked at the file) and
778 ;; the file hasn't been changed since.
779 ((listp last-time)
780 (not (time-less-p last-time file-time)))
773 ;; last-time is an MD5 checksum instead. 781 ;; last-time is an MD5 checksum instead.
774 ((stringp last-time) 782 ((stringp last-time)
775 (equal last-time 783 (equal last-time
@@ -854,7 +862,7 @@ write its autoloads into the specified file instead."
854 ;; Remove the obsolete section. 862 ;; Remove the obsolete section.
855 (autoload-remove-section (match-beginning 0)) 863 (autoload-remove-section (match-beginning 0))
856 (setq last-time (nth 4 form)) 864 (setq last-time (nth 4 form))
857 (if (equal t last-time) 865 (if (member last-time (list t autoload--non-timestamp))
858 (setq last-time output-time)) 866 (setq last-time output-time))
859 (dolist (file file) 867 (dolist (file file)
860 (let ((file-time (nth 5 (file-attributes file)))) 868 (let ((file-time (nth 5 (file-attributes file))))
@@ -872,7 +880,9 @@ write its autoloads into the specified file instead."
872 ;; Remove the obsolete section. 880 ;; Remove the obsolete section.
873 (autoload-remove-section (match-beginning 0))) 881 (autoload-remove-section (match-beginning 0)))
874 ((not (time-less-p (let ((oldtime (nth 4 form))) 882 ((not (time-less-p (let ((oldtime (nth 4 form)))
875 (if (equal t oldtime) 883 (if (member oldtime
884 (list
885 t autoload--non-timestamp))
876 output-time 886 output-time
877 oldtime)) 887 oldtime))
878 (nth 5 (file-attributes file)))) 888 (nth 5 (file-attributes file))))
@@ -909,7 +919,7 @@ write its autoloads into the specified file instead."
909 (autoload-insert-section-header 919 (autoload-insert-section-header
910 (current-buffer) nil nil no-autoloads (if autoload-timestamps 920 (current-buffer) nil nil no-autoloads (if autoload-timestamps
911 no-autoloads-time 921 no-autoloads-time
912 t)) 922 autoload--non-timestamp))
913 (insert generate-autoload-section-trailer))) 923 (insert generate-autoload-section-trailer)))
914 924
915 (let ((version-control 'never)) 925 (let ((version-control 'never))