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.
183 (when (string-match "/$" (setq path (file-name-directory path)))
184 (setq path (substring path 0 (match-beginning 0))))
185 ;; path == "/var/home/john/lisp/apel-VERSION"
186 (unless (or (member path load-path)
187 (member (file-name-as-directory path) load-path))
188 (push path load-path))
189 (when (string-match "/$" (setq path (file-name-directory path)))
190 (setq path (substring path 0 (match-beginning 0))))
191 ;; path == "/var/home/john/lisp"
192 (unless (or (member path load-path)
193 (member (file-name-as-directory path) load-path))
194 (push path (cdr load-path)))
195 (require 'path-util))
197 APEL modules are not found in %s.
198 Try to re-configure with --with-addpath=APEL_PATH and run make again.
202 (unless (locate-library "mel")
204 (unless (module-installed-p 'mel)
205 ;; FLIM 1.14 may have installed in two "flim" subdirectories.
206 (push (expand-file-name "flim"
207 (file-name-directory (get-latest-path "^apel$" t)))
209 (unless (module-installed-p 'mel)
211 FLIM modules does not found in %s.
212 Try to re-configure with --with-addpath=FLIM_PATH and run make again.
217 (push srcdir load-path)
218 (load (expand-file-name "lpath.el" srcdir) nil t t)
220 (load (expand-file-name "gnus-clfns.el" srcdir) nil t t)
224 ;; Bind functions defined by `defun-maybe'.
225 (put 'defun-maybe 'byte-hunk-handler 'byte-compile-file-form-defun-maybe)
226 (defun byte-compile-file-form-defun-maybe (form)
227 (if (and (not (fboundp (nth 1 form)))
228 (memq 'unresolved byte-compile-warnings))
229 (setq byte-compile-function-environment
230 (cons (cons (nth 1 form)
231 (cons 'lambda (cdr (cdr form))))
232 byte-compile-function-environment)))
236 :symbol-for-testing-whether-colon-keyword-is-available-or-not
238 (defun dgnushack-bind-colon-keywords ()
239 "Bind all the colon keywords for old Emacsen."
240 (let ((cache (expand-file-name "dgnuskwds.el" srcdir))
241 (makefile (expand-file-name "Makefile" srcdir))
242 (buffer (get-buffer-create " *colon keywords*"))
243 keywords ignores files file dirs dir form elem make-backup-files)
246 (let (buffer-file-format
248 insert-file-contents-post-hook
249 insert-file-contents-pre-hook
250 jam-zcat-filename-list
251 jka-compr-compression-info-list)
252 (if (and (file-exists-p cache)
253 (file-exists-p makefile)
254 (file-newer-than-file-p cache makefile))
256 (insert-file-contents cache nil nil nil t)
257 (setq keywords (read buffer)))
260 '(:symbol-for-testing-whether-colon-keyword-is-available-or-not
261 ;; The following keywords will be bound by CUSTOM.
262 :get :group :initialize :link :load :options :prefix
263 :require :set :tag :type)
264 files (list (locate-library "semi-def")
265 (locate-library "mailcap")
266 (locate-library "mime-def")
267 (locate-library "path-util")
268 (locate-library "poem"))
269 dirs (list (file-name-as-directory (expand-file-name srcdir))))
271 (when (setq file (pop files))
272 (setq dir (file-name-directory file))
273 (unless (member dir dirs)
275 (message "Searching for all the colon keywords in:")
277 (setq dir (pop dirs))
278 (message " %s..." dir)
279 (setq files (directory-files dir t
280 "\\.el\\(\\.gz\\|\\.bz2\\)?$"))
282 (setq file (pop files))
283 (if (string-match "\\(\\.gz$\\)\\|\\.bz2$" file)
284 (let ((temp (expand-file-name "dgnustemp.el" srcdir)))
286 (let* ((binary (if (boundp 'MULE)
289 (coding-system-for-read binary)
290 (coding-system-for-write binary)
291 (input-coding-system binary)
292 (output-coding-system binary)
293 (default-process-coding-system
294 (cons binary binary))
296 (insert-file-contents file nil nil nil t)
300 (if (match-beginning 1)
302 (point-min) (point-max)
303 "gzip" t buffer nil "-cd")
305 (point-min) (point-max)
306 "bzip2" t buffer nil "-d"))
310 (message "In file %s: %s" file code)
312 (write-region (point-min) (point-max) temp
316 (insert-file-contents temp nil nil nil t)
317 (delete-file temp))))
318 (insert-file-contents file nil nil nil t))
319 (while (setq form (condition-case nil
323 (setq elem (pop form))
324 (unless (memq (car-safe elem)
326 defcustom defface defgroup
327 define-widget quote))
329 (push (car elem) form)
330 (setq elem (cdr elem)))
334 (eq ?: (aref (symbol-name elem) 0))
335 (not (memq elem ignores))
336 (not (memq elem keywords)))
337 (push elem keywords)))))))
338 (setq keywords (sort keywords
340 (string-lessp (symbol-name a)
343 (insert (format "%s" keywords))
344 (write-region (point-min) (point) cache nil 'silent)
346 "The following colon keywords will be bound at run-time:\n %s"
349 (defconst dgnushack-colon-keywords keywords)
351 (set (car keywords) (car keywords))
352 (setq keywords (cdr keywords)))))
353 (byte-compile 'dgnushack-bind-colon-keywords)
354 (dgnushack-bind-colon-keywords)))
358 (setq :version ':version
359 :set-after ':set-after)
361 (defadvice custom-handle-keyword
362 (around dont-signal-an-error-even-if-unsupported-keyword-is-given
364 "Don't signal an error even if unsupported keyword is given."
365 (if (not (memq (ad-get-arg 1) '(:version :set-after)))
369 (put 'custom-declare-face 'byte-optimizer
370 'byte-optimize-ignore-unsupported-custom-keywords)
371 (put 'custom-declare-group 'byte-optimizer
372 'byte-optimize-ignore-unsupported-custom-keywords)
373 (defun byte-optimize-ignore-unsupported-custom-keywords (form)
374 (if (or (memq ':version (nthcdr 4 form))
375 (memq ':set-after (nthcdr 4 form)))
376 (let ((newform (list (car form) (nth 1 form)
377 (nth 2 form) (nth 3 form)))
378 (args (nthcdr 4 form)))
380 (or (memq (car args) '(:version :set-after))
381 (setq newform (nconc newform (list (car args)
383 (setq args (cdr (cdr args))))
387 (put 'custom-declare-variable 'byte-hunk-handler
388 'byte-compile-file-form-custom-declare-variable)
389 (defun byte-compile-file-form-custom-declare-variable (form)
390 ;; Bind defcustom'ed variables.
391 (if (memq 'free-vars byte-compile-warnings)
392 (setq byte-compile-bound-variables
393 (cons (nth 1 (nth 1 form)) byte-compile-bound-variables)))
394 (if (memq ':version (nthcdr 4 form))
395 ;; Make the variable uncustomizable.
396 `(defvar ,(nth 1 (nth 1 form)) ,(nth 1 (nth 2 form))
397 ,(substring (nth 3 form) (if (string-match "^[\t *]+" (nth 3 form))
400 ;; Ignore unsupported keyword(s).
401 (if (memq ':set-after (nthcdr 4 form))
402 (let ((newform (list (car form) (nth 1 form)
403 (nth 2 form) (nth 3 form)))
404 (args (nthcdr 4 form)))
406 (or (eq (car args) ':set-after)
407 (setq newform (nconc newform (list (car args)
409 (setq args (cdr (cdr args))))
413 ;; Unknown variables and functions.
414 (unless (boundp 'buffer-file-coding-system)
415 (defvar buffer-file-coding-system (symbol-value 'file-coding-system)))
416 (unless (featurep 'xemacs)
417 (defalias 'Custom-make-dependencies 'ignore)
418 (defalias 'update-autoloads-from-directory 'ignore))
420 (defalias 'device-sound-enabled-p 'ignore)
421 (defalias 'play-sound-file 'ignore)
422 (defalias 'nndb-request-article 'ignore)
423 (defalias 'efs-re-read-dir 'ignore)
424 (defalias 'ange-ftp-re-read-dir 'ignore)
425 (defalias 'define-mail-user-agent 'ignore)
427 (defconst dgnushack-unexporting-files
428 (append '("dgnushack.el" "dgnuspath.el" "dgnuskwds.el" "lpath.el")
430 (progn (require 'shimbun) nil)
431 (error '("nnshimbun.el")))
432 (unless (or (condition-case code
435 (message "No w3: %s %s retrying..." code
436 (locate-library "w3-forms"))
438 ;; Maybe mis-configured Makefile is used (e.g.
439 ;; configured for FSFmacs but XEmacs is running).
440 (let ((lp (delete dgnushack-w3-directory
441 (copy-sequence load-path))))
442 (if (let ((load-path lp))
446 ;; If success, fix `load-path' for compiling.
449 (message " => fixed; W3DIR=%s"
451 (locate-library "w3-forms")))
453 (message " => ignored")
455 '("nnweb.el" "nnlistserv.el" "nnultimate.el"
456 "nnslashdot.el" "nnwarchive.el" "webmail.el"
457 "nnwfm.el" "nnrss.el"))
459 (progn (require 'bbdb) nil)
460 (error '("gnus-bbdb.el")))
461 (unless (featurep 'xemacs)
462 '("gnus-xmas.el" "gnus-picon.el" "messagexmas.el"
463 "nnheaderxm.el" "smiley.el"))
464 (when (or (featurep 'xemacs) (<= emacs-major-version 20))
466 (when (and (fboundp 'base64-decode-string)
467 (subrp (symbol-function 'base64-decode-string)))
469 (when (and (fboundp 'md5) (subrp (symbol-function 'md5)))
471 "Files which will not be installed.")
473 (defconst dgnushack-exporting-files
474 (let ((files (directory-files srcdir nil "^[^=].*\\.el$" t)))
475 (dolist (file dgnushack-unexporting-files)
476 (setq files (delete file files)))
477 (sort files 'string-lessp))
478 "Files which will be compiled and installed.")
480 (defun dgnushack-exporting-files ()
481 "Print name of files which will be installed."
482 (princ (mapconcat 'identity dgnushack-exporting-files " ")))
484 (defun dgnushack-compile (&optional warn)
485 ;;(setq byte-compile-dynamic t)
487 (setq byte-compile-warnings
488 '(free-vars unresolved callargs redefine)))
489 (unless (locate-library "cus-edit")
490 (error "You do not seem to have Custom installed.
491 Fetch it from <URL:http://www.dina.kvl.dk/~abraham/custom/>.
492 You also then need to add the following to the lisp/dgnushack.el file:
494 (push \"~/lisp/custom\" load-path)
496 Modify to suit your needs."))
499 (message "load-path=(\"%s\")"
500 (mapconcat 'identity load-path "\"\n \""))
502 (dolist (file dgnushack-exporting-files)
503 (setq file (expand-file-name file srcdir))
504 (when (and (file-exists-p
505 (setq elc (concat (file-name-nondirectory file) "c")))
506 (file-newer-than-file-p file elc))
509 (let ((files dgnushack-exporting-files)
510 ;;(byte-compile-generate-call-tree t)
512 ;; Avoid barfing (from gnus-xmas) because the etc directory is not yet
514 (when (featurep 'xemacs)
515 (setq gnus-xmas-glyph-directory "dummy"))
516 (while (setq file (pop files))
517 (setq file (expand-file-name file srcdir))
518 (when (or (not (file-exists-p
519 (setq elc (concat (file-name-nondirectory file) "c"))))
520 (file-newer-than-file-p file elc))
522 (byte-compile-file file))))))
524 (defun dgnushack-recompile ()
526 (byte-recompile-directory "." 0))
528 (defvar dgnushack-gnus-load-file (expand-file-name "gnus-load.el" srcdir))
529 (defvar dgnushack-cus-load-file (expand-file-name "cus-load.el" srcdir))
530 (defvar dgnushack-auto-load-file (expand-file-name "auto-autoloads.el" srcdir))
532 (defun dgnushack-make-cus-load ()
533 (when (condition-case nil
536 (let ((cusload-base-file dgnushack-cus-load-file))
537 (if (fboundp 'custom-make-dependencies)
538 (custom-make-dependencies)
539 (Custom-make-dependencies)))))
541 (defun dgnushack-make-auto-load ()
543 (let ((generated-autoload-file dgnushack-gnus-load-file)
544 (make-backup-files nil)
545 (autoload-package-name "gnus"))
546 (if (featurep 'xemacs)
548 (if (file-exists-p generated-autoload-file)
549 (delete-file generated-autoload-file))
550 (if (file-exists-p dgnushack-auto-load-file)
551 (delete-file dgnushack-auto-load-file)))
552 (with-temp-file generated-autoload-file
554 (if (featurep 'xemacs)
555 (let ((si:message (symbol-function 'message)))
556 (defun message (fmt &rest args)
557 (cond ((and (string-equal "Generating autoloads for %s..." fmt)
558 (file-exists-p (file-name-nondirectory (car args))))
560 fmt (file-name-nondirectory (car args))))
561 ((string-equal "No autoloads found in %s" fmt))
562 ((string-equal "Generating autoloads for %s...done" fmt))
563 (t (apply si:message fmt args))))
565 (batch-update-autoloads)
566 (fset 'message si:message)))
567 (batch-update-autoloads))))
569 (defun dgnushack-make-load ()
570 (message (format "Generating %s..." dgnushack-gnus-load-file))
571 (with-temp-file dgnushack-gnus-load-file
572 (if (file-exists-p dgnushack-cus-load-file)
574 (insert-file-contents dgnushack-cus-load-file)
575 (delete-file dgnushack-cus-load-file)
576 (goto-char (point-min))
577 (search-forward ";;; Code:")
579 (delete-region (point-min) (point))
580 (unless (re-search-forward "\
581 ^[\t ]*(autoload[\t\n ]+\\('\\|(quote[\t\n ]+\\)custom-add-loads[\t\n ]"
583 (insert "\n(autoload 'custom-add-loads \"cus-load\")\n"))
584 (goto-char (point-min))
586 ;;; gnus-load.el --- automatically extracted custom dependencies and autoload
590 (goto-char (point-max))
591 (if (search-backward "custom-versions-load-alist" nil t)
594 (while (eq (char-after) ?\;)
597 (delete-region (point) (point-max))
600 ;;; gnus-load.el --- automatically extracted autoload
604 ;; smiley-* are duplicated. Remove them all.
605 (let ((point (point)))
606 (insert-file-contents dgnushack-gnus-load-file)
608 (while (search-forward "smiley-" nil t)
610 (if (looking-at "(autoload ")
611 (delete-region (point) (progn (forward-sexp) (point)))
614 (goto-char (point-max))
615 (when (search-backward "\n(provide " nil t)
617 (delete-region (point) (point-max)))
620 \(provide 'gnus-load)
623 ;;; version-control: never
624 ;;; no-byte-compile: t
625 ;;; no-update-autoloads: t
627 ;;; gnus-load.el ends here\n"))
628 (message (format "Compiling %s..." dgnushack-gnus-load-file))
629 (byte-compile-file dgnushack-gnus-load-file))
632 (defun dgnushack-compose-package ()
633 "Re-split the file gnus-load.el into custom-load.el and
634 auto-autoloads.el. It is silly, should be improved!"
636 Re-splitting gnus-load.el into custom-load.el and auto-autoloads.el...")
637 (let ((customload (expand-file-name "custom-load.el" srcdir))
638 (autoloads (expand-file-name "auto-autoloads.el" srcdir))
641 (insert-file-contents dgnushack-gnus-load-file)
642 (delete-file dgnushack-gnus-load-file)
643 (when (file-exists-p (concat dgnushack-gnus-load-file "c"))
644 (delete-file (concat dgnushack-gnus-load-file "c")))
646 (looking-at "[\t ;]")
650 ;;; custom-load.el --- automatically extracted custom dependencies\n
652 (goto-char (point-max))
655 (not (looking-at "[\t ]*(custom-add-loads[\t\n ]"))))
658 (insert "\n;;; custom-load.el ends here\n")
659 (write-region start (point) customload)
660 (while (looking-at "[\t ]*$")
663 (if (re-search-forward "^[\t\n ]*(if[\t\n ]+(featurep[\t\n ]" nil t)
664 (let ((from (goto-char (match-beginning 0))))
665 (delete-region from (progn
669 (while (looking-at "[\t ;]")
671 (insert "(if (featurep 'gnus-autoloads) (error \"Already loaded\"))\n")
672 (goto-char (point-max))
675 (not (looking-at "[\t ]*(provide[\t\n ]"))))
676 (insert "(provide 'gnus-autoloads)\n")
677 (write-region start (point) autoloads))
678 (byte-compile-file customload)
679 (byte-compile-file autoloads))
681 Re-splitting gnus-load.el into custom-load.el and auto-autoloads.el...done
685 (defconst dgnushack-info-file-regexp-en
686 (let ((names '("gnus" "message" "emacs-mime"))
688 (while (setq name (pop names))
689 (setq regexp (concat regexp "^" name "\\.info\\(-[0-9]+\\)?$"
690 (when names "\\|"))))
692 "Regexp matching English info files.")
694 (defconst dgnushack-info-file-regexp-ja
695 (let ((names '("gnus-ja" "message-ja"))
697 (while (setq name (pop names))
698 (setq regexp (concat regexp "^" name "\\.info\\(-[0-9]+\\)?$"
699 (when names "\\|"))))
701 "Regexp matching Japanese info files.")
703 (defun dgnushack-remove-extra-files-in-package ()
704 "Remove extra files in the lisp directory of the XEmacs package."
705 (let ((lisp-dir (expand-file-name (concat "lisp/"
707 (cadr command-line-args-left)
710 (car command-line-args-left))))
711 (when (file-directory-p lisp-dir)
713 (dolist (file dgnushack-exporting-files)
714 (setq files (nconc files (list file (concat file "c")))))
715 (dolist (file (directory-files lisp-dir nil nil t t))
716 (unless (member file files)
717 (setq file (expand-file-name file lisp-dir))
718 (message "Removing %s..." file)
723 (defun dgnushack-install-package-manifest ()
724 "Install MANIFEST file as an XEmacs package."
725 (let* ((package-dir (car command-line-args-left))
726 (product-name (cadr command-line-args-left))
727 (name (expand-file-name (concat "pkginfo/MANIFEST." product-name)
730 (message "Generating %s..." name)
732 (insert "pkginfo/MANIFEST." product-name "\n")
733 (let ((lisp-dir (concat "lisp/" product-name "/"))
734 (files (sort (directory-files "." nil "\\.elc?$" t) 'string-lessp))
736 (while (setq file (pop files))
737 (unless (member file dgnushack-unexporting-files)
738 (insert lisp-dir file "\n")))
740 (sort (directory-files "../texi/" nil
741 (concat dgnushack-info-file-regexp-en
743 dgnushack-info-file-regexp-ja)
746 (while (setq file (pop files))
747 (insert "info/" file "\n"))))))
750 (define-compiler-macro describe-key-briefly (&whole form key &optional insert)
751 (if (condition-case nil
753 (describe-key-briefly '((())) nil)
755 (wrong-number-of-arguments nil);; Old Emacsen.
760 (insert (funcall 'describe-key-briefly ,key))
761 (funcall 'describe-key-briefly ,key))
762 `(funcall 'describe-key-briefly ,key))))
764 ;;; dgnushack.el ends here