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.
384 ;;;_ . elinstall-deffile-insert
386 (defun elinstall-deffile-insert (action)
387 "Insert autoloads etc into current file according to ACTION.
388 The format of ACTION is described in the design docs.
390 Return filename if this action belongs in the no-autoload section."
395 (elinstall-deffile-insert-autoloads
400 (elinstall-deffile-insert-add-to-path
406 (elinstall-deffile-insert-add-to-path
411 ((preload-file run-tests byte-compile
)
412 (error "This case should not come here.")))))
414 ;;;_ . elinstall-prepare-deffile
415 (defun elinstall-prepare-deffile (deffile)
416 "Try to ensure that DEFFILE is available for receiving autoloads"
418 (autoload-ensure-default-file deffile
)
419 (with-current-buffer (find-file-noselect deffile
)
422 ;; We must read/write the file without any code conversion,
423 ;; but still decode EOLs.
424 (let ((coding-system-for-read 'raw-text
))
426 ;; This is to make generated-autoload-file have Unix EOLs, so
427 ;; that it is portable to all platforms.
428 (setq buffer-file-coding-system
'raw-text-unix
))
429 (or (> (buffer-size) 0)
430 (error "Autoloads file %s does not exist" buffer-file-name
))
431 (or (file-writable-p buffer-file-name
)
432 (error "Autoloads file %s is not writable"
435 ;;;_ . elinstall-update-deffile
437 ;;Adapted from autoload.el `update-directory-autoloads'.
439 (defun elinstall-update-deffile (target actions
&optional
442 Update file TARGET with current autoloads as specified by ACTIONS.
443 Also remove any old definitions pointing to libraries that can no
446 ACTIONS must be a list of actions (See the format doc). Each one's
447 filename must be relative to some element of load-path.
449 USE-LOAD-PATH is a list to use as load-path. It should include
450 any new load-path that we are arranging to create. If it's not given,
451 load-path itself is used.
453 If FORCE is `t', do it regardless of timestamps etc. (Not implemented)
454 Other non-nil cases of FORCE are reserved for future development.
456 This uses `update-file-autoloads' (which see) to do its work.
457 In an interactive call, you must give one argument, the name
458 of a single directory."
461 (use-load-path (or use-load-path load-path
))
462 (this-time (current-time))
463 ;;files with no autoload cookies.
466 (elinstall-prepare-deffile target
)
468 (find-file-noselect target
)
471 (elinstall-remove-autogen-action
472 (autoload-trim-file-name target
)
475 (goto-char (point-min))
476 (while (search-forward generate-autoload-section-header nil t
)
477 (let* ((form (autoload-read-section-header))
479 (cond ((and (consp file
) (stringp (car file
)))
480 ;; This is a list of files that have no
482 ;; There shouldn't be more than one such entry.
483 ;; Remove the obsolete section.
484 (autoload-remove-section (match-beginning 0))
485 (let ((last-time (nth 4 form
)))
487 (let ((file-time (nth 5 (file-attributes file
))))
489 (not (time-less-p last-time file-time
)))
491 (push file no-autoloads
)
493 (elinstall-remove-autogen-action
495 ((not (stringp file
)))
499 (locate-library file nil use-load-path
)))
501 ;;File doesn't exist, so remove its
504 (autoload-remove-section
505 (match-beginning 0)))
507 ;; File hasn't changed, so do nothing.
510 (nth 5 (file-attributes file-path
)))
513 (elinstall-deffile-insert
514 (elinstall-get-autogen-action
518 (elinstall-remove-autogen-action
521 ;; Remaining actions have no existing autoload sections yet.
524 (delq nil
(mapcar #'elinstall-deffile-insert actions
))))
526 ;; Sort them for better readability.
527 (setq no-autoloads
(sort no-autoloads
'string
<))
528 ;; Add the `no-autoloads' section.
529 (goto-char (point-max))
530 (search-backward "\f" nil t
)
531 (autoload-insert-section-header
532 (current-buffer) nil nil no-autoloads this-time
)
533 (insert generate-autoload-section-trailer
))
536 ;;;_ . elinstall-stage-update-deffiles
537 (defun elinstall-stage-update-deffiles (segment-list force use-load-path
)
538 "Update any deffiles mentioned in SEGMENT-LIST.
539 FORCE and USE-LOAD-PATH have the same meaning as in
540 `elinstall-update-deffile'.
545 ((deffile (car segment
)))
546 (if (stringp deffile
)
547 (elinstall-update-deffile deffile
(cdr segment
) force
551 ;;;_ , Doing actions to arrange preloads
552 ;;;_ . elinstall-symlink-on-emacs-start
553 (defun elinstall-symlink-on-emacs-start
554 (filename target-basename target-dir
&optional priority force
)
555 "Symlink to TARGET-BASENAME.el in TARGET-DIR
557 If PRIORITY is given, it will be used as the priority prefix,
558 otherwise elinstall-default-priority will be.
559 PRIORITY must be an integer or nil.
560 If FORCE is `t', do it regardless of timestamps etc.
561 Other non-nil cases of FORCE are reserved for future development."
564 (priority (or priority elinstall-default-priority
))
571 (expand-file-name target-name-nodir target-dir
)))
575 ;;Path should already exist.
577 (file-exists-p target-dir
))
578 (message "The target directory doesn't exist."))
579 ;;Target shouldn't already exist, but if force is given, let
581 ;;$$IMPROVE ME If it is a symlink pointing to the same place,
582 ;;do nothing even on force.
584 (file-exists-p target
)
589 (format "Really overwrite %s? " target
))))
590 (message "File %s already exists" target
)))
598 ;;;_ . elinstall-add-to-dot-emacs
599 (defun elinstall-add-to-dot-emacs (dot-emacs-name filename force
&rest r
)
600 "Add code to load FILENAME to .emacs.
601 FILENAME should not have an extension"
604 (with-current-buffer (find-file-noselect dot-emacs-name
)
607 (goto-char (point-max))
608 (insert "\n;;Added by elinstall")
609 (insert "\n;;Consider using my-site-start to manage .emacs\n")
610 (pp `(load ,filename
) (current-buffer))
614 ;;;_ . elinstall-arrange-preload
616 (defun elinstall-arrange-preload (force filename basename
&optional priority
)
617 "Arrange for FILENAME to be loaded on emacs start.
618 FORCE has its usual meaning.
619 BASENAME and PRIORITY are used as arguments to
620 `elinstall-symlink-on-emacs-start'.
624 ((preload-target elinstall-default-preload-target
))
626 ;;Dispatch the possibilities.
628 ((eq preload-target
'dot-emacs
)
629 (elinstall-add-to-dot-emacs "~/.emacs" filename
))
630 ((stringp preload-target
)
631 (elinstall-symlink-on-emacs-start
632 filename basename preload-target priority force
))
634 (message "Not arranging for preloads"))
636 (message "I don't recognize that")))))
637 ;;;_ . elinstall-stage-arrange-preloads
638 (defun elinstall-stage-arrange-preloads (actions deffiles-used
)
639 "Arrange any preloads mentioned in ACTIONS."
653 (member filename deffiles-used
)))))
657 #'elinstall-arrange-preload
662 "elinstall-stage-arrange-preloads: Action not
668 ;;;_ . elinstall-stage-run-tests
669 (defun elinstall-stage-run-tests (actions)
670 "Run any tests mentioned in ACTIONS."
676 ;;$$WRITE ME - not a high priority right now.
680 "elinstall-stage-run-tests: Action not
686 ;;;_ . elinstall-stage-byte-compile
687 (defun elinstall-stage-byte-compile (actions)
688 "Do any byte-compilation mentioned in ACTIONS."
693 ;;$$IMPROVE ME Understand flags to control second
694 ;;argument (whether to load file after
697 (byte-compile-file (second act
)))
700 "elinstall-stage-byte-compile: Action not
704 ;;;_ . Segregating actions
705 ;;;_ , elinstall-remove-empty-segs
706 (defun elinstall-remove-empty-segs (segment-list)
707 "Return SEGMENT-LIST minus any segments that have no actions.
708 Intended only for the deffile stage data."
717 ;;;_ , elinstall-segregate-actions
718 (defun elinstall-segregate-actions (actions)
719 "Return actions segregated by deffile.
721 Returns a list whose elements are each a cons of:
722 * deffile filename or nil
723 * A list of actions to be done for that deffile."
730 (arrange-preloads '()))
732 (dolist (act actions
)
739 ((deffile-name (second act
))
741 (assoc deffile-name build-deffiles
)))
743 ;;There are already actions on this deffile.
744 ;;Splice this action in.
746 (cons act
(cdr cell-already
)))
747 ;;There are no actions on this deffile. Add a
748 ;;place for them and include this action.
749 (push (list deffile-name act
) build-deffiles
))))
751 (push act arrange-preloads
))
753 (push act run-tests
))
755 (push act byte-compile
)))))
757 (elinstall-make-stages
759 (elinstall-remove-empty-segs build-deffiles
)
771 ;;;_ . Finding actions
772 ;;;_ , Treating the parameter list
773 ;;;_ . elinstall-add-parameter
774 (defun elinstall-add-parameter (alist key new-value
)
775 "Add a new value for KEY to ALIST"
779 (assq-delete-all key
(copy-list alist
))))
781 ;;;_ . elinstall-get-parameter
782 (defun elinstall-get-parameter (alist key
)
783 "Get the value of KEY from ALIST"
785 (cdr (assq key alist
)))
786 ;;;_ . elinstall-expand-file-name
789 (defun elinstall-expand-file-name (filename alist
)
790 "Expand FILENAME by the value of `path' in ALIST"
793 (elinstall-get-parameter alist
'path
)))
794 ;;;_ , Finding deffiles
795 ;;;_ . elinstall-expand-deffile-name
796 (defun elinstall-expand-deffile-name (deffile)
797 "Expand DEFFILE autoload.el's way."
799 (expand-file-name (or deffile
"loaddefs.el")
800 (expand-file-name "lisp"
803 ;;;_ . elinstall-maybe-get-deffile
804 (defun elinstall-maybe-get-deffile (file)
805 "If FILE defined `generated-autoload-file', return it.
806 Otherwise return nil.
807 Return it as an absolute filename."
810 ;;$$FIXME load buffer if it's not already loaded
812 ((existing-buffer (get-file-buffer file
)))
814 ;; We want to get a value for generated-autoload-file from
815 ;; the local variables section if it's there.
816 ;;But if it's not loaded, we don't? Maybe should use
817 ;; `autoload-find-file' and load it.
819 (set-buffer existing-buffer
))
820 (if (local-variable-p 'generated-autoload-file
)
821 (elinstall-expand-deffile-name
822 generated-autoload-file
)
827 ;;;_ . elinstall-find-actions-for-file
828 (defun elinstall-find-actions-for-file
829 (filename load-path-element dir parameters
)
830 "Return a list of actions to do for FILENAME.
831 LOAD-PATH-ELEMENT, DIR, and PARAMETERS are interpreted as in
832 `elinstall-find-actions-by-spec' "
836 (expand-file-name filename dir
)))
839 ,(elinstall-get-parameter
840 parameters
'def-file
)
841 ;;load-name relative to a member of load-path
842 ,(file-name-sans-extension
846 ,load-path-element
;;Is this still used?
849 ;;;_ . elinstall-find-actions-by-spec
851 (defun elinstall-find-actions-by-spec (spec load-path-element path parameters
)
852 "Return a list of actions to do, controlled by SPEC and PARAMETERS.
854 LOAD-PATH-ELEMENT is the conceptual element of load-path that
855 surrounds DIR. It may not yet have been added to load-path."
857 ;;$$IMPROVE ME by adding the other cases in the design.
866 (elinstall-find-actions-by-spec
876 (elinstall-find-actions-by-spec
884 (elinstall-find-actions-for-file
885 filename load-path-element dir parameters
))
895 (elinstall-get-parameter
896 parameters
'block-add-to-load-path
)))
904 ;;Do this only if there are loadable files.
907 ,(elinstall-get-parameter
908 parameters
'def-file
)
912 ;;Do add-to-info-path too. But test if there are
913 ;;any info files present.
916 ;; We want to get a value for generated-autoload-file
917 ;; from the local variables section if it's there.
918 ;;Use `elinstall-maybe-get-deffile'
919 ;; Otherwise we'll use `def-file' in parameters.
921 ;;$$FIXME This isn't quite right. If directory
922 ;;itself is not in load-path, this will be wrong.
923 ;;Gotta know where our encompassing part of
926 ;;$$ENCAP ME This should be shared with the
927 ;;treatment of (file FN)
929 ;;$$FIXME Don't do directories, but maybe recurse on
930 ;;them, if a flag is set. And since we definitely
931 ;;have a load-path element here,
932 ;;'block-add-to-load-path according to a parameter.
933 ;;Maybe could follow/not symlinks similarly.
937 (elinstall-find-actions-for-file
945 nil
;;Relative filenames
946 elinstall-elisp-regexp
))))))
954 (for-preload (third spec
)))
955 (assert (listp for-preload
))
959 (and for-preload
(car for-preload
))
966 (elinstall-find-actions-by-spec
970 (elinstall-add-parameter parameters
971 'def-file new-def-file
))))))
973 ;;$$IMPROVE ME by adding the other cases in the design.
976 ;;;_ . high-level work
977 ;;;_ , elinstall-get-relevant-load-path
978 (defun elinstall-get-relevant-load-path (actions)
988 ;;;_ , elinstall-get-deffile-list
989 (defun elinstall-get-deffile-list (stages)
990 "Get a list of deffile names"
994 (elinstall-stages->build-deffiles stages
)))
997 (defun elinstall-x (dir spec
&optional force
)
1001 ;;This is just the default deffile, spec can override it.
1003 (elinstall-expand-deffile-name nil
))
1005 (elinstall-find-actions-by-spec
1010 (def-file .
,def-file
))))
1011 (stages (elinstall-segregate-actions actions
))
1013 (elinstall-get-relevant-load-path
1016 (elinstall-stage-update-deffiles
1017 (elinstall-stages->build-deffiles stages
)
1020 (elinstall-stage-arrange-preloads
1021 (elinstall-stages->arrange-preloads stages
)
1022 (elinstall-get-deffile-list stages
))
1028 (defun elinstall (project-name path spec
&optional force
)
1029 "Install elisp files.
1030 They need not be a formal package.
1034 PROJECT-NAME - the name of the project
1036 PATH - Path to the project.
1037 Suggestion: (elinstall-directory-true-name)
1039 SPEC - a spec for the autoloads etc to make. It can be as simple as
1040 \(dir \"\.\") for installing one directory.
1042 If FORCE is t, install a package even if it has already been
1043 installed. Other non-nil cases of FORCE are reserved for future
1050 (not (elinstall-already-installed project-name
)))
1051 (yes-or-no-p (format "Re-install %s? " project-name
)))
1054 `(def-file "loaddefs.el" (if-used ,project-name
) ,spec
)
1056 (elinstall-record-installed project-name
)))
1060 ;;;_ , elinstall-update-directory-autoloads
1063 (defun elinstall-update-directory-autoloads (dir)
1066 (interactive "DInstall all elisp files from directory: ")
1071 (elinstall-expand-deffile-name
1072 generated-autoload-file
)))
1076 `(def-file ,def-file-name
(nil) (dir ".")))))
1080 ;;;_ , elinstall-update-file-autoloads
1083 (defun elinstall-update-file-autoloads (file)
1086 (interactive "fInstall elisp file: ")
1090 (elinstall-maybe-get-deffile file
)
1091 (elinstall-expand-deffile-name
1092 generated-autoload-file
))))
1095 `(def-file ,def-file-name
(nil) (file ,file
)))))
1100 (provide 'elinstall
)
1102 ;;;_ * Local emacs vars.
1103 ;;;_ + Local variables:
1108 ;;; elinstall.el ends here