diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-04-18 14:05:31 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-04-18 14:05:31 -0700 |
commit | dd92b5f5047931f6020045ce47360b62d1c2cb72 (patch) | |
tree | 336a9b31454bbf0f9c888ea6169c852e7eae9462 /lisp/emacs-lisp | |
parent | d11abb25428e9a468a5525c462489eb5a854798f (diff) | |
parent | 32364bbbaa8bda68228a3b0191c0b340c252d2a2 (diff) | |
download | emacs-dd92b5f5047931f6020045ce47360b62d1c2cb72.tar.gz emacs-dd92b5f5047931f6020045ce47360b62d1c2cb72.tar.bz2 emacs-dd92b5f5047931f6020045ce47360b62d1c2cb72.zip |
Merge from origin/emacs-25
32364bb substitute-command-keys keeps quotes’ text props
567ab52 * src/xwidget.c (x_draw_xwidget_glyph_string): More clipping ...
24b87a1 Add semantic-symref-filepattern-alist entry for lisp-interact...
cc0b713 Perform xref searches without visiting unopened files
5045575 Revert "Prevent bootstrap autoload backup files"
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/autoload.el | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 14e584df672..1b06fb6a51d 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -251,22 +251,9 @@ If a buffer is visiting the desired autoload file, return it." (enable-local-eval nil)) ;; We used to use `raw-text' to read this file, but this causes ;; problems when the file contains non-ASCII characters. - (let* ((delay-mode-hooks t) - (file (autoload-generated-file)) - (file-missing (not (file-exists-p file)))) - (when file-missing - (autoload-ensure-default-file file)) - (with-current-buffer - (find-file-noselect - (autoload-ensure-file-writeable - file)) - ;; block backups when the file has just been created, since - ;; the backups will just be the auto-generated headers. - ;; bug#23203 - (when file-missing - (setq buffer-backed-up t) - (save-buffer)) - (current-buffer))))) + (let ((delay-mode-hooks t)) + (find-file-noselect + (autoload-ensure-default-file (autoload-generated-file)))))) (defun autoload-generated-file () (expand-file-name generated-autoload-file @@ -387,22 +374,21 @@ not be relied upon." ;;;###autoload (put 'autoload-ensure-writable 'risky-local-variable t) -(defun autoload-ensure-file-writeable (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)))))) - file) - (defun autoload-ensure-default-file (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." - (write-region (autoload-rubric file) nil file)) + (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) (defun autoload-insert-section-header (outbuf autoloads load-name file time) "Insert the section-header line, |