-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelisp-comp.in
113 lines (93 loc) · 3.55 KB
/
elisp-comp.in
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
102
103
104
105
106
107
108
109
110
111
112
113
;;; -*- Emacs-Lisp -*-
;; Copyright (C) 2002 TSUCHIYA Masatoshi <[email protected]>
;; Author: TSUCHIYA Masatoshi <[email protected]>
;; Keywords: info
;; This file is a part of mode-info.
;; 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 2, 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.
;; You should have received a copy of the GNU General Public License
;; along with this program; if not, you can either send email to this
;; program's maintainer or write to: The Free Software Foundation,
;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
;;; Commentary:
;; This file provides the stuffs to build mode-info.
;;; Code:
(and (boundp 'emacs-major-version)
(>= emacs-major-version 20)
(fboundp 'set-language-environment)
(set-language-environment "Japanese"))
(let ((addpath "@ADDITIONAL_LOAD_PATH@"))
(or (string= addpath "NONE")
(string= addpath (concat "@" "ADDITIONAL_LOAD_PATH" "@"))
(let (dir buf)
(while (string-match "\\([^\0-\37:]+\\)[\0-\37:]*" addpath)
(setq dir (file-name-as-directory
(expand-file-name (substring addpath
(match-beginning 1)
(match-end 1))))
addpath (substring addpath (match-end 0)))
(if (file-directory-p dir)
(setq buf (cons dir buf))))
(if buf
(setq load-path (nconc (nreverse buf) load-path))))))
(setq load-path (cons default-directory load-path))
(require 'bytecomp)
(cond
((featurep 'xemacs)
;; Don't warn for the unused non-global variables.
(setq byte-compile-warnings
(delq 'unused-vars (copy-sequence byte-compile-default-warnings))))
((boundp 'MULE)
(require 'poe)
(require 'pcustom)
;; Workaround to avoid byte-compile warnings around defcustom.
(fset 'elisp-comp-defcustom (symbol-function 'defcustom))
(defmacro defcustom (symbol value doc &rest args)
(list 'eval-and-compile
(nconc (list 'elisp-comp-defcustom symbol value doc)
args)))))
(defun elisp-comp-version ()
(require 'mode-info)
(princ mode-info-version t))
(defun elisp-comp-target ()
(let ((sources (directory-files default-directory nil "\\`mi-.*\\.el\\'"))
(head '("mi-util.el" "mode-info.el" "mi-index.el"))
(last '("mi-fontify.el" "mi-config.el"))
(x))
(setq x (append head last))
(while x
(setq sources (delete (car x) sources)
x (cdr x)))
(setq x (nconc head sources last))
(if (boundp 'MULE)
(setq x (delete "mi-fontify.el" x)))
(while x
(princ (concat (car x) "c\n") t)
(setq x (cdr x)))))
(defvar Info-additional-directory-list nil)
(defun elisp-comp-index ()
(let ((addpath "@ADDITIONAL_INFO_PATH@"))
(or (string= addpath "NONE")
(string= addpath (concat "@" "ADDITIONAL_INFO_PATH" "@"))
(let (dir buf)
(while (string-match "\\([^\0-\37:]+\\)[\0-\37:]*" addpath)
(setq dir (file-name-as-directory
(expand-file-name (substring addpath
(match-beginning 1)
(match-end 1))))
addpath (substring addpath (match-end 0)))
(if (file-directory-p dir)
(setq buf (cons dir buf))))
(if buf
(setq Info-additional-directory-list
(nconc (nreverse buf)
Info-additional-directory-list))))))
(require 'mi-index)
(mode-info-make-all-indices))
;;; elisp-comp.in ends here