emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117452: Get rid of the AUTOGEN_VCS variable in lisp


From: Glenn Morris
Subject: [Emacs-diffs] trunk r117452: Get rid of the AUTOGEN_VCS variable in lisp/Makefile
Date: Mon, 30 Jun 2014 18:26:42 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117452
revision-id: address@hidden
parent: address@hidden
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Mon 2014-06-30 14:26:34 -0400
message:
  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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/Makefile.in               
makefile.in-20091113204419-o5vbwnq5f7feedwu-1831
  lisp/emacs-lisp/autoload.el    autoload.el-20091113204419-o5vbwnq5f7feedwu-397
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-06-30 04:54:46 +0000
+++ b/lisp/ChangeLog    2014-06-30 18:26:34 +0000
@@ -1,3 +1,10 @@
+2014-06-30  Glenn Morris  <address@hidden>
+
+       * emacs-lisp/autoload.el (autoload-ensure-writable): New variable.
+       (autoload-ensure-default-file): Maybe make existing output writable.
+       * Makefile.in (AUTOGEN_VCS): Remove.
+       (autoloads): Use autoload-ensure-writable rather than AUTOGEN_VCS.
+
 2014-06-30  Fabián Ezequiel Gallina  <address@hidden>
 
        * emacs-lisp/subr-x.el (string-reverse): Use `reverse'.

=== modified file 'lisp/Makefile.in'
--- a/lisp/Makefile.in  2014-06-30 00:01:51 +0000
+++ b/lisp/Makefile.in  2014-06-30 18:26:34 +0000
@@ -70,17 +70,6 @@
        cedet/srecode/loaddefs.el \
        org/org-loaddefs.el
 
-# Versioned files that are the value of someone's `generated-autoload-file'.
-AUTOGEN_VCS = \
-       ps-print.el \
-       obsolete/tpu-edt.el \
-       mail/rmail.el \
-       dired.el \
-       ibuffer.el \
-       htmlfontify.el \
-       emacs-lisp/eieio.el \
-       textmodes/reftex.el
-
 # Value of max-lisp-eval-depth when compiling initially.
 # During bootstrapping the byte-compiler is run interpreted when compiling
 # itself, and uses more stack than usual.
@@ -182,7 +171,6 @@
          --eval '(setq generated-finder-keywords-file (unmsys--file-name 
"$(srcdir)/finder-inf.el"))' \
          -f finder-compile-keywords-make-dist $$wins
 
-# The chmod +w is to handle env var CVSREAD=1.
 # Use expand-file-name rather than $abs_scrdir so that Emacs does not
 # get confused when it compares file-names for equality.
 #
@@ -190,10 +178,10 @@
 # If you want to allow autoloads in such files, remove that,
 # and make this depend on leim.
 autoloads: $(LOADDEFS)
-       cd $(lisp) && chmod +w $(AUTOGEN_VCS)
        $(setwins_almost); \
        echo Directories: $$wins; \
        $(emacs) -l autoload \
+           --eval '(setq autoload-ensure-writable t)' \
            --eval '(setq autoload-builtin-package-versions t)' \
            --eval '(setq generated-autoload-file (expand-file-name 
(unmsys--file-name "$(srcdir)/loaddefs.el")))' \
            -f batch-update-autoloads $$wins

=== modified file 'lisp/emacs-lisp/autoload.el'
--- a/lisp/emacs-lisp/autoload.el       2014-01-01 07:43:34 +0000
+++ b/lisp/emacs-lisp/autoload.el       2014-06-30 18:26:34 +0000
@@ -351,9 +351,26 @@
            ";;; " basename
            " ends here\n")))
 
+(defvar autoload-ensure-writable nil
+  "Non-nil means `autoload-ensure-default-file' makes existing file writable.")
+;; Just in case someone tries to get you to overwrite a file that you
+;; don't want to.
+;;;###autoload
+(put 'autoload-ensure-writable 'risky-local-variable t)
+
 (defun autoload-ensure-default-file (file)
-  "Make sure that the autoload file FILE exists and if not create it."
-  (unless (file-exists-p file)
+  "Make sure that the autoload file FILE exists, creating it if needed.
+If the file already exists and `autoload-ensure-writable' is non-nil,
+make it writable."
+  (if (file-exists-p file)
+      ;; Probably pointless, but replaces the old AUTOGEN_VCS in lisp/Makefile,
+      ;; which was designed to handle CVSREAD=1 and equivalent.
+      (and autoload-ensure-writable
+          (let ((modes (file-modes file)))
+            (if (zerop (logand modes #o0200))
+                ;; Ignore any errors here, and let subsequent attempts
+                ;; to write the file raise any real error.
+                (ignore-errors (set-file-modes file (logior modes #o0200))))))
     (write-region (autoload-rubric file) nil file))
   file)
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]