annotate lisp/update-elc-2.el @ 617:af57a77cbc92

[xemacs-hg @ 2001-06-18 07:09:50 by ben] --------------------------------------------------------------- DOCUMENTATION FIXES: --------------------------------------------------------------- eval.c: Correct documentation. elhash.c: Doc correction. --------------------------------------------------------------- LISP OBJECT CLEANUP: --------------------------------------------------------------- bytecode.h, buffer.h, casetab.h, chartab.h, console-msw.h, console.h, database.c, device.h, eldap.h, elhash.h, events.h, extents.h, faces.h, file-coding.h, frame.h, glyphs.h, gui-x.h, gui.h, keymap.h, lisp-disunion.h, lisp-union.h, lisp.h, lrecord.h, lstream.h, mule-charset.h, objects.h, opaque.h, postgresql.h, process.h, rangetab.h, specifier.h, toolbar.h, tooltalk.h, ui-gtk.h: Add wrap_* to all objects (it was already there for a few of them) -- an expression to encapsulate a pointer into a Lisp object, rather than the inconvenient XSET*. "wrap" was chosen because "make" as in make_int(), make_char() is not appropriate. (It implies allocation. The issue does not exist for ints and chars because they are not allocated.) Full error checking has been added to these expressions. When used without error checking, non-union build, use of these expressions will incur no loss of efficiency. (In fact, XSET* is now defined in terms of wrap_* in a non-union build.) In a union build, you will also get no loss of efficiency provided that you have a decent optimizing compiler, and a compiler that either understands inlines or automatically inlines those particular functions. (And since people don't normally do their production builds on union, it doesn't matter.) Update the sample Lisp object definition in lrecord.h accordingly. dumper.c: Fix places in dumper that referenced wrap_object to reference its new name, wrap_pointer_1. buffer.c, bufslots.h, conslots.h, console.c, console.h, devslots.h, device.c, device.h, frame.c, frame.h, frameslots.h, window.c, window.h, winslots.h: -- Extract out the Lisp objects of `struct device' into devslots.h, just like for the other structures. -- Extract out the remaining (not copied into the window config) Lisp objects in `struct window' into winslots.h; use different macros (WINDOW_SLOT vs. WINDOW_SAVED_SLOT) to differentiate them. -- Eliminate the `dead' flag of `struct frame', since it duplicates information already available in `framemeths', and fix FRAME_LIVE_P accordingly. (Devices and consoles already work this way.) -- In *slots.h, switch to system where MARKED_SLOT is automatically undef'd at the end of the file. (Follows what winslots.h already does.) -- Update the comments at the beginning of *slots.h to be accurate. -- When making any of the above objects dead, zero it out entirely and reset all Lisp object slots to Qnil. (We were already doing this somewhat, but not consistently.) This (1) Eliminates the possibility of extra objects hanging around that ought to be GC'd, (2) Causes an immediate crash if anyone tries to access a structure in one of these objects, (3) Ensures consistent behavior wrt dead objects. dialog-msw.c: Use internal_object_printer, since this object should not escape. --------------------------------------------------------------- FIXING A CRASH THAT I HIT ONCE (AND A RELATED BAD BEHAVIOR): --------------------------------------------------------------- eval.c: Fix up some comments about the FSF implementation. Fix two nasty bugs: (1) condition_case_unwind frees the conses sitting in the catch->tag slot too quickly, resulting in a crash that I hit. (2) catches need to be unwound one at a time when calling unwind-protect code, rather than all at once at the end; otherwise, incorrect behavior can result. (A comment shows exactly how.) backtrace.h: Improve comment about FSF differences in the handler stack. --------------------------------------------------------------- FIXING A CRASH THAT I REPEATEDLY HIT WHEN USING THE MOUSE WHEEL UNDER MSWINDOWS: --------------------------------------------------------------- Basic idea: My crash is due either to a dead, non-marked, GC-collected frame inside of a window mirror, or a prematurely freed window mirror. We need to mark the Lisp objects inside of window mirrors. Tracking the lifespan of window mirrors and scrollbar instances is extremely hard, and there may well be lurking bugs where such objects are freed too soon. The only safe way to fix these problems (and it fixes both problems at once) is to make both of these structures Lisp objects. lrecord.h, emacs.c, inline.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, symsinit.h: Make scrollbar instances actual Lisp objects. Mark the window mirrors in them. inline.c needs to know about scrollbar.h now. Record the new type in lrecord.h. Fix up scrollbar-*.c appropriately. Create a hash table in scrollbar-msw.c so that the scrollbar instances stored in scrollbar HWND's are properly GC-protected. Create complex_vars_of_scrollbar_mswindows() to create the hash table at startup, and call it from emacs.c. Don't store the scrollbar instance as a property of the GTK scrollbar, as it's not used and if we did this, we'd have to separately GC-protect it in a hash table, like in MS Windows. lrecord.h, frame.h, frame.c, frameslots.h, redisplay.c, window.c, window.h: Move mark_window_mirror from redisplay.c to window.c. Make window mirrors actual Lisp objects. Tell lrecord.h about them. Change the window mirror member of struct frame from a pointer to a Lisp object, and add XWINDOW_MIRROR in appropriate places. Mark the scrollbar instances in the window mirror. redisplay.c, redisplay.h, alloc.c: Delete mark_redisplay. Don't call mark_redisplay. We now mark frame-specific structures in mark_frame. NOTE: I also deleted an extremely questionable call to update_frame_window_mirrors(). It was extremely questionable before, and now totally impossible, since it will create Lisp objects during redisplay. frame.c: Mark the scrollbar instances, which are now Lisp objects. Call mark_gutter() here, not in mark_redisplay(). gutter.c: Update comments about correct marking. --------------------------------------------------------------- ISSUES BROUGHT UP BY MARTIN: --------------------------------------------------------------- buffer.h: Put back these macros the way Steve T and I think they ought to be. I already explained in a previous changelog entry why I think these macros should be the way I'd defined them. Once again: We fix these macros so they don't care about the type of their lvalues. The non-C-string equivalents of these already function in the same way, and it's correct because it should be OK to pass in a CBufbyte *, a BufByte *, a Char_Binary *, an UChar_Binary *, etc. The whole reason for these different types is to work around errors caused by signed-vs-unsigned non-matching types. Any possible error that might be caught in a DFC macro would also be caught wherever the argument is used elsewhere. So creating multiple macro versions would add no useful error-checking and just further complicate an already complicated area. As for Martin's "ANSI aliasing" bug, XEmacs is not ANSI-aliasing clean and probably never will be. Unless the board agrees to change XEmacs in this way (and we really don't want to go down that road), this is not a bug. sound.h: Undo Martin's type change. signal.c: Fix problem identified by Martin with Linux and g++ due to non-standard declaration of setitimer(). systime.h: Update the docs for "qxe_" to point out why making the encapsulation explicit is always the right way to go. (setitimer() itself serves as an example.) For 21.4: update-elc-2.el: Correct misplaced parentheses, making lisp/mule not get recompiled.
author ben
date Mon, 18 Jun 2001 07:10:32 +0000
parents ef4d2466a29c
children 25e260cb7994
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
1 ;;; update-elc-2.el --- Recompile remaining .el files, post-dumping
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
2
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
3 ;; Copyright (C) 1997 by Free Software Foundation, Inc.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
4 ;; Copyright (C) 2000 Ben Wing.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
5
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
6 ;; Author: Ben Wing <ben@xemacs.org>, based on cleantree.el by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
7 ;; Steven L Baur <steve@xemacs.org>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
8 ;; Maintainer: XEmacs Development Team
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
9 ;; Keywords: internal
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
10
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
12
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
16 ;; any later version.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
17
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
21 ;; General Public License for more details.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
22
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the Free
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
25 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
26 ;; 02111-1307, USA.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
27
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
28 ;;; Synched up with: Not in FSF
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
29
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
30 ;;; Commentary:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
31
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
32 ;; This file should be used after XEmacs has been dumped, to recompile
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
33 ;; all remaining out-of-date .els and clean up orphaned .elcs. It should
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
34 ;; be called as
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
35 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
36 ;; xemacs -batch -vanilla -l update-elc-2.el -f batch-update-elc-2 ${dirname}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
37 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
38 ;; where ${dirname} is the directory tree to recompile, usually `lisp'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
39 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
40 ;; Note that this is very different from update-elc.el, which is called
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
41 ;; BEFORE dumping, handles only the files needed to dump, and is called
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
42 ;; from temacs instead of xemacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
43 ;;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
44 ;; The original cleantree.el had the comment: This code is derived
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
45 ;; from Gnus based on a suggestion by David Moore <dmoore@ucsd.edu>
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
46
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
47 ;;; Code:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
48
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
49 (defvar update-elc-ignored-dirs
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
50 `("." ".." "CVS" "SCCS" "RCS" ,@(unless (featurep 'mule) '("mule"))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
51
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
52 (defvar update-elc-ignored-files
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
53 ;; note: entries here are regexps
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
54 '("^," ;; #### huh?
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
55 "^paths\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
56 "^loadup\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
57 "^loadup-el\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
58 "^update-elc\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
59 "^update-elc-2\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
60 "^dumped-lisp\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
61 "^make-docfile\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
62 "^site-start\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
63 "^site-load\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
64 "^site-init\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
65 "^version\\.el$"
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
66 "^very-early-lisp\\.el$"))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
67
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
68 ;; SEEN accumulates the list of already-handled dirs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
69 (defun do-update-elc-2 (dir compile-stage-p seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
70 (setq dir (file-name-as-directory dir))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
71 ;; Only scan this sub-tree if we haven't been here yet.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
72 (unless (member (file-truename dir) seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
73 (push (file-truename dir) seen)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
74
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
75 ;; Do this directory.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
76 (if compile-stage-p
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
77 ;; Stage 2: Recompile necessary .els
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
78 (let ((files (directory-files dir t "\\.el$"))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
79 file file-c)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
80 (while (setq file (car files))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
81 (setq files (cdr files))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
82 (setq file-c (concat file "c"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
83 (when (and (file-exists-p file)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
84 (or (not (file-exists-p file-c))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
85 (file-newer-than-file-p file file-c))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
86 (let (ignore)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
87 (mapcar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
88 #'(lambda (regexp)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
89 (if (string-match regexp
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
90 (file-name-nondirectory file))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
91 (setq ignore t)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
92 update-elc-ignored-files)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
93 (not ignore)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
94 (byte-compile-file file))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
95
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
96 ;; Stage 1.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
97 ;; Remove out-of-date elcs
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
98 (let ((files (directory-files dir t "\\.el$"))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
99 file file-c)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
100 (while (setq file (car files))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
101 (setq files (cdr files))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
102 (setq file-c (concat file "c"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
103 (when (and (file-exists-p file-c)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
104 (file-newer-than-file-p file file-c))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
105 (message "Removing out-of-date %s" file-c)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
106 (delete-file file-c))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
107 ;; Remove elcs without corresponding el
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
108 (let ((files (directory-files dir t "\\.elc$"))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
109 file file-c)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
110 (while (setq file-c (car files))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
111 (setq files (cdr files))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
112 (setq file (replace-in-string file-c "c$" ""))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
113 (when (and (file-exists-p file-c)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
114 (not (file-exists-p file)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
115 (message "Removing %s; no corresponding .el" file-c)
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 528
diff changeset
116 (delete-file file-c)))))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
117
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
118 ;; We descend recursively
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
119 (let ((dirs (directory-files dir t nil t))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
120 dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
121 (while (setq dir (pop dirs))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
122 (when (and (not (member (file-name-nondirectory dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
123 update-elc-ignored-dirs))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
124 (file-directory-p dir))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
125 (do-update-elc-2 dir compile-stage-p seen))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
126
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 528
diff changeset
127 ))
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
128
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
129 (defun batch-update-elc-2 ()
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
130 (defvar command-line-args-left)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
131 (unless noninteractive
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
132 (error "`batch-update-elc-2' is to be used only with -batch"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
133 (let ((dir (car command-line-args-left)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
134 ;; We remove all the bad .elcs before any byte-compilation, because
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
135 ;; there may be dependencies between one .el and another (even across
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
136 ;; directories), and we don't want to load an out-of-date .elc while
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
137 ;; byte-compiling a file.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
138 (message "Removing old or spurious .elcs in directory tree `%s'..." dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
139 (do-update-elc-2 dir nil nil)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
140 (message "Removing old or spurious .elcs in directory tree `%s'...done"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
141 dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
142 (message "Recompiling updated .els in directory tree `%s'..." dir)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
143 (do-update-elc-2 dir t nil)
528
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
144 (message "Recompiling updated .els in directory tree `%s'...done" dir)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
145 ;; don't depend on being able to autoload `update-autoload-files'!
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
146 (load "autoload")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
147 (update-autoload-files (list dir))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
148 (byte-recompile-file (expand-file-name "auto-autoloads.el" dir) 0)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
149 (when (featurep 'mule)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
150 (update-autoload-files (list (expand-file-name "mule" dir)))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
151 (byte-recompile-file (expand-file-name "mule/auto-autoloads.el" dir) 0))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
152 ;; likewise here.
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
153 (load "cus-dep")
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
154 (Custom-make-dependencies dir)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
155 (byte-recompile-file (expand-file-name "custom-load.el" dir) 0)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
156 (when (featurep 'mule)
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
157 (Custom-make-dependencies (expand-file-name "mule" dir))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
158 (byte-recompile-file (expand-file-name "mule/custom-load.el" dir) 0))
ef4d2466a29c [xemacs-hg @ 2001-05-10 09:59:45 by ben]
ben
parents: 444
diff changeset
159 )
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
160 (setq command-line-args-left nil))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents:
diff changeset
161
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
162 ;;; update-elc-2.el ends here