File: psgml-maint.el

package info (click to toggle)
psgml 1.2.1-9
  • links: PTS
  • area: main
  • in suites: potato
  • size: 984 kB
  • ctags: 885
  • sloc: lisp: 8,783; sh: 490; makefile: 167
file content (101 lines) | stat: -rw-r--r-- 3,093 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
;;; psgml-maint.el --- Help functions to maintain PSGML source

;; Copyright (C) 1996 Lennart Staflin

;; Author: Lennart Staflin <lenst@lysator.liu.se>
;; Version: $Id: psgml-maint.el,v 1.4 1998/11/15 19:34:41 lenst Exp $
;; Keywords: 
;; Last edited: 1996-11-14 17:26:31 lenst

;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 1, or (at your option)
;;; any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; A copy of the GNU General Public License can be obtained from this
;;; program's author (send electronic mail to lenst@lysator.liu.se) or from
;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
;;; 02139, USA.
;;;


;;; Commentary:

;; This file contanins commands used during installation and
;; compilation of psgml.

;; psgml-compile-files	Compiles the source files. The version of
;;			Emacs used for compilation will determine
;;			what files are compiled.


;;; Code:

(require 'bytecomp)

(defconst psgml-common-files
  '("psgml.el" "psgml-parse.el" "psgml-edit.el" "psgml-dtd.el" 
    "psgml-info.el" "psgml-charent.el" "psgml-api.el"))

(defconst psgml-emacs-files '("psgml-other.el"))
(defconst psgml-xemacs-files '("psgml-lucid.el"))
(defvar psgml-source-dir nil)

(defconst psgml-elisp-source
  (append psgml-common-files
	  (cond ((or (string-match "Lucid" emacs-version)
		     (string-match "XEmacs" emacs-version))
		 psgml-xemacs-files)
		(t
		 psgml-emacs-files))))


(defun psgml-find-source-dir (&optional ask)
  (if psgml-source-dir
      t 
    (let ((cand (list "." "./psgml-1.1.6")))
      (while cand
	(if (file-exists-p (expand-file-name "psgml-maint.el" (car cand)))
	    (progn
	      (setq psgml-source-dir (expand-file-name "." (car cand))
		    cand nil))
	  (setq cand (cdr cand))))
      (if (null psgml-source-dir)
	  (if ask
	      (setq psgml-source-dir
		    (expand-file-name
		     (read-file-name "Where is the psgml source? "
				     nil nil t)))
	    (error "No psgml source in current directory"))))))


(defun psgml-compile-files ()
  "Compile the PSGML source files that needs compilation."
  (interactive)
  (psgml-find-source-dir (interactive-p))
  (let ((default-directory psgml-source-dir)
	(load-path (cons psgml-source-dir load-path)))
    (mapcar (function psgml-byte-compile-file)
	    psgml-elisp-source)
    (message "Done compiling")))


(defun psgml-byte-compile-file (file)
  (let ((dest (byte-compile-dest-file file)))
    (if (file-newer-than-file-p file dest)
	(byte-compile-file file))))

(defun psgml-install-elc ()
  "Print list of elc files to install"
  (let ((destdir (car command-line-args-left)))
    (princ (mapconcat (function byte-compile-dest-file)
		      psgml-elisp-source " "))))


;;; psgml-maint.el ends here