summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-12-14 05:08:02 +0000
committerRoland McGrath <roland@gnu.org>1995-12-14 05:08:02 +0000
commit6709851fbb22064146a38cd6090a7ce663957bef (patch)
treecdd2e9b5c14757f122f4ae05a5c45884013a91af
parent65ab8329870a264366c10db906ee943f014b616c (diff)
downloademacs-6709851fbb22064146a38cd6090a7ce663957bef.tar.gz
(generate-file-autoloads): If no buffer visiting FILE exists, read it into
a temp buffer for processing without visiting it.
-rw-r--r--lisp/emacs-lisp/autoload.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 19b524ebb4f..cccfbedcfe1 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -1,6 +1,6 @@
;;; autoload.el --- maintain autoloads in loaddefs.el.
-;;; Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+;;; Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
;;;
;; Author: Roland McGrath <roland@gnu.ai.mit.edu>
;; Keywords: maint
@@ -150,7 +150,13 @@ are used."
(save-excursion
(unwind-protect
(progn
- (set-buffer (find-file-noselect file))
+ (if visited
+ (set-buffer visited)
+ ;; It is faster to avoid visiting the file.
+ (set-buffer (get-buffer-create " *generate-autoload-file*"))
+ (kill-all-local-variables)
+ (erase-buffer)
+ (insert-file-contents file nil))
(save-excursion
(save-restriction
(widen)