1 ;;; dgnushack.el --- a hack to set the load path for byte-compiling
2 ;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
3 ;; Free Software Foundation, Inc.
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6 ;; Katsumi Yamaoka <yamaoka@jpl.org>
8 ;; Keywords: news, path
10 ;; This file is part of GNU Emacs.
12 ;; GNU Emacs is free software; you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; GNU Emacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
24 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
31 ;; Set coding priority of Shift-JIS to the bottom.
32 (if (featurep 'xemacs)
33 (defalias 'set-coding-priority 'ignore)
34 (defalias 'coding-priority-list 'ignore)
35 (defalias 'set-coding-priority-list 'ignore))
36 (cond ((and (featurep 'xemacs) (featurep 'mule))
37 (if (memq 'shift-jis (coding-priority-list))
38 (set-coding-priority-list
39 (append (delq 'shift-jis (coding-priority-list)) '(shift-jis)))))
41 (put '*coding-category-sjis* 'priority (length *predefined-category*)))
43 (if (memq 'coding-category-sjis coding-category-list)
45 (append (delq 'coding-category-sjis
46 (copy-sequence coding-category-list))
47 '(coding-category-sjis))))))
49 (defalias 'facep 'ignore)
52 (unless (dolist (var nil t))
53 ;; Override the macro `dolist' which may have been defined in egg.el.
54 (load "cl-macs" nil t))
56 (defvar srcdir (or (getenv "srcdir") "."))
58 (let ((urldir (getenv "URLDIR")))
59 (unless (zerop (length urldir))
60 (push (file-name-as-directory urldir) load-path)))
62 (defvar dgnushack-w3-directory (let ((w3dir (getenv "W3DIR")))
63 (unless (zerop (length w3dir))
64 (file-name-as-directory w3dir))))
65 (when dgnushack-w3-directory
66 (push dgnushack-w3-directory load-path))
68 ;; If we are building w3 in a different directory than the source
69 ;; directory, we must read *.el from source directory and write *.elc
70 ;; into the building directory. For that, we define this function
71 ;; before loading bytecomp. Bytecomp doesn't overwrite this function.
72 (defun byte-compile-dest-file (filename)
73 "Convert an Emacs Lisp source file name to a compiled file name.
74 In addition, remove directory name part from FILENAME."
75 (setq filename (byte-compiler-base-file-name filename))
76 (setq filename (file-name-sans-versions filename))
77 (setq filename (file-name-nondirectory filename))
78 (if (memq system-type '(win32 w32 mswindows windows-nt))
79 (setq filename (downcase filename)))
80 (cond ((eq system-type 'vax-vms)
81 (concat (substring filename 0 (string-match ";" filename)) "c"))
82 ((string-match emacs-lisp-file-regexp filename)
83 (concat (substring filename 0 (match-beginning 0)) ".elc"))
84 (t (concat filename ".elc"))))
89 (let (current-load-list)
90 ;; Make the function to be silent at compile-time.
91 (defun locate-library (library &optional nosuffix)
92 "Show the full path name of Emacs library LIBRARY.
93 This command searches the directories in `load-path' like `M-x load-library'
94 to find the file that `M-x load-library RET LIBRARY RET' would load.
95 Optional second arg NOSUFFIX non-nil means don't add suffixes `.elc' or `.el'
96 to the specified name LIBRARY (a la calling `load' instead of `load-library')."
97 (interactive "sLocate library: ")
103 (let ((try (expand-file-name (concat library suf) dir)))
104 (and (file-readable-p try)
105 (null (file-directory-p try))
108 (message "Library is file %s" try))
109 (throw 'answer try)))))
110 (if nosuffix '("") '(".elc" ".el" ""))))
113 (message "No library %s in search path" library))
115 (byte-compile 'locate-library)))
117 (unless (fboundp 'si:byte-optimize-form-code-walker)
118 (byte-optimize-form nil);; Load `byte-opt' or `byte-optimize'.
119 (setq max-specpdl-size 3000)
120 (defalias 'si:byte-optimize-form-code-walker
121 (symbol-function 'byte-optimize-form-code-walker))
122 (defun byte-optimize-form-code-walker (form for-effect)
123 (if (and for-effect (memq (car-safe form) '(and or)))
124 ;; Fix bug in and/or forms.
125 (let ((fn (car form))
126 (backwards (reverse (cdr form))))
127 (while (and backwards
128 (null (setcar backwards
129 (byte-optimize-form (car backwards) t))))
130 (setq backwards (cdr backwards)))
131 (if (and (cdr form) (null backwards))
133 " all subforms of %s called for effect; deleted" form))
135 (let ((head backwards))
136 (while (setq backwards (cdr backwards))
137 (setcar backwards (byte-optimize-form (car backwards)
139 (cons fn (nreverse head)))))
140 (si:byte-optimize-form-code-walker form for-effect)))
141 (byte-compile 'byte-optimize-form-code-walker))
145 (wrong-number-of-arguments
146 ;; Optimize byte code for `char-after'.
147 (put 'char-after 'byte-optimizer 'byte-optimize-char-after)
148 (defun byte-optimize-char-after (form)
149 (if (null (cdr form))
150 '(char-after (point))
155 (wrong-number-of-arguments
156 ;; Optimize byte code for `char-before'.
157 (put 'char-before 'byte-optimizer 'byte-optimize-char-before)
158 (defun byte-optimize-char-before (form)
159 (if (null (cdr form))
160 '(char-before (point))
163 (load (expand-file-name "dgnuspath.el" srcdir) nil nil t)
166 (load "~/.lpath.el" t nil t)
167 (error (message "Error in \"~/.lpath.el\" file: %s" err)))
169 ;; Don't load path-util until `char-after' and `char-before' have been
170 ;; optimized because it requires `poe' and then modify the functions.
172 ;; If the APEL modules are installed under the non-standard directory,
173 ;; for example "/var/home/john/lisp/apel-VERSION/", you should add that
174 ;; name using the configure option "--with-addpath=".
175 ;; And also the directory where the EMU modules are installed, for
176 ;; example "/usr/local/share/mule/19.34/site-lisp/", it should be
177 ;; included in the standard `load-path' or added by the configure
178 ;; option "--with-addpath=".
179 (let ((path (or (locate-library "path-util")
180 (locate-library "apel/path-util")));; backward compat.
184 (when (string-match "/$" (setq path (file-name-directory path)))
185 (setq path (substring path 0 (match-beginning 0))))
186 ;; path == "/var/home/john/lisp/apel-VERSION"
187 (when (string-match "/$" (setq parent (file-name-directory path)))
188 (setq parent (substring path 0 (match-beginning 0))))
189 ;; parent == "/var/home/john/lisp"
190 (if (setq lpath (or (member path load-path)
191 (member (file-name-as-directory path) load-path)))
192 (unless (or (member parent load-path)
193 (member (file-name-as-directory parent) load-path))
194 (push parent (cdr lpath)))
195 (push path load-path)
196 (unless (or (member parent load-path)
197 (member (file-name-as-directory parent) load-path))
198 (push parent (cdr load-path))))
199 (require 'path-util))
201 APEL modules are not found in %s.
202 Try to re-configure with --with-addpath=APEL_PATH and run make again.
206 (unless (locate-library "mel")
208 (unless (module-installed-p 'mel)
209 ;; FLIM 1.14 may have installed in two "flim" subdirectories.
210 (push (expand-file-name "flim"
211 (file-name-directory (get-latest-path "^apel$" t)))
213 (unless (module-installed-p 'mel)
215 FLIM modules does not found in %s.
216 Try to re-configure with --with-addpath=FLIM_PATH and run make again.
221 (push srcdir load-path)
222 (load (expand-file-name "lpath.el" srcdir) nil t t)
224 (load (expand-file-name "gnus-clfns.el" srcdir) nil t t)
228 ;; Bind functions defined by `defun-maybe'.
229 (put 'defun-maybe 'byte-hunk-handler 'byte-compile-file-form-defun-maybe)
230 (defun byte-compile-file-form-defun-maybe (form)
231 (if (and (not (fboundp (nth 1 form)))
232 (memq 'unresolved byte-compile-warnings))
233 (setq byte-compile-function-environment
234 (cons (cons (nth 1 form)
235 (cons 'lambda (cdr (cdr form))))
236 byte-compile-function-environment)))
240 :symbol-for-testing-whether-colon-keyword-is-available-or-not
242 (defun dgnushack-bind-colon-keywords ()
243 "Bind all the colon keywords for old Emacsen."
244 (let ((cache (expand-file-name "dgnuskwds.el" srcdir))
245 (makefile (expand-file-name "Makefile" srcdir))
246 (buffer (get-buffer-create " *colon keywords*"))
247 keywords ignores files file dirs dir form elem make-backup-files)
250 (let (buffer-file-format
252 insert-file-contents-post-hook
253 insert-file-contents-pre-hook
254 jam-zcat-filename-list
255 jka-compr-compression-info-list)
256 (if (and (file-exists-p cache)
257 (file-exists-p makefile)
258 (file-newer-than-file-p cache makefile))
260 (insert-file-contents cache nil nil nil t)
261 (setq keywords (read buffer)))
264 '(:symbol-for-testing-whether-colon-keyword-is-available-or-not
265 ;; The following keywords will be bound by CUSTOM.
266 :get :group :initialize :link :load :options :prefix
267 :require :set :tag :type)
268 files (list (locate-library "semi-def")
269 (locate-library "mailcap")
270 (locate-library "mime-def")
271 (locate-library "path-util")
272 (locate-library "poem"))
273 dirs (list (file-name-as-directory (expand-file-name srcdir))))
275 (when (setq file (pop files))
276 (setq dir (file-name-directory file))
277 (unless (member dir dirs)
279 (message "Searching for all the colon keywords in:")
281 (setq dir (pop dirs))
282 (message " %s..." dir)
283 (setq files (directory-files dir t
284 "\\.el\\(\\.gz\\|\\.bz2\\)?$"))
286 (setq file (pop files))
287 (if (string-match "\\(\\.gz$\\)\\|\\.bz2$" file)
288 (let ((temp (expand-file-name "dgnustemp.el" srcdir)))
290 (let* ((binary (if (boundp 'MULE)
293 (coding-system-for-read binary)
294 (coding-system-for-write binary)
295 (input-coding-system binary)
296 (output-coding-system binary)
297 (default-process-coding-system
298 (cons binary binary))
300 (insert-file-contents file nil nil nil t)
304 (if (match-beginning 1)
306 (point-min) (point-max)
307 "gzip" t buffer nil "-cd")
309 (point-min) (point-max)
310 "bzip2" t buffer nil "-d"))
314 (message "In file %s: %s" file code)
316 (write-region (point-min) (point-max) temp
320 (insert-file-contents temp nil nil nil t)
321 (delete-file temp))))
322 (insert-file-contents file nil nil nil t))
323 (while (setq form (condition-case nil
327 (setq elem (pop form))
328 (unless (memq (car-safe elem)
330 defcustom defface defgroup
331 define-widget quote))
333 (push (car elem) form)
334 (setq elem (cdr elem)))
338 (eq ?: (aref (symbol-name elem) 0))
339 (not (memq elem ignores))
340 (not (memq elem keywords)))
341 (push elem keywords)))))))
342 (setq keywords (sort keywords
344 (string-lessp (symbol-name a)
347 (insert (format "%s" keywords))
348 (write-region (point-min) (point) cache nil 'silent)
350 "The following colon keywords will be bound at run-time:\n %s"
353 (defconst dgnushack-colon-keywords keywords)
355 (set (car keywords) (car keywords))
356 (setq keywords (cdr keywords)))))
357 (byte-compile 'dgnushack-bind-colon-keywords)
358 (dgnushack-bind-colon-keywords)))
362 (setq :version ':version
363 :set-after ':set-after)
365 (defadvice custom-handle-keyword
366 (around dont-signal-an-error-even-if-unsupported-keyword-is-given
368 "Don't signal an error even if unsupported keyword is given."
369 (if (not (memq (ad-get-arg 1) '(:version :set-after)))
373 (put 'custom-declare-face 'byte-optimizer
374 'byte-optimize-ignore-unsupported-custom-keywords)
375 (put 'custom-declare-group 'byte-optimizer
376 'byte-optimize-ignore-unsupported-custom-keywords)
377 (defun byte-optimize-ignore-unsupported-custom-keywords (form)
378 (if (or (memq ':version (nthcdr 4 form))
379 (memq ':set-after (nthcdr 4 form)))
380 (let ((newform (list (car form) (nth 1 form)
381 (nth 2 form) (nth 3 form)))
382 (args (nthcdr 4 form)))
384 (or (memq (car args) '(:version :set-after))
385 (setq newform (nconc newform (list (car args)
387 (setq args (cdr (cdr args))))
391 (put 'custom-declare-variable 'byte-hunk-handler
392 'byte-compile-file-form-custom-declare-variable)
393 (defun byte-compile-file-form-custom-declare-variable (form)
394 ;; Bind defcustom'ed variables.
395 (if (memq 'free-vars byte-compile-warnings)
396 (setq byte-compile-bound-variables
397 (cons (nth 1 (nth 1 form)) byte-compile-bound-variables)))
398 (if (memq ':version (nthcdr 4 form))
399 ;; Make the variable uncustomizable.
400 `(defvar ,(nth 1 (nth 1 form)) ,(nth 1 (nth 2 form))
401 ,(substring (nth 3 form) (if (string-match "^[\t *]+" (nth 3 form))
404 ;; Ignore unsupported keyword(s).
405 (if (memq ':set-after (nthcdr 4 form))
406 (let ((newform (list (car form) (nth 1 form)
407 (nth 2 form) (nth 3 form)))
408 (args (nthcdr 4 form)))
410 (or (eq (car args) ':set-after)
411 (setq newform (nconc newform (list (car args)
413 (setq args (cdr (cdr args))))
417 ;; Unknown variables and functions.
418 (unless (boundp 'buffer-file-coding-system)
419 (defvar buffer-file-coding-system (symbol-value 'file-coding-system)))
420 (unless (featurep 'xemacs)
421 (defalias 'Custom-make-dependencies 'ignore)
422 (defalias 'update-autoloads-from-directory 'ignore))
424 (defalias 'device-sound-enabled-p 'ignore)
425 (defalias 'play-sound-file 'ignore)
426 (defalias 'nndb-request-article 'ignore)
427 (defalias 'efs-re-read-dir 'ignore)
428 (defalias 'ange-ftp-re-read-dir 'ignore)
429 (defalias 'define-mail-user-agent 'ignore)
431 (defconst dgnushack-unexporting-files
432 (append '("dgnushack.el" "dgnuspath.el" "dgnuskwds.el" "lpath.el")
434 (progn (require 'shimbun) nil)
435 (error '("nnshimbun.el")))
436 (unless (or (condition-case code
439 (message "No w3: %s %s retrying..." code
440 (locate-library "w3-forms"))
442 ;; Maybe mis-configured Makefile is used (e.g.
443 ;; configured for FSFmacs but XEmacs is running).
444 (let ((lp (delete dgnushack-w3-directory
445 (copy-sequence load-path))))
446 (if (let ((load-path lp))
450 ;; If success, fix `load-path' for compiling.
453 (message " => fixed; W3DIR=%s"
455 (locate-library "w3-forms")))
457 (message " => ignored")
459 '("nnweb.el" "nnlistserv.el" "nnultimate.el"
460 "nnslashdot.el" "nnwarchive.el" "webmail.el"
461 "nnwfm.el" "nnrss.el"))
463 (progn (require 'bbdb) nil)
464 (error '("gnus-bbdb.el")))
465 (unless (featurep 'xemacs)
466 '("gnus-xmas.el" "gnus-picon.el" "messagexmas.el"
467 "nnheaderxm.el" "smiley.el"))
468 (when (or (featurep 'xemacs) (<= emacs-major-version 20))
470 (when (and (fboundp 'base64-decode-string)
471 (subrp (symbol-function 'base64-decode-string)))
473 (when (and (fboundp 'md5) (subrp (symbol-function 'md5)))
475 "Files which will not be installed.")
477 (defconst dgnushack-exporting-files
478 (let ((files (directory-files srcdir nil "^[^=].*\\.el$" t)))
479 (dolist (file dgnushack-unexporting-files)
480 (setq files (delete file files)))
481 (sort files 'string-lessp))
482 "Files which will be compiled and installed.")
484 (defun dgnushack-exporting-files ()
485 "Print name of files which will be installed."
486 (princ (mapconcat 'identity dgnushack-exporting-files " ")))
488 (defun dgnushack-compile (&optional warn)
489 ;;(setq byte-compile-dynamic t)
491 (setq byte-compile-warnings
492 '(free-vars unresolved callargs redefine)))
493 (unless (locate-library "cus-edit")
494 (error "You do not seem to have Custom installed.
495 Fetch it from <URL:http://www.dina.kvl.dk/~abraham/custom/>.
496 You also then need to add the following to the lisp/dgnushack.el file:
498 (push \"~/lisp/custom\" load-path)
500 Modify to suit your needs."))
503 (message "load-path=(\"%s\")"
504 (mapconcat 'identity load-path "\"\n \""))
506 (dolist (file dgnushack-exporting-files)
507 (setq file (expand-file-name file srcdir))
508 (when (and (file-exists-p
509 (setq elc (concat (file-name-nondirectory file) "c")))
510 (file-newer-than-file-p file elc))
513 (let ((files dgnushack-exporting-files)
514 ;;(byte-compile-generate-call-tree t)
516 ;; Avoid barfing (from gnus-xmas) because the etc directory is not yet
518 (when (featurep 'xemacs)
519 (setq gnus-xmas-glyph-directory "dummy"))
520 (while (setq file (pop files))
521 (setq file (expand-file-name file srcdir))
522 (when (or (not (file-exists-p
523 (setq elc (concat (file-name-nondirectory file) "c"))))
524 (file-newer-than-file-p file elc))
526 (byte-compile-file file))))))
528 (defun dgnushack-recompile ()
530 (byte-recompile-directory "." 0))
532 (defvar dgnushack-gnus-load-file (expand-file-name "gnus-load.el" srcdir))
533 (defvar dgnushack-cus-load-file (expand-file-name "cus-load.el" srcdir))
534 (defvar dgnushack-auto-load-file (expand-file-name "auto-autoloads.el" srcdir))
536 (defun dgnushack-make-cus-load ()
537 (when (condition-case nil
540 (let ((cusload-base-file dgnushack-cus-load-file))
541 (if (fboundp 'custom-make-dependencies)
542 (custom-make-dependencies)
543 (Custom-make-dependencies)))))
545 (defun dgnushack-make-auto-load ()
547 (unless (make-autoload '(define-derived-mode child parent name
550 (defadvice make-autoload (around handle-define-derived-mode activate)
551 "Handle `define-derived-mode'."
552 (if (eq (car-safe (ad-get-arg 0)) 'define-derived-mode)
553 (setq ad-return-value
555 (list 'quote (nth 1 (ad-get-arg 0)))
557 (nth 4 (ad-get-arg 0))
560 (put 'define-derived-mode 'doc-string-elt 3))
561 (let ((generated-autoload-file dgnushack-gnus-load-file)
562 (make-backup-files nil)
563 (autoload-package-name "gnus"))
564 (if (featurep 'xemacs)
566 (if (file-exists-p generated-autoload-file)
567 (delete-file generated-autoload-file))
568 (if (file-exists-p dgnushack-auto-load-file)
569 (delete-file dgnushack-auto-load-file)))
570 (with-temp-file generated-autoload-file
572 (if (featurep 'xemacs)
573 (let ((si:message (symbol-function 'message)))
574 (defun message (fmt &rest args)
575 (cond ((and (string-equal "Generating autoloads for %s..." fmt)
576 (file-exists-p (file-name-nondirectory (car args))))
578 fmt (file-name-nondirectory (car args))))
579 ((string-equal "No autoloads found in %s" fmt))
580 ((string-equal "Generating autoloads for %s...done" fmt))
581 (t (apply si:message fmt args))))
583 (batch-update-autoloads)
584 (fset 'message si:message)))
585 (batch-update-autoloads))))
587 (defun dgnushack-make-load ()
588 (message (format "Generating %s..." dgnushack-gnus-load-file))
589 (with-temp-file dgnushack-gnus-load-file
590 (if (file-exists-p dgnushack-cus-load-file)
592 (insert-file-contents dgnushack-cus-load-file)
593 (delete-file dgnushack-cus-load-file)
594 (goto-char (point-min))
595 (search-forward ";;; Code:")
597 (delete-region (point-min) (point))
598 (unless (re-search-forward "\
599 ^[\t ]*(autoload[\t\n ]+\\('\\|(quote[\t\n ]+\\)custom-add-loads[\t\n ]"
601 (insert "\n(autoload 'custom-add-loads \"cus-load\")\n"))
602 (goto-char (point-min))
604 ;;; gnus-load.el --- automatically extracted custom dependencies and autoload
608 (goto-char (point-max))
609 (if (search-backward "custom-versions-load-alist" nil t)
612 (while (eq (char-after) ?\;)
615 (delete-region (point) (point-max))
618 ;;; gnus-load.el --- automatically extracted autoload
622 ;; smiley-* are duplicated. Remove them all.
623 (let ((point (point)))
624 (insert-file-contents dgnushack-gnus-load-file)
626 (while (search-forward "smiley-" nil t)
628 (if (looking-at "(autoload ")
629 (delete-region (point) (progn (forward-sexp) (point)))
632 (goto-char (point-max))
633 (when (search-backward "\n(provide " nil t)
635 (delete-region (point) (point-max)))
638 \(provide 'gnus-load)
641 ;;; version-control: never
642 ;;; no-byte-compile: t
643 ;;; no-update-autoloads: t
645 ;;; gnus-load.el ends here\n"))
646 (message (format "Compiling %s..." dgnushack-gnus-load-file))
647 (byte-compile-file dgnushack-gnus-load-file))
650 (defun dgnushack-compose-package ()
651 "Re-split the file gnus-load.el into custom-load.el and
652 auto-autoloads.el. It is silly, should be improved!"
654 Re-splitting gnus-load.el into custom-load.el and auto-autoloads.el...")
655 (let ((customload (expand-file-name "custom-load.el" srcdir))
656 (autoloads (expand-file-name "auto-autoloads.el" srcdir))
659 (insert-file-contents dgnushack-gnus-load-file)
660 (delete-file dgnushack-gnus-load-file)
661 (when (file-exists-p (concat dgnushack-gnus-load-file "c"))
662 (delete-file (concat dgnushack-gnus-load-file "c")))
664 (looking-at "[\t ;]")
668 ;;; custom-load.el --- automatically extracted custom dependencies\n
670 (goto-char (point-max))
673 (not (looking-at "[\t ]*(custom-add-loads[\t\n ]"))))
676 (insert "\n;;; custom-load.el ends here\n")
677 (write-region start (point) customload)
678 (while (looking-at "[\t ]*$")
681 (if (re-search-forward "^[\t\n ]*(if[\t\n ]+(featurep[\t\n ]" nil t)
682 (let ((from (goto-char (match-beginning 0))))
683 (delete-region from (progn
687 (while (looking-at "[\t ;]")
689 (insert "(if (featurep 'gnus-autoloads) (error \"Already loaded\"))\n")
690 (goto-char (point-max))
693 (not (looking-at "[\t ]*(provide[\t\n ]"))))
694 (insert "(provide 'gnus-autoloads)\n")
695 (write-region start (point) autoloads))
696 (byte-compile-file customload)
697 (byte-compile-file autoloads))
699 Re-splitting gnus-load.el into custom-load.el and auto-autoloads.el...done
703 (defconst dgnushack-info-file-regexp-en
704 (let ((names '("gnus" "message" "emacs-mime"))
706 (while (setq name (pop names))
707 (setq regexp (concat regexp "^" name "\\.info\\(-[0-9]+\\)?$"
708 (when names "\\|"))))
710 "Regexp matching English info files.")
712 (defconst dgnushack-info-file-regexp-ja
713 (let ((names '("gnus-ja" "message-ja"))
715 (while (setq name (pop names))
716 (setq regexp (concat regexp "^" name "\\.info\\(-[0-9]+\\)?$"
717 (when names "\\|"))))
719 "Regexp matching Japanese info files.")
721 (defun dgnushack-remove-extra-files-in-package ()
722 "Remove extra files in the lisp directory of the XEmacs package."
723 (let ((lisp-dir (expand-file-name (concat "lisp/"
725 (cadr command-line-args-left)
728 (car command-line-args-left))))
729 (when (file-directory-p lisp-dir)
731 (dolist (file dgnushack-exporting-files)
732 (setq files (nconc files (list file (concat file "c")))))
733 (dolist (file (directory-files lisp-dir nil nil t t))
734 (unless (member file files)
735 (setq file (expand-file-name file lisp-dir))
736 (message "Removing %s..." file)
741 (defun dgnushack-install-package-manifest ()
742 "Install MANIFEST file as an XEmacs package."
743 (let* ((package-dir (car command-line-args-left))
744 (product-name (cadr command-line-args-left))
745 (name (expand-file-name (concat "pkginfo/MANIFEST." product-name)
748 (message "Generating %s..." name)
750 (insert "pkginfo/MANIFEST." product-name "\n")
751 (let ((lisp-dir (concat "lisp/" product-name "/"))
752 (files (sort (directory-files "." nil "\\.elc?$" t) 'string-lessp))
754 (while (setq file (pop files))
755 (unless (member file dgnushack-unexporting-files)
756 (insert lisp-dir file "\n")))
758 (sort (directory-files "../texi/" nil
759 (concat dgnushack-info-file-regexp-en
761 dgnushack-info-file-regexp-ja)
764 (while (setq file (pop files))
765 (insert "info/" file "\n"))))))
768 (define-compiler-macro describe-key-briefly (&whole form key &optional insert)
769 (if (condition-case nil
771 (describe-key-briefly '((())) nil)
773 (wrong-number-of-arguments nil);; Old Emacsen.
778 (insert (funcall 'describe-key-briefly ,key))
779 (funcall 'describe-key-briefly ,key))
780 `(funcall 'describe-key-briefly ,key))))
782 ;;; dgnushack.el ends here