From 026597805b81568606a5aca78b9aab05fcd3c422 Mon Sep 17 00:00:00 2001 From: "Tom Breton (Tehom)" Date: Thu, 11 Nov 2010 23:54:03 -0500 Subject: [PATCH] New function elinstall-insert-section-header, replacing autoload-insert-section-header --- elinstall.el | 45 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/elinstall.el b/elinstall.el index 168da6d..9454e08 100644 --- a/elinstall.el +++ b/elinstall.el @@ -147,6 +147,23 @@ CAUTION: This is sensitive to where it's called. That's the point of it." (when (equal file (third act)) (setq the-act act))))) the-act)) +;;;_ . elinstall-insert-section-header +(defun elinstall-insert-section-header (outbuf form) + "Insert the section-header line, +which lists the file name and which functions are in it, etc." + (insert generate-autoload-section-header) + (prin1 form outbuf) + (terpri outbuf) + ;; Break that line at spaces, to avoid very long lines. + ;; Make each sub-line into a comment. + (with-current-buffer outbuf + (save-excursion + (forward-line -1) + (while (not (eolp)) + (move-to-column 64) + (skip-chars-forward "^ \n") + (or (eolp) + (insert "\n" generate-autoload-section-continuation)))))) ;;;_ . Making autoloads ;;;_ , elinstall-generate-file-autoloads @@ -235,9 +252,14 @@ RELATIVE-NAME is its name respective to some component of load-path." ;; Insert the section-header line which lists the file name ;; and which functions are in it, etc. (goto-char output-start) - (autoload-insert-section-header - outbuf autoloads-done relative-name full-name - (nth 5 (file-attributes full-name))) + (elinstall-insert-section-header + outbuf + (list 'autoloads + autoloads-done + relative-name + (autoload-trim-file-name full-name) + (nth 5 (file-attributes full-name)))) + (insert ";;; Generated autoloads from " (autoload-trim-file-name full-name) "\n")) (insert generate-autoload-section-trailer))) @@ -309,7 +331,8 @@ Current buffer must be a loaddef-style file." (let ( (path-symbol (case type (add-to-load-path 'load-path) - (add-to-info-path 'Info-default-directory-list))) + (add-to-info-path 'Info-default-directory-list) + (t (error "Type not recognized")))) (description (case type (add-to-load-path "load-path") @@ -320,10 +343,12 @@ Current buffer must be a loaddef-style file." (float-output-format nil)) (message "Generating %s additions..." description) + + + (elinstall-insert-section-header + (current-buffer) + (list type (list path-element) nil nil nil)) - (autoload-insert-section-header - (current-buffer) (list path-element) nil nil - nil) (insert ";;; Generated path addition\n") (pp `(add-to-list ',path-symbol @@ -528,8 +553,10 @@ of a single directory." ;; Add the `no-autoloads' section. (goto-char (point-max)) (search-backward "\f" nil t) - (autoload-insert-section-header - (current-buffer) nil nil no-autoloads this-time) + + (elinstall-insert-section-header + (current-buffer) + (list 'autoloads nil nil no-autoloads this-time)) (insert generate-autoload-section-trailer)) (save-buffer)))) -- 2.11.4.GIT