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
)))))
151 ;;;_ . Making autoloads
152 ;;;_ , elinstall-generate-file-autoloads
153 ;;override to allow slashed load-paths
154 ;;Quick and dirty: We just adapt `generate-file-autoloads' and add
156 ;;`relative-to' can be:
157 ;; * nil: act as at present. Assume that FILE's immediate directory
159 ;; * t :: use default-directory
160 ;; * a string :: relative to it, as a filename
162 (defun elinstall-generate-file-autoloads (relative-name full-name
)
163 "Insert at point a loaddefs autoload section for FILE.
164 Autoloads are generated for defuns and defmacros in FILE
165 marked by `generate-autoload-cookie' (which see).
166 If FILE is being visited in a buffer, the contents of the buffer
168 Return non-nil in the case where no autoloads were added at point.
170 FULL-NAME is the absolute name of the file.
171 RELATIVE-NAME is its name respective to some component of load-path."
172 (let* ((outbuf (current-buffer))
175 (print-readably t
) ; This does something in Lucid Emacs.
176 (float-output-format nil
)
178 (visited (get-file-buffer full-name
))
181 ;; It is faster to avoid visiting the file.
182 (ignore-errors (autoload-find-file full-name
))))
185 (with-current-buffer source-buf
186 ;;$$MOVE ME - this should be checked in action-finding.
187 ;; Obey the no-update-autoloads file local variable.
188 (unless no-update-autoloads
189 (message "Generating autoloads for %s..." relative-name
)
190 (setq output-start
(with-current-buffer outbuf
(point)))
194 (goto-char (point-min))
196 (skip-chars-forward " \t\n\f")
198 ((looking-at (regexp-quote generate-autoload-cookie
))
199 (search-forward generate-autoload-cookie
)
200 (skip-chars-forward " \t")
203 ;; Read the next form and make an autoload.
204 (let* ((form (prog1 (read (current-buffer))
205 (or (bolp) (forward-line 1))))
207 (make-autoload form relative-name
)))
209 (push (nth 1 form
) autoloads-done
)
210 (setq autoload form
))
211 (let ((autoload-print-form-outbuf outbuf
))
212 (autoload-print-form autoload
)))
214 ;; Copy the rest of the line to the output.
215 (princ (buffer-substring
217 ;; Back up over whitespace, to preserve it.
218 (skip-chars-backward " \f\t")
219 (if (= (char-after (1+ (point))) ?
)
223 (progn (forward-line 1) (point)))
226 ;; Don't read the comment.
230 (forward-line 1))))))
233 (with-current-buffer outbuf
235 ;; Insert the section-header line which lists the file name
236 ;; and which functions are in it, etc.
237 (goto-char output-start
)
238 (autoload-insert-section-header
239 outbuf autoloads-done relative-name full-name
240 (nth 5 (file-attributes full-name
)))
241 (insert ";;; Generated autoloads from "
242 (autoload-trim-file-name full-name
) "\n"))
243 (insert generate-autoload-section-trailer
)))
244 (message "Generating autoloads for %s...done" relative-name
))
247 ;; We created this buffer, so we should kill it.
248 (kill-buffer (current-buffer))))
249 (message "Could not load %s" relative-name
))
254 ;;;_ , elinstall-deffile-insert-autoloads
255 (defun elinstall-deffile-insert-autoloads (file load-name
)
256 "Update the autoloads for FILE in current buffer.
257 Return FILE if there was no autoload cookie in it, else nil.
259 Current buffer must be a loaddef-style file.
261 LOAD-NAME is the absolute name of the file.
262 RELATIVE-NAME is its name respective to some component of load-path."
270 (goto-char (point-min))
271 ;; Look for the section for FILE
272 (while (and (not found
)
273 (search-forward generate-autoload-section-header nil t
))
274 (let ((form (autoload-read-section-header)))
276 ((equal (nth 2 form
) file
)
277 ;; We found the section for this file.
278 (let ((begin (match-beginning 0)))
280 (search-forward generate-autoload-section-trailer
)
281 (delete-region begin
(point))
283 ((string< file
(nth 2 form
))
284 ;; We've come to a section alphabetically later than
285 ;; FILE. We assume the file is in order and so
286 ;; there must be no section for FILE. We will
287 ;; insert one before the section here.
288 (goto-char (match-beginning 0))
289 (setq found
'new
)))))
293 ;; No later sections in the file. Put before the last page.
294 (goto-char (point-max))
295 (search-backward "\f" nil t
)))
297 (elinstall-generate-file-autoloads file load-name
))))
299 (if no-autoloads file nil
)))
300 ;;;_ . Arranging to add to info-path and load-path
301 ;;;_ , elinstall-generate-add-to-path
302 (defun elinstall-generate-add-to-path (path-element type
)
303 "Insert code at point to add PATH-ELEMENT to a path.
305 * `add-to-load-path', add to load-path
306 * `add-to-info-path', add to Info-default-directory-list
308 Current buffer must be a loaddef-style file."
311 (add-to-load-path 'load-path
)
312 (add-to-info-path 'Info-default-directory-list
)))
315 (add-to-load-path "load-path")
316 (add-to-info-path "info-path")))
319 (print-readably t
) ; This does something in Lucid Emacs.
320 (float-output-format nil
))
322 (message "Generating %s additions..." description
)
324 (autoload-insert-section-header
325 (current-buffer) (list path-element
) nil nil
327 (insert ";;; Generated path addition\n")
329 `(add-to-list ',path-symbol
331 ,(file-relative-name path-element
)
334 (file-truename load-file-name
)))))
337 (insert generate-autoload-section-trailer
)
338 (message "Generating %s additions...done" description
)))
341 ;;;_ , elinstall-deffile-insert-add-to-path
342 (defun elinstall-deffile-insert-add-to-path (path-element type
)
343 "Insert code in current buffer to add PATH-ELEMENT to a path.
345 * `add-to-load-path', add to load-path
346 * `add-to-info-path', add to Info-default-directory-list
348 Current buffer must be a loaddef-style file."
356 (goto-char (point-min))
357 ;; Look for the section for PATH-ELEMENT
358 (while (and (not found
)
359 (search-forward generate-autoload-section-header nil t
))
360 (let ((form (autoload-read-section-header)))
363 (equal (nth 0 form
) type
)
364 (member (nth 1 form
) path-element
))
366 ;; We found the section for this add.
367 (let ((begin (match-beginning 0)))
369 (search-forward generate-autoload-section-trailer
)
370 (delete-region begin
(point))
376 ;; No later sections in the file. Put before the last page.
377 (goto-char (point-max))
378 (search-backward "\f" nil t
)))
380 (elinstall-generate-add-to-path path-element type
)))
382 ;;This never belongs in the no-autoloads section.
385 ;;;_ . elinstall-deffile-insert
387 (defun elinstall-deffile-insert (action)
388 "Insert autoloads etc into current file according to ACTION.
389 The format of ACTION is described in the design docs.
391 Return filename if this action belongs in the no-autoload section."
396 (elinstall-deffile-insert-autoloads
401 (elinstall-deffile-insert-add-to-path
407 (elinstall-deffile-insert-add-to-path
412 ((preload-file run-tests byte-compile
)
413 (error "This case should not come here.")))))
415 ;;;_ . elinstall-prepare-deffile
416 (defun elinstall-prepare-deffile (deffile)
417 "Try to ensure that DEFFILE is available for receiving autoloads"
419 (autoload-ensure-default-file deffile
)
420 (with-current-buffer (find-file-noselect deffile
)
423 ;; We must read/write the file without any code conversion,
424 ;; but still decode EOLs.
425 (let ((coding-system-for-read 'raw-text
))
427 ;; This is to make generated-autoload-file have Unix EOLs, so
428 ;; that it is portable to all platforms.
429 (setq buffer-file-coding-system
'raw-text-unix
))
430 (or (> (buffer-size) 0)
431 (error "Autoloads file %s does not exist" buffer-file-name
))
432 (or (file-writable-p buffer-file-name
)
433 (error "Autoloads file %s is not writable"
436 ;;;_ . elinstall-update-deffile
438 ;;Adapted from autoload.el `update-directory-autoloads'.
440 (defun elinstall-update-deffile (target actions
&optional
443 Update file TARGET with current autoloads as specified by ACTIONS.
444 Also remove any old definitions pointing to libraries that can no
447 ACTIONS must be a list of actions (See the format doc). Each one's
448 filename must be relative to some element of load-path.
450 USE-LOAD-PATH is a list to use as load-path. It should include
451 any new load-path that we are arranging to create. If it's not given,
452 load-path itself is used.
454 If FORCE is `t', do it regardless of timestamps etc. (Not implemented)
455 Other non-nil cases of FORCE are reserved for future development.
457 This uses `update-file-autoloads' (which see) to do its work.
458 In an interactive call, you must give one argument, the name
459 of a single directory."
462 (use-load-path (or use-load-path load-path
))
463 (this-time (current-time))
464 ;;files with no autoload cookies.
467 (elinstall-prepare-deffile target
)
469 (find-file-noselect target
)
472 (elinstall-remove-autogen-action
473 (autoload-trim-file-name target
)
476 (goto-char (point-min))
477 (while (search-forward generate-autoload-section-header nil t
)
478 (let* ((form (autoload-read-section-header))
480 (cond ((and (consp file
) (stringp (car file
)))
481 ;; This is a list of files that have no
483 ;; There shouldn't be more than one such entry.
484 ;; Remove the obsolete section.
485 (autoload-remove-section (match-beginning 0))
486 (let ((last-time (nth 4 form
)))
488 (let ((file-time (nth 5 (file-attributes file
))))
490 (not (time-less-p last-time file-time
)))
492 (push file no-autoloads
)
494 (elinstall-remove-autogen-action
496 ((not (stringp file
)))
500 (locate-library file nil use-load-path
)))
502 ;;File doesn't exist, so remove its
505 (autoload-remove-section
506 (match-beginning 0)))
508 ;; File hasn't changed, so do nothing.
511 (nth 5 (file-attributes file-path
)))
514 (elinstall-deffile-insert
515 (elinstall-get-autogen-action
519 (elinstall-remove-autogen-action
522 ;; Remaining actions have no existing autoload sections yet.
525 (delq nil
(mapcar #'elinstall-deffile-insert actions
))))
527 ;; Sort them for better readability.
528 (setq no-autoloads
(sort no-autoloads
'string
<))
529 ;; Add the `no-autoloads' section.
530 (goto-char (point-max))
531 (search-backward "\f" nil t
)
532 (autoload-insert-section-header
533 (current-buffer) nil nil no-autoloads this-time
)
534 (insert generate-autoload-section-trailer
))
537 ;;;_ . elinstall-stage-update-deffiles
538 (defun elinstall-stage-update-deffiles (segment-list force use-load-path
)
539 "Update any deffiles mentioned in SEGMENT-LIST.
540 FORCE and USE-LOAD-PATH have the same meaning as in
541 `elinstall-update-deffile'.
546 ((deffile (car segment
)))
547 (if (stringp deffile
)
548 (elinstall-update-deffile deffile
(cdr segment
) force
552 ;;;_ , Doing actions to arrange preloads
553 ;;;_ . elinstall-insert-add-to-path
554 (defun elinstall-insert-add-to-path (new path-sym
)
555 "Insert code to add NEW to PATH-SYM.
556 Insert this at point in current buffer."
559 `(add-to-list ',path-sym
560 (expand-file-name ,new
563 (file-truename load-file-name
)))))
566 ;;;_ . elinstall-insert-add-to-load-path
567 (defun elinstall-insert-add-to-load-path (new)
568 "Insert code to add NEW to load-path.
569 Insert this at point in current buffer."
570 (elinstall-insert-add-to-path new
'load-path
))
572 ;;;_ . elinstall-insert-add-to-info-path
573 (defun elinstall-insert-add-to-info-path (new)
574 "Insert code to add NEW to info-path.
575 Insert this at point in current buffer."
576 (elinstall-insert-add-to-path new
'Info-default-directory-list
))
578 ;;;_ . elinstall-symlink-on-emacs-start
579 (defun elinstall-symlink-on-emacs-start
580 (filename target-basename target-dir
&optional priority force
)
581 "Symlink to TARGET-BASENAME.el in TARGET-DIR
583 If PRIORITY is given, it will be used as the priority prefix,
584 otherwise elinstall-default-priority will be.
585 PRIORITY must be an integer or nil.
586 If FORCE is `t', do it regardless of timestamps etc.
587 Other non-nil cases of FORCE are reserved for future development."
590 (priority (or priority elinstall-default-priority
))
597 (expand-file-name target-name-nodir target-dir
)))
601 ;;Path should already exist.
603 (file-exists-p target-dir
))
604 (message "The target directory doesn't exist."))
605 ;;Target shouldn't already exist, but if force is given, let
607 ;;$$IMPROVE ME If it is a symlink pointing to the same place,
608 ;;do nothing even on force.
610 (file-exists-p target
)
615 (format "Really overwrite %s? " project-name
))))
616 (message "File %s already exists" target
)))
624 ;;;_ . elinstall-add-to-dot-emacs
625 (defun elinstall-add-to-dot-emacs (dot-emacs-name filename force
&rest r
)
626 "Add code to load FILENAME to .emacs.
627 FILENAME should not have an extension"
630 (with-current-buffer (find-file-noselect dot-emacs-name
)
633 (goto-char (point-max))
634 (insert "\n;;Added by elinstall")
635 (insert "\n;;Consider using my-site-start to manage .emacs\n")
636 (pp `(load ,filename
) (current-buffer))
640 ;;;_ . elinstall-arrange-preload
642 (defun elinstall-arrange-preload (force filename basename
&optional priority
)
643 "Arrange for FILENAME to be loaded on emacs start.
644 FORCE has its usual meaning.
645 BASENAME and PRIORITY are used as arguments to
646 `elinstall-symlink-on-emacs-start'.
650 ((preload-target elinstall-default-preload-target
))
652 ;;Dispatch the possibilities.
654 ((eq preload-target
'dot-emacs
)
655 (elinstall-add-to-dot-emacs "~/.emacs" filename
))
656 ((stringp preload-target
)
657 (elinstall-symlink-on-emacs-start
658 filename basename preload-target priority force
))
660 (message "Not arranging for preloads"))
662 (message "I don't recognize that")))))
663 ;;;_ . elinstall-stage-arrange-preloads
664 (defun elinstall-stage-arrange-preloads (actions deffiles-used
)
665 "Arrange any preloads mentioned in ACTIONS."
679 (member filename deffiles-used
)))))
683 #'elinstall-arrange-preload
688 "elinstall-stage-arrange-preloads: Action not
694 ;;;_ . elinstall-stage-run-tests
695 (defun elinstall-stage-run-tests (actions)
696 "Run any tests mentioned in ACTIONS."
702 ;;$$WRITE ME - not a high priority right now.
706 "elinstall-stage-run-tests: Action not
712 ;;;_ . elinstall-stage-byte-compile
713 (defun elinstall-stage-byte-compile (actions)
714 "Do any byte-compilation mentioned in ACTIONS."
719 ;;$$IMPROVE ME Understand flags to control second
720 ;;argument (whether to load file after
723 (byte-compile-file (second act
)))
726 "elinstall-stage-byte-compile: Action not
730 ;;;_ . Segregating actions
731 ;;;_ , elinstall-remove-empty-segs
732 (defun elinstall-remove-empty-segs (segment-list)
733 "Return SEGMENT-LIST minus any segments that have no actions.
734 Intended only for the deffile stage data."
743 ;;;_ , elinstall-segregate-actions
744 (defun elinstall-segregate-actions (actions)
745 "Return actions segregated by deffile.
747 Returns a list whose elements are each a cons of:
748 * deffile filename or nil
749 * A list of actions to be done for that deffile."
756 (arrange-preloads '()))
758 (dolist (act actions
)
765 ((deffile-name (second act
))
767 (assoc deffile-name build-deffiles
)))
769 ;;There are already actions on this deffile.
770 ;;Splice this action in.
772 (cons act
(cdr cell-already
)))
773 ;;There are no actions on this deffile. Add a
774 ;;place for them and include this action.
775 (push (list deffile-name act
) build-deffiles
))))
777 (push act arrange-preloads
))
779 (push act run-tests
))
781 (push act byte-compile
)))))
783 (elinstall-make-stages
785 (elinstall-remove-empty-segs build-deffiles
)
797 ;;;_ . Finding actions
798 ;;;_ , Treating the parameter list
799 ;;;_ . elinstall-add-parameter
800 (defun elinstall-add-parameter (alist key new-value
)
801 "Add a new value for KEY to ALIST"
805 (assq-delete-all key
(copy-list alist
))))
807 ;;;_ . elinstall-get-parameter
808 (defun elinstall-get-parameter (alist key
)
809 "Get the value of KEY from ALIST"
811 (cdr (assq key alist
)))
812 ;;;_ . elinstall-expand-file-name
815 (defun elinstall-expand-file-name (filename alist
)
816 "Expand FILENAME by the value of `path' in ALIST"
819 (elinstall-get-parameter alist
'path
)))
820 ;;;_ , Finding deffiles
821 ;;;_ . elinstall-expand-deffile-name
822 (defun elinstall-expand-deffile-name (deffile)
823 "Expand DEFFILE autoload.el's way."
825 (expand-file-name (or deffile
"loaddefs.el")
826 (expand-file-name "lisp"
829 ;;;_ . elinstall-maybe-get-deffile
830 (defun elinstall-maybe-get-deffile (file)
831 "If FILE defined `generated-autoload-file', return it.
832 Otherwise return nil.
833 Return it as an absolute filename."
836 ;;$$FIXME load buffer if it's not already loaded
838 ((existing-buffer (get-file-buffer file
)))
840 ;; We want to get a value for generated-autoload-file from
841 ;; the local variables section if it's there.
842 ;;But if it's not loaded, we don't? Maybe should use
843 ;; `autoload-find-file' and load it.
845 (set-buffer existing-buffer
))
846 (if (local-variable-p 'generated-autoload-file
)
847 (elinstall-expand-deffile-name
848 generated-autoload-file
)
853 ;;;_ . elinstall-find-actions-for-file
854 (defun elinstall-find-actions-for-file
855 (filename load-path-element dir parameters
)
856 "Return a list of actions to do for FILENAME.
857 LOAD-PATH-ELEMENT, DIR, and PARAMETERS are interpreted as in
858 `elinstall-find-actions-by-spec' "
862 (expand-file-name filename dir
)))
865 ,(elinstall-get-parameter
866 parameters
'def-file
)
867 ;;load-name relative to a member of load-path
868 ,(file-name-sans-extension
872 ,load-path-element
;;Is this still used?
875 ;;;_ . elinstall-find-actions-by-spec
877 (defun elinstall-find-actions-by-spec (spec load-path-element path parameters
)
878 "Return a list of actions to do, controlled by SPEC and PARAMETERS.
880 LOAD-PATH-ELEMENT is the conceptual element of load-path that
881 surrounds DIR. It may not yet have been added to load-path."
883 ;;$$IMPROVE ME by adding the other cases in the design.
892 (elinstall-find-actions-by-spec
902 (elinstall-find-actions-by-spec
910 (elinstall-find-actions-for-file
911 filename load-path-element dir parameters
))
921 (elinstall-get-parameter
922 parameters
'block-add-to-load-path
)))
930 ;;Do this only if there are loadable files.
933 ,(elinstall-get-parameter
934 parameters
'def-file
)
938 ;;Do add-to-info-path too. But test if there are
939 ;;any info files present.
942 ;; We want to get a value for generated-autoload-file
943 ;; from the local variables section if it's there.
944 ;;Use `elinstall-maybe-get-deffile'
945 ;; Otherwise we'll use `def-file' in parameters.
947 ;;$$FIXME This isn't quite right. If directory
948 ;;itself is not in load-path, this will be wrong.
949 ;;Gotta know where our encompassing part of
952 ;;$$ENCAP ME This should be shared with the
953 ;;treatment of (file FN)
955 ;;$$FIXME Don't do directories, but maybe recurse on
956 ;;them, if a flag is set. And since we definitely
957 ;;have a load-path element here,
958 ;;'block-add-to-load-path according to a parameter.
959 ;;Maybe could follow/not symlinks similarly.
963 (elinstall-find-actions-for-file
971 nil
;;Relative filenames
972 elinstall-elisp-regexp
))))))
980 (for-preload (third spec
)))
981 (assert (listp for-preload
))
985 (and for-preload
(car for-preload
))
992 (elinstall-find-actions-by-spec
996 (elinstall-add-parameter parameters
997 'def-file new-def-file
))))))
999 ;;$$IMPROVE ME by adding the other cases in the design.
1002 ;;;_ . high-level work
1003 ;;;_ , elinstall-get-relevant-load-path
1004 (defun elinstall-get-relevant-load-path (actions)
1014 ;;;_ , elinstall-get-deffile-list
1015 (defun elinstall-get-deffile-list (stages)
1016 "Get a list of deffile names"
1020 (elinstall-stages->build-deffiles stages
)))
1023 (defun elinstall-x (dir spec
&optional force
)
1027 ;;This is just the default deffile, spec can override it.
1029 (elinstall-expand-deffile-name nil
))
1031 (elinstall-find-actions-by-spec
1036 (def-file .
,def-file
))))
1037 (stages (elinstall-segregate-actions actions
))
1039 (elinstall-get-relevant-load-path
1042 (elinstall-stage-update-deffiles
1043 (elinstall-stages->build-deffiles stages
)
1046 (elinstall-stage-arrange-preloads
1047 (elinstall-stages->arrange-preloads stages
)
1048 (elinstall-get-deffile-list stages
))
1054 (defun elinstall (project-name path spec
&optional force
)
1055 "Install elisp files.
1056 They need not be a formal package.
1060 PROJECT-NAME - the name of the project
1062 PATH - Path to the project.
1063 Suggestion: (elinstall-directory-true-name)
1065 SPEC - a spec for the autoloads etc to make. It can be as simple as
1066 \(dir \"\.\") for installing one directory.
1068 If FORCE is t, install a package even if it has already been
1069 installed. Other non-nil cases of FORCE are reserved for future
1076 (not (elinstall-already-installed project-name
)))
1077 (yes-or-no-p (format "Re-install %s? " project-name
)))
1080 `(def-file "loaddefs.el" (if-used ,project-name
) ,spec
)
1082 (elinstall-record-installed project-name
)))
1086 ;;;_ , elinstall-update-directory-autoloads
1089 (defun elinstall-update-directory-autoloads (dir)
1092 (interactive "DInstall all elisp files from directory: ")
1097 (elinstall-expand-deffile-name
1098 generated-autoload-file
)))
1102 `(def-file ,def-file-name
(nil) (dir ".")))))
1106 ;;;_ , elinstall-update-file-autoloads
1109 (defun elinstall-update-file-autoloads (file)
1112 (interactive "fInstall elisp file: ")
1116 (elinstall-maybe-get-deffile file
)
1117 (elinstall-expand-deffile-name
1118 generated-autoload-file
))))
1121 `(def-file ,def-file-name
(nil) (file ,file
)))))
1126 (provide 'elinstall
)
1128 ;;;_ * Local emacs vars.
1129 ;;;_ + Local variables:
1134 ;;; elinstall.el ends here