diff options
| author | Glenn Morris | 2014-06-30 14:26:34 -0400 |
|---|---|---|
| committer | Glenn Morris | 2014-06-30 14:26:34 -0400 |
| commit | 0224bf74b28fea8cc64e80390b0210e3909dd81b (patch) | |
| tree | d8a4e409562bfbc95b5173a8261599639c39981b | |
| parent | c6ecf7f23d99a7c51a9372fefb261ddca89a1db2 (diff) | |
| download | emacs-0224bf74b28fea8cc64e80390b0210e3909dd81b.tar.gz emacs-0224bf74b28fea8cc64e80390b0210e3909dd81b.zip | |
Get rid of the AUTOGEN_VCS variable in lisp/Makefile
* lisp/emacs-lisp/autoload.el (autoload-ensure-writable): New variable.
(autoload-ensure-default-file): Maybe make existing output writable.
* lisp/Makefile.in (AUTOGEN_VCS): Remove.
(autoloads): Use autoload-ensure-writable rather than AUTOGEN_VCS.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/Makefile.in | 14 | ||||
| -rw-r--r-- | lisp/emacs-lisp/autoload.el | 21 |
3 files changed, 27 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cbf8329d583..877560e5f62 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-06-30 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/autoload.el (autoload-ensure-writable): New variable. | ||
| 4 | (autoload-ensure-default-file): Maybe make existing output writable. | ||
| 5 | * Makefile.in (AUTOGEN_VCS): Remove. | ||
| 6 | (autoloads): Use autoload-ensure-writable rather than AUTOGEN_VCS. | ||
| 7 | |||
| 1 | 2014-06-30 Fabián Ezequiel Gallina <fgallina@gnu.org> | 8 | 2014-06-30 Fabián Ezequiel Gallina <fgallina@gnu.org> |
| 2 | 9 | ||
| 3 | * emacs-lisp/subr-x.el (string-reverse): Use `reverse'. | 10 | * emacs-lisp/subr-x.el (string-reverse): Use `reverse'. |
diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 45a964b0d70..eba63666ddb 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in | |||
| @@ -70,17 +70,6 @@ AUTOGENEL = loaddefs.el \ | |||
| 70 | cedet/srecode/loaddefs.el \ | 70 | cedet/srecode/loaddefs.el \ |
| 71 | org/org-loaddefs.el | 71 | org/org-loaddefs.el |
| 72 | 72 | ||
| 73 | # Versioned files that are the value of someone's `generated-autoload-file'. | ||
| 74 | AUTOGEN_VCS = \ | ||
| 75 | ps-print.el \ | ||
| 76 | obsolete/tpu-edt.el \ | ||
| 77 | mail/rmail.el \ | ||
| 78 | dired.el \ | ||
| 79 | ibuffer.el \ | ||
| 80 | htmlfontify.el \ | ||
| 81 | emacs-lisp/eieio.el \ | ||
| 82 | textmodes/reftex.el | ||
| 83 | |||
| 84 | # Value of max-lisp-eval-depth when compiling initially. | 73 | # Value of max-lisp-eval-depth when compiling initially. |
| 85 | # During bootstrapping the byte-compiler is run interpreted when compiling | 74 | # During bootstrapping the byte-compiler is run interpreted when compiling |
| 86 | # itself, and uses more stack than usual. | 75 | # itself, and uses more stack than usual. |
| @@ -182,7 +171,6 @@ finder-data: | |||
| 182 | --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(srcdir)/finder-inf.el"))' \ | 171 | --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(srcdir)/finder-inf.el"))' \ |
| 183 | -f finder-compile-keywords-make-dist $$wins | 172 | -f finder-compile-keywords-make-dist $$wins |
| 184 | 173 | ||
| 185 | # The chmod +w is to handle env var CVSREAD=1. | ||
| 186 | # Use expand-file-name rather than $abs_scrdir so that Emacs does not | 174 | # Use expand-file-name rather than $abs_scrdir so that Emacs does not |
| 187 | # get confused when it compares file-names for equality. | 175 | # get confused when it compares file-names for equality. |
| 188 | # | 176 | # |
| @@ -190,10 +178,10 @@ finder-data: | |||
| 190 | # If you want to allow autoloads in such files, remove that, | 178 | # If you want to allow autoloads in such files, remove that, |
| 191 | # and make this depend on leim. | 179 | # and make this depend on leim. |
| 192 | autoloads: $(LOADDEFS) | 180 | autoloads: $(LOADDEFS) |
| 193 | cd $(lisp) && chmod +w $(AUTOGEN_VCS) | ||
| 194 | $(setwins_almost); \ | 181 | $(setwins_almost); \ |
| 195 | echo Directories: $$wins; \ | 182 | echo Directories: $$wins; \ |
| 196 | $(emacs) -l autoload \ | 183 | $(emacs) -l autoload \ |
| 184 | --eval '(setq autoload-ensure-writable t)' \ | ||
| 197 | --eval '(setq autoload-builtin-package-versions t)' \ | 185 | --eval '(setq autoload-builtin-package-versions t)' \ |
| 198 | --eval '(setq generated-autoload-file (expand-file-name (unmsys--file-name "$(srcdir)/loaddefs.el")))' \ | 186 | --eval '(setq generated-autoload-file (expand-file-name (unmsys--file-name "$(srcdir)/loaddefs.el")))' \ |
| 199 | -f batch-update-autoloads $$wins | 187 | -f batch-update-autoloads $$wins |
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 361e8fa7c68..38956df66de 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el | |||
| @@ -351,9 +351,26 @@ not be relied upon." | |||
| 351 | ";;; " basename | 351 | ";;; " basename |
| 352 | " ends here\n"))) | 352 | " ends here\n"))) |
| 353 | 353 | ||
| 354 | (defvar autoload-ensure-writable nil | ||
| 355 | "Non-nil means `autoload-ensure-default-file' makes existing file writable.") | ||
| 356 | ;; Just in case someone tries to get you to overwrite a file that you | ||
| 357 | ;; don't want to. | ||
| 358 | ;;;###autoload | ||
| 359 | (put 'autoload-ensure-writable 'risky-local-variable t) | ||
| 360 | |||
| 354 | (defun autoload-ensure-default-file (file) | 361 | (defun autoload-ensure-default-file (file) |
| 355 | "Make sure that the autoload file FILE exists and if not create it." | 362 | "Make sure that the autoload file FILE exists, creating it if needed. |
| 356 | (unless (file-exists-p file) | 363 | If the file already exists and `autoload-ensure-writable' is non-nil, |
| 364 | make it writable." | ||
| 365 | (if (file-exists-p file) | ||
| 366 | ;; Probably pointless, but replaces the old AUTOGEN_VCS in lisp/Makefile, | ||
| 367 | ;; which was designed to handle CVSREAD=1 and equivalent. | ||
| 368 | (and autoload-ensure-writable | ||
| 369 | (let ((modes (file-modes file))) | ||
| 370 | (if (zerop (logand modes #o0200)) | ||
| 371 | ;; Ignore any errors here, and let subsequent attempts | ||
| 372 | ;; to write the file raise any real error. | ||
| 373 | (ignore-errors (set-file-modes file (logior modes #o0200)))))) | ||
| 357 | (write-region (autoload-rubric file) nil file)) | 374 | (write-region (autoload-rubric file) nil file)) |
| 358 | file) | 375 | file) |
| 359 | 376 | ||