emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113495: * lisp/emacs-lisp/autoload.el (autoload--se


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r113495: * lisp/emacs-lisp/autoload.el (autoload--setup-output): New function,
Date: Mon, 22 Jul 2013 23:21:19 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113495
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Mon 2013-07-22 19:21:14 -0400
message:
  * lisp/emacs-lisp/autoload.el (autoload--setup-output): New function,
  extracted from autoload--insert-text.
  (autoload--insert-text): Remove.
  (autoload--print-cookie-text): New function, extracted from
  autoload--insert-cookie-text.
  (autoload--insert-cookie-text): Remove.
  (autoload-generate-file-autoloads): Adjust calls accordingly.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/emacs-lisp/autoload.el    autoload.el-20091113204419-o5vbwnq5f7feedwu-397
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-07-22 22:51:29 +0000
+++ b/lisp/ChangeLog    2013-07-22 23:21:14 +0000
@@ -1,5 +1,13 @@
 2013-07-22  Stefan Monnier  <address@hidden>
 
+       * emacs-lisp/autoload.el (autoload--setup-output): New function,
+       extracted from autoload--insert-text.
+       (autoload--insert-text): Remove.
+       (autoload--print-cookie-text): New function, extracted from
+       autoload--insert-cookie-text.
+       (autoload--insert-cookie-text): Remove.
+       (autoload-generate-file-autoloads): Adjust calls accordingly.
+
        * winner.el (winner-hook-installed-p): Remove.
        (winner-mode): Simplify accordingly.
 

=== modified file 'lisp/emacs-lisp/autoload.el'
--- a/lisp/emacs-lisp/autoload.el       2013-06-15 15:36:11 +0000
+++ b/lisp/emacs-lisp/autoload.el       2013-07-22 23:21:14 +0000
@@ -436,33 +436,26 @@
 
 (defvar print-readably)
 
-(defun autoload--insert-text (output-start otherbuf outbuf absfile
-                                           load-name printfun)
-  ;; If not done yet, figure out where to insert this text.
-  (unless (marker-buffer output-start)
-    (let ((outbuf
-           (or (if otherbuf
-                   ;; A file-local setting of
-                   ;; autoload-generated-file says we
-                   ;; should ignore OUTBUF.
-                   nil
-                 outbuf)
-               (autoload-find-destination absfile load-name)
-               ;; The file has autoload cookies, but they're
-               ;; already up-to-date. If OUTFILE is nil, the
-               ;; entries are in the expected OUTBUF,
-               ;; otherwise they're elsewhere.
-               (throw 'done otherbuf))))
-      (with-current-buffer outbuf
-        (move-marker output-start (point) outbuf))))
+
+(defun autoload--setup-output (otherbuf outbuf absfile load-name)
+  (let ((outbuf
+         (or (if otherbuf
+                 ;; A file-local setting of
+                 ;; autoload-generated-file says we
+                 ;; should ignore OUTBUF.
+                 nil
+               outbuf)
+             (autoload-find-destination absfile load-name)
+             ;; The file has autoload cookies, but they're
+             ;; already up-to-date. If OUTFILE is nil, the
+             ;; entries are in the expected OUTBUF,
+             ;; otherwise they're elsewhere.
+             (throw 'done otherbuf))))
+    (with-current-buffer outbuf
+      (point-marker))))
+
+(defun autoload--print-cookie-text (output-start load-name file)
   (let ((standard-output (marker-buffer output-start)))
-    (funcall printfun)))
-
-(defun autoload--insert-cookie-text (output-start otherbuf outbuf absfile
-                                                  load-name file)
-  (autoload--insert-text
-   output-start otherbuf outbuf absfile load-name
-   (lambda ()
      (search-forward generate-autoload-cookie)
      (skip-chars-forward " \t")
      (if (eolp)
@@ -490,7 +483,7 @@
                      ;; Eat one space.
                      (forward-char 1))
                  (point))
-               (progn (forward-line 1) (point))))))))
+              (progn (forward-line 1) (point)))))))
 
 (defvar autoload-builtin-package-versions nil)
 
@@ -553,23 +546,25 @@
                        (setq package (or (lm-header "package")
                                          (file-name-sans-extension
                                           (file-name-nondirectory file))))
-                       (setq output-start (make-marker))
-                       (autoload--insert-text
-                        output-start otherbuf outbuf absfile load-name
-                        (lambda ()
+                       (setq output-start (autoload--setup-output
+                                           otherbuf outbuf absfile load-name))
+                       (let ((standard-output (marker-buffer output-start))
+                             (print-quoted t))
                           (princ `(push (purecopy
                                              ',(cons (intern package) version))
                                         package--builtin-versions))
-                          (newline))))))
+                         (newline)))))
 
               (goto-char (point-min))
               (while (not (eobp))
                 (skip-chars-forward " \t\n\f")
                 (cond
                  ((looking-at (regexp-quote generate-autoload-cookie))
-                  (unless output-start (setq output-start (make-marker)))
-                  (autoload--insert-cookie-text
-                   output-start otherbuf outbuf absfile load-name file))
+                  ;; If not done yet, figure out where to insert this text.
+                  (unless output-start
+                    (setq output-start (autoload--setup-output
+                                        otherbuf outbuf absfile load-name)))
+                  (autoload--print-cookie-text output-start load-name file))
                  ((looking-at ";")
                   ;; Don't read the comment.
                   (forward-line 1))


reply via email to

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