]> git.eshelyaron.com Git - emacs.git/commitdiff
(generate-file-autoloads): If no buffer visiting FILE exists, read it into
authorRoland McGrath <roland@gnu.org>
Thu, 14 Dec 1995 05:08:02 +0000 (05:08 +0000)
committerRoland McGrath <roland@gnu.org>
Thu, 14 Dec 1995 05:08:02 +0000 (05:08 +0000)
a temp buffer for processing without visiting it.

lisp/emacs-lisp/autoload.el

index 19b524ebb4f3deff361a43243cbfa6200f4b9a68..cccfbedcfe156a46a5ece05e3d782f1d79661d6a 100644 (file)
@@ -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)