1 ;;;_ elinstall.el --- Automatically and flexibly install elisp files
5 ;; Copyright (C) 2010 Tom Breton (Tehom)
7 ;; Author: Tom Breton (Tehom) <tehom@panix.com>
8 ;; Keywords: maint, tools, internal
10 ;; This file is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; This file is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
22 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
28 ;; elinstall Use this for overall loading
30 ;; elinstall-arrange-preload - Use this for non-autogenerated
31 ;; files that need to be linked in.
33 ;; elinstall-update-directory-autoloads
34 ;; elinstall-update-file-autoloads
40 (require 'cus-edit
) ;;Because we save "installedness" manually
47 "Customizations for elinstall"
50 (defcustom elinstall-default-priority
52 "Default priority for site-start"
56 (defcustom elinstall-default-preload-target
57 "~/.emacs.d/site-start.d/"
58 "Default preload-target for registering autoloads"
62 (const "~/.emacs.d/site-start.d/")
63 (const "/etc/emacs/site-start.d/")
69 (defcustom elinstall-already-installed
71 "Things that have already been installed.
72 This exists for recording what has been installed. User interaction is not
73 contemplated at this time." )
75 ;;;_ . elinstall-stages
76 (defstruct (elinstall-stages
77 (:constructor elinstall-make-stages
)
78 (:conc-name elinstall-stages-
>)
80 "The elinstall stages"
86 ;;;_ . Regular expressions
87 ;;;_ , elinstall-elisp-regexp
88 (defconst elinstall-elisp-regexp
91 (suf (get-load-suffixes))
92 (unless (string-match "\\.elc" suf
) (push suf tmp
)))
93 (concat "^[^=.].*" (regexp-opt tmp t
) "\\'"))
94 "Regular expression that matches elisp files" )
97 ;;;_ . elinstall-directory-true-name
98 (defun elinstall-directory-true-name ()
99 "Get the true name of the directory the calling code lives in.
100 CAUTION: This is sensitive to where it's called. That's the point of it."
103 (file-truename load-file-name
)
104 (file-truename buffer-file-name
))))
105 ;;;_ . Checking installedness
106 ;;;_ , elinstall-already-installed
107 (defun elinstall-already-installed (project-name)
108 "Return non-nil if PROJECT-NAME has been installed."
109 (member project-name elinstall-already-installed
))
111 ;;;_ , elinstall-record-installed
112 (defun elinstall-record-installed (project-name)
113 "Record that PROJECT-NAME has been installed."
115 (add-to-list 'elinstall-already-installed project-name
)
116 (customize-save-variable
117 'elinstall-already-installed
118 elinstall-already-installed
119 "Set by elinstall-record-installed"))
123 ;;;_ , Doing autoload actions (adapted from autoload.el)
124 ;;;_ . Utilities about the action list
125 ;;;_ , elinstall-remove-autogen-action
126 (defun elinstall-remove-autogen-action (file actions
)
127 "Return ACTIONS minus any add-file-autoloads on FILE removed."
134 (if (equal file
(third act
))
139 ;;;_ , elinstall-get-autogen-action
140 (defun elinstall-get-autogen-action (file actions
)
144 (dolist (act actions
)
147 (when (equal file
(third act
))
148 (setq the-act act
)))))
150 ;;;_ . elinstall-insert-section-header
151 (defun elinstall-insert-section-header (outbuf form
)
152 "Insert the section-header line,
153 which lists the file name and which functions are in it, etc."
154 (insert generate-autoload-section-header
)
157 ;; Break that line at spaces, to avoid very long lines.
158 ;; Make each sub-line into a comment.
159 (with-current-buffer outbuf
164 (skip-chars-forward "^ \n")
166 (insert "\n" generate-autoload-section-continuation
))))))
168 ;;;_ . Making autoloads
169 ;;;_ , elinstall-generate-file-autoloads
170 ;;override to allow slashed load-paths
171 ;;Quick and dirty: We just adapt `generate-file-autoloads' and add
173 ;;`relative-to' can be:
174 ;; * nil: act as at present. Assume that FILE's immediate directory
176 ;; * t :: use default-directory
177 ;; * a string :: relative to it, as a filename
179 (defun elinstall-generate-file-autoloads (relative-name full-name
)
180 "Insert at point a loaddefs autoload section for FILE.
181 Autoloads are generated for defuns and defmacros in FILE
182 marked by `generate-autoload-cookie' (which see).
183 If FILE is being visited in a buffer, the contents of the buffer
185 Return non-nil in the case where no autoloads were added at point.
187 FULL-NAME is the absolute name of the file.
188 RELATIVE-NAME is its name respective to some component of load-path."
189 (let* ((outbuf (current-buffer))
192 (print-readably t
) ; This does something in Lucid Emacs.
193 (float-output-format nil
)
195 (visited (get-file-buffer full-name
))
198 ;; It is faster to avoid visiting the file.
199 (ignore-errors (autoload-find-file full-name
))))
202 (with-current-buffer source-buf
203 ;;$$MOVE ME - this should be checked in action-finding.
204 ;; Obey the no-update-autoloads file local variable.
205 (unless no-update-autoloads
206 (message "Generating autoloads for %s..." relative-name
)
207 (setq output-start
(with-current-buffer outbuf
(point)))
211 (goto-char (point-min))
213 (skip-chars-forward " \t\n\f")
215 ((looking-at (regexp-quote generate-autoload-cookie
))
216 (search-forward generate-autoload-cookie
)
217 (skip-chars-forward " \t")
220 ;; Read the next form and make an autoload.
221 (let* ((form (prog1 (read (current-buffer))
222 (or (bolp) (forward-line 1))))
224 (make-autoload form relative-name
)))
226 (push (nth 1 form
) autoloads-done
)
227 (setq autoload form
))
228 (let ((autoload-print-form-outbuf outbuf
))
229 (autoload-print-form autoload
)))
231 ;; Copy the rest of the line to the output.
232 (princ (buffer-substring
234 ;; Back up over whitespace, to preserve it.
235 (skip-chars-backward " \f\t")
236 (if (= (char-after (1+ (point))) ?
)
240 (progn (forward-line 1) (point)))
243 ;; Don't read the comment.
247 (forward-line 1))))))
250 (with-current-buffer outbuf
252 ;; Insert the section-header line which lists the file name
253 ;; and which functions are in it, etc.
254 (goto-char output-start
)
255 (elinstall-insert-section-header
260 (autoload-trim-file-name full-name
)
261 (nth 5 (file-attributes full-name
))))
263 (insert ";;; Generated autoloads from "
264 (autoload-trim-file-name full-name
) "\n"))
265 (insert generate-autoload-section-trailer
)))
266 (message "Generating autoloads for %s...done" relative-name
))
269 ;; We created this buffer, so we should kill it.
270 (kill-buffer (current-buffer))))
271 (message "Could not load %s" relative-name
))
276 ;;;_ , elinstall-deffile-insert-autoloads
277 (defun elinstall-deffile-insert-autoloads (file load-name
)
278 "Update the autoloads for FILE in current buffer.
279 Return FILE if there was no autoload cookie in it, else nil.
281 Current buffer must be a loaddef-style file.
283 LOAD-NAME is the absolute name of the file.
284 RELATIVE-NAME is its name respective to some component of load-path."
292 (goto-char (point-min))
293 ;; Look for the section for FILE
294 (while (and (not found
)
295 (search-forward generate-autoload-section-header nil t
))
296 (let ((form (autoload-read-section-header)))
298 ((equal (nth 2 form
) file
)
299 ;; We found the section for this file.
300 (let ((begin (match-beginning 0)))
302 (search-forward generate-autoload-section-trailer
)
303 (delete-region begin
(point))
305 ((string< file
(nth 2 form
))
306 ;; We've come to a section alphabetically later than
307 ;; FILE. We assume the file is in order and so
308 ;; there must be no section for FILE. We will
309 ;; insert one before the section here.
310 (goto-char (match-beginning 0))
311 (setq found
'new
)))))
315 ;; No later sections in the file. Put before the last page.
316 (goto-char (point-max))
317 (search-backward "\f" nil t
)))
319 (elinstall-generate-file-autoloads file load-name
))))
321 (if no-autoloads file nil
)))
322 ;;;_ . Arranging to add to info-path and load-path
323 ;;;_ , elinstall-generate-add-to-path
324 (defun elinstall-generate-add-to-path (path-element type
)
325 "Insert code at point to add PATH-ELEMENT to a path.
327 * `add-to-load-path', add to load-path
328 * `add-to-info-path', add to Info-default-directory-list
330 Current buffer must be a loaddef-style file."
333 (add-to-load-path 'load-path
)
334 (add-to-info-path 'Info-default-directory-list
)
335 (t (error "Type not recognized"))))
338 (add-to-load-path "load-path")
339 (add-to-info-path "info-path")))
342 (print-readably t
) ; This does something in Lucid Emacs.
343 (float-output-format nil
))
345 (message "Generating %s additions..." description
)
348 (elinstall-insert-section-header
350 (list type
(list path-element
) nil nil nil
))
352 (insert ";;; Generated path addition\n")
354 `(add-to-list ',path-symbol
356 ,(file-relative-name path-element
)
359 (file-truename load-file-name
)))))
362 (insert generate-autoload-section-trailer
)
363 (message "Generating %s additions...done" description
)))
366 ;;;_ , elinstall-deffile-insert-add-to-path
367 (defun elinstall-deffile-insert-add-to-path (path-element type
)
368 "Insert code in current buffer to add PATH-ELEMENT to a path.
370 * `add-to-load-path', add to load-path
371 * `add-to-info-path', add to Info-default-directory-list
373 Current buffer must be a loaddef-style file."
381 (goto-char (point-min))
382 ;; Look for the section for PATH-ELEMENT
383 (while (and (not found
)
384 (search-forward generate-autoload-section-header nil t
))
385 (let ((form (autoload-read-section-header)))
388 (equal (nth 0 form
) type
)
389 (member (nth 1 form
) path-element
))
391 ;; We found the section for this add.
392 (let ((begin (match-beginning 0)))
394 (search-forward generate-autoload-section-trailer
)
395 (delete-region begin
(point))
401 ;; No later sections in the file. Put before the last page.
402 (goto-char (point-max))
403 (search-backward "\f" nil t
)))
405 (elinstall-generate-add-to-path path-element type
)))
407 ;;This never belongs in the no-autoloads section.
409 ;;;_ . elinstall-deffile-insert
411 (defun elinstall-deffile-insert (action)
412 "Insert autoloads etc into current file according to ACTION.
413 The format of ACTION is described in the design docs.
415 Return filename if this action belongs in the no-autoload section."
420 (elinstall-deffile-insert-autoloads
425 (elinstall-deffile-insert-add-to-path
431 (elinstall-deffile-insert-add-to-path
436 ((preload-file run-tests byte-compile
)
437 (error "This case should not come here.")))))
439 ;;;_ . elinstall-prepare-deffile
440 (defun elinstall-prepare-deffile (deffile)
441 "Try to ensure that DEFFILE is available for receiving autoloads"
443 (autoload-ensure-default-file deffile
)
444 (with-current-buffer (find-file-noselect deffile
)
447 ;; We must read/write the file without any code conversion,
448 ;; but still decode EOLs.
449 (let ((coding-system-for-read 'raw-text
))
451 ;; This is to make generated-autoload-file have Unix EOLs, so
452 ;; that it is portable to all platforms.
453 (setq buffer-file-coding-system
'raw-text-unix
))
454 (or (> (buffer-size) 0)
455 (error "Autoloads file %s does not exist" buffer-file-name
))
456 (or (file-writable-p buffer-file-name
)
457 (error "Autoloads file %s is not writable"
460 ;;;_ . elinstall-update-deffile
462 ;;Adapted from autoload.el `update-directory-autoloads'.
464 (defun elinstall-update-deffile (target actions
&optional
467 Update file TARGET with current autoloads as specified by ACTIONS.
468 Also remove any old definitions pointing to libraries that can no
471 ACTIONS must be a list of actions (See the format doc). Each one's
472 filename must be relative to some element of load-path.
474 USE-LOAD-PATH is a list to use as load-path. It should include
475 any new load-path that we are arranging to create. If it's not given,
476 load-path itself is used.
478 If FORCE is `t', do it regardless of timestamps etc. (Not implemented)
479 Other non-nil cases of FORCE are reserved for future development.
481 This uses `update-file-autoloads' (which see) to do its work.
482 In an interactive call, you must give one argument, the name
483 of a single directory."
486 (use-load-path (or use-load-path load-path
))
487 (this-time (current-time))
488 ;;files with no autoload cookies.
491 (elinstall-prepare-deffile target
)
493 (find-file-noselect target
)
496 (elinstall-remove-autogen-action
497 (autoload-trim-file-name target
)
500 (goto-char (point-min))
501 (while (search-forward generate-autoload-section-header nil t
)
502 (let* ((form (autoload-read-section-header))
504 (cond ((and (consp file
) (stringp (car file
)))
505 ;; This is a list of files that have no
507 ;; There shouldn't be more than one such entry.
508 ;; Remove the obsolete section.
509 (autoload-remove-section (match-beginning 0))
510 (let ((last-time (nth 4 form
)))
512 (let ((file-time (nth 5 (file-attributes file
))))
514 (not (time-less-p last-time file-time
)))
516 (push file no-autoloads
)
518 (elinstall-remove-autogen-action
520 ((not (stringp file
)))
524 (locate-library file nil use-load-path
)))
526 ;;File doesn't exist, so remove its
529 (autoload-remove-section
530 (match-beginning 0)))
532 ;; File hasn't changed, so do nothing.
535 (nth 5 (file-attributes file-path
)))
538 (elinstall-deffile-insert
539 (elinstall-get-autogen-action
543 (elinstall-remove-autogen-action
546 ;; Remaining actions have no existing autoload sections yet.
549 (delq nil
(mapcar #'elinstall-deffile-insert actions
))))
551 ;; Sort them for better readability.
552 (setq no-autoloads
(sort no-autoloads
'string
<))
553 ;; Add the `no-autoloads' section.
554 (goto-char (point-max))
555 (search-backward "\f" nil t
)
557 (elinstall-insert-section-header
559 (list 'autoloads nil nil no-autoloads this-time
))
560 (insert generate-autoload-section-trailer
))
563 ;;;_ . elinstall-stage-update-deffiles
564 (defun elinstall-stage-update-deffiles (segment-list force use-load-path
)
565 "Update any deffiles mentioned in SEGMENT-LIST.
566 FORCE and USE-LOAD-PATH have the same meaning as in
567 `elinstall-update-deffile'.
572 ((deffile (car segment
)))
573 (if (stringp deffile
)
574 (elinstall-update-deffile deffile
(cdr segment
) force
578 ;;;_ , Doing actions to arrange preloads
579 ;;;_ . elinstall-symlink-on-emacs-start
580 (defun elinstall-symlink-on-emacs-start
581 (filename target-basename target-dir
&optional priority force
)
582 "Symlink to TARGET-BASENAME.el in TARGET-DIR
584 If PRIORITY is given, it will be used as the priority prefix,
585 otherwise elinstall-default-priority will be.
586 PRIORITY must be an integer or nil.
587 If FORCE is `t', do it regardless of timestamps etc.
588 Other non-nil cases of FORCE are reserved for future development."
591 (priority (or priority elinstall-default-priority
))
598 (expand-file-name target-name-nodir target-dir
)))
602 ;;Path should already exist.
604 (file-exists-p target-dir
))
605 (message "The target directory doesn't exist."))
606 ;;Target shouldn't already exist, but if force is given, let
608 ;;$$IMPROVE ME If it is a symlink pointing to the same place,
609 ;;do nothing even on force.
611 (file-exists-p target
)
616 (format "Really overwrite %s? " target
))))
617 (message "File %s already exists" target
)))
625 ;;;_ . elinstall-add-to-dot-emacs
626 (defun elinstall-add-to-dot-emacs (dot-emacs-name filename force
&rest r
)
627 "Add code to load FILENAME to .emacs.
628 FILENAME should not have an extension"
631 (with-current-buffer (find-file-noselect dot-emacs-name
)
634 (goto-char (point-max))
635 (insert "\n;;Added by elinstall")
636 (insert "\n;;Consider using my-site-start to manage .emacs\n")
637 (pp `(load ,filename
) (current-buffer))
641 ;;;_ . elinstall-arrange-preload
643 (defun elinstall-arrange-preload (force filename basename
&optional priority
)
644 "Arrange for FILENAME to be loaded on emacs start.
645 FORCE has its usual meaning.
646 BASENAME and PRIORITY are used as arguments to
647 `elinstall-symlink-on-emacs-start'.
651 ((preload-target elinstall-default-preload-target
))
653 ;;Dispatch the possibilities.
655 ((eq preload-target
'dot-emacs
)
656 (elinstall-add-to-dot-emacs "~/.emacs" filename
))
657 ((stringp preload-target
)
658 (elinstall-symlink-on-emacs-start
659 filename basename preload-target priority force
))
661 (message "Not arranging for preloads"))
663 (message "I don't recognize that")))))
664 ;;;_ . elinstall-stage-arrange-preloads
665 (defun elinstall-stage-arrange-preloads (actions deffiles-used
)
666 "Arrange any preloads mentioned in ACTIONS."
680 (member filename deffiles-used
)))))
684 #'elinstall-arrange-preload
689 "elinstall-stage-arrange-preloads: Action not
695 ;;;_ . elinstall-stage-run-tests
696 (defun elinstall-stage-run-tests (actions)
697 "Run any tests mentioned in ACTIONS."
703 ;;$$WRITE ME - not a high priority right now.
707 "elinstall-stage-run-tests: Action not
713 ;;;_ . elinstall-stage-byte-compile
714 (defun elinstall-stage-byte-compile (actions)
715 "Do any byte-compilation mentioned in ACTIONS."
720 ;;$$IMPROVE ME Understand flags to control second
721 ;;argument (whether to load file after
724 (byte-compile-file (second act
)))
727 "elinstall-stage-byte-compile: Action not
731 ;;;_ . Segregating actions
732 ;;;_ , elinstall-remove-empty-segs
733 (defun elinstall-remove-empty-segs (segment-list)
734 "Return SEGMENT-LIST minus any segments that have no actions.
735 Intended only for the deffile stage data."
744 ;;;_ , elinstall-segregate-actions
745 (defun elinstall-segregate-actions (actions)
746 "Return actions segregated by deffile.
748 Returns a list whose elements are each a cons of:
749 * deffile filename or nil
750 * A list of actions to be done for that deffile."
757 (arrange-preloads '()))
759 (dolist (act actions
)
766 ((deffile-name (second act
))
768 (assoc deffile-name build-deffiles
)))
770 ;;There are already actions on this deffile.
771 ;;Splice this action in.
773 (cons act
(cdr cell-already
)))
774 ;;There are no actions on this deffile. Add a
775 ;;place for them and include this action.
776 (push (list deffile-name act
) build-deffiles
))))
778 (push act arrange-preloads
))
780 (push act run-tests
))
782 (push act byte-compile
)))))
784 (elinstall-make-stages
786 (elinstall-remove-empty-segs build-deffiles
)
798 ;;;_ . Finding actions
799 ;;;_ , Treating the parameter list
800 ;;;_ . elinstall-add-parameter
801 (defun elinstall-add-parameter (alist key new-value
)
802 "Add a new value for KEY to ALIST"
806 (assq-delete-all key
(copy-list alist
))))
808 ;;;_ . elinstall-get-parameter
809 (defun elinstall-get-parameter (alist key
)
810 "Get the value of KEY from ALIST"
812 (cdr (assq key alist
)))
813 ;;;_ . elinstall-expand-file-name
816 (defun elinstall-expand-file-name (filename alist
)
817 "Expand FILENAME by the value of `path' in ALIST"
820 (elinstall-get-parameter alist
'path
)))
821 ;;;_ , Finding deffiles
822 ;;;_ . elinstall-expand-deffile-name
823 (defun elinstall-expand-deffile-name (deffile)
824 "Expand DEFFILE autoload.el's way."
826 (expand-file-name (or deffile
"loaddefs.el")
827 (expand-file-name "lisp"
830 ;;;_ . elinstall-maybe-get-deffile
831 (defun elinstall-maybe-get-deffile (file)
832 "If FILE defined `generated-autoload-file', return it.
833 Otherwise return nil.
834 Return it as an absolute filename."
837 ;;$$FIXME load buffer if it's not already loaded
839 ((existing-buffer (get-file-buffer file
)))
841 ;; We want to get a value for generated-autoload-file from
842 ;; the local variables section if it's there.
843 ;;But if it's not loaded, we don't? Maybe should use
844 ;; `autoload-find-file' and load it.
846 (set-buffer existing-buffer
))
847 (if (local-variable-p 'generated-autoload-file
)
848 (elinstall-expand-deffile-name
849 generated-autoload-file
)
854 ;;;_ . elinstall-find-actions-for-file
855 (defun elinstall-find-actions-for-file
856 (filename load-path-element dir parameters
)
857 "Return a list of actions to do for FILENAME.
858 LOAD-PATH-ELEMENT, DIR, and PARAMETERS are interpreted as in
859 `elinstall-find-actions-by-spec' "
863 (expand-file-name filename dir
)))
866 ,(elinstall-get-parameter
867 parameters
'def-file
)
868 ;;load-name relative to a member of load-path
869 ,(file-name-sans-extension
873 ,load-path-element
;;Is this still used?
876 ;;;_ . elinstall-find-actions-by-spec
878 (defun elinstall-find-actions-by-spec (spec load-path-element path parameters
)
879 "Return a list of actions to do, controlled by SPEC and PARAMETERS.
881 LOAD-PATH-ELEMENT is the conceptual element of load-path that
882 surrounds DIR. It may not yet have been added to load-path."
884 ;;$$IMPROVE ME by adding the other cases in the design.
893 (elinstall-find-actions-by-spec
903 (elinstall-find-actions-by-spec
911 (elinstall-find-actions-for-file
912 filename load-path-element dir parameters
))
922 (elinstall-get-parameter
923 parameters
'block-add-to-load-path
)))
931 ;;Do this only if there are loadable files.
934 ,(elinstall-get-parameter
935 parameters
'def-file
)
939 ;;Do add-to-info-path too. But test if there are
940 ;;any info files present.
943 ;; We want to get a value for generated-autoload-file
944 ;; from the local variables section if it's there.
945 ;;Use `elinstall-maybe-get-deffile'
946 ;; Otherwise we'll use `def-file' in parameters.
948 ;;$$FIXME This isn't quite right. If directory
949 ;;itself is not in load-path, this will be wrong.
950 ;;Gotta know where our encompassing part of
953 ;;$$ENCAP ME This should be shared with the
954 ;;treatment of (file FN)
956 ;;$$FIXME Don't do directories, but maybe recurse on
957 ;;them, if a flag is set. And since we definitely
958 ;;have a load-path element here,
959 ;;'block-add-to-load-path according to a parameter.
960 ;;Maybe could follow/not symlinks similarly.
964 (elinstall-find-actions-for-file
972 nil
;;Relative filenames
973 elinstall-elisp-regexp
))))))
981 (for-preload (third spec
)))
982 (assert (listp for-preload
))
986 (and for-preload
(car for-preload
))
993 (elinstall-find-actions-by-spec
997 (elinstall-add-parameter parameters
998 'def-file new-def-file
))))))
1000 ;;$$IMPROVE ME by adding the other cases in the design.
1003 ;;;_ . high-level work
1004 ;;;_ , elinstall-get-relevant-load-path
1005 (defun elinstall-get-relevant-load-path (actions)
1015 ;;;_ , elinstall-get-deffile-list
1016 (defun elinstall-get-deffile-list (stages)
1017 "Get a list of deffile names"
1021 (elinstall-stages->build-deffiles stages
)))
1024 (defun elinstall-x (dir spec
&optional force
)
1028 ;;This is just the default deffile, spec can override it.
1030 (elinstall-expand-deffile-name nil
))
1032 (elinstall-find-actions-by-spec
1037 (def-file .
,def-file
))))
1038 (stages (elinstall-segregate-actions actions
))
1040 (elinstall-get-relevant-load-path
1043 (elinstall-stage-update-deffiles
1044 (elinstall-stages->build-deffiles stages
)
1047 (elinstall-stage-arrange-preloads
1048 (elinstall-stages->arrange-preloads stages
)
1049 (elinstall-get-deffile-list stages
))
1055 (defun elinstall (project-name path spec
&optional force
)
1056 "Install elisp files.
1057 They need not be a formal package.
1061 PROJECT-NAME - the name of the project
1063 PATH - Path to the project.
1064 Suggestion: (elinstall-directory-true-name)
1066 SPEC - a spec for the autoloads etc to make. It can be as simple as
1067 \(dir \"\.\") for installing one directory.
1069 If FORCE is t, install a package even if it has already been
1070 installed. Other non-nil cases of FORCE are reserved for future
1077 (not (elinstall-already-installed project-name
)))
1078 (yes-or-no-p (format "Re-install %s? " project-name
)))
1081 `(def-file "loaddefs.el" (if-used ,project-name
) ,spec
)
1083 (elinstall-record-installed project-name
)))
1087 ;;;_ , elinstall-update-directory-autoloads
1090 (defun elinstall-update-directory-autoloads (dir)
1093 (interactive "DInstall all elisp files from directory: ")
1098 (elinstall-expand-deffile-name
1099 generated-autoload-file
)))
1103 `(def-file ,def-file-name
(nil) (dir ".")))))
1107 ;;;_ , elinstall-update-file-autoloads
1110 (defun elinstall-update-file-autoloads (file)
1113 (interactive "fInstall elisp file: ")
1117 (elinstall-maybe-get-deffile file
)
1118 (elinstall-expand-deffile-name
1119 generated-autoload-file
))))
1122 `(def-file ,def-file-name
(nil) (file ,file
)))))
1127 (provide 'elinstall
)
1129 ;;;_ * Local emacs vars.
1130 ;;;_ + Local variables:
1135 ;;; elinstall.el ends here