Mercurial > emacs
annotate lisp/cedet/ede/srecode.el @ 110621:c13750cbdbc5
tar-mode.el (tar-header-block-tokenize): Decode filenames in "ustar" format.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Mon, 27 Sep 2010 14:01:48 +0900 |
parents | b150a06c6999 |
children | 376148b31b5e |
rev | line source |
---|---|
105312
1f2049cd0ba8
* emacs-lisp/eieio.el (boolean-p): Deleted.
Chong Yidong <cyd@stupidchicken.com>
parents:
105278
diff
changeset
|
1 ;;; ede/srecode.el --- EDE utilities on top of SRecoder |
104502
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
106815 | 3 ;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. |
104502
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
4 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 ;; This file is part of GNU Emacs. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 ;; GNU Emacs is free software: you can redistribute it and/or modify |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 ;; it under the terms of the GNU General Public License as published by |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; the Free Software Foundation, either version 3 of the License, or |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; (at your option) any later version. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 ;; GNU Emacs is distributed in the hope that it will be useful, |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; GNU General Public License for more details. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; You should have received a copy of the GNU General Public License |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 ;;; Commentary: |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 ;; |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;; EDE utilities for using SRecode to generate project files, such as |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; Makefiles. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 (require 'srecode) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 (declare-function srecode-create-dictionary "srecode/dictionary") |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 (declare-function srecode-dictionary-set-value "srecode/dictionary") |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 (declare-function srecode-load-tables-for-mode "srecode/find") |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 (declare-function srecode-table "srecode/find") |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 (declare-function srecode-template-get-table "srecode/find") |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 (declare-function srecode-insert-fcn "srecode/insert") |
105278 | 35 (declare-function srecode-resolve-arguments "srecode/insert") |
104502
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 (declare-function srecode-map-update-map "srecode/map") |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 ;;; Code: |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 (defun ede-srecode-setup () |
105406
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
40 "Initialize Srecode for EDE." |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
41 (require 'srecode/map) |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
42 (require 'srecode/find) |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
43 (srecode-map-update-map t) |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
44 ;; We don't call this unless we need it. Load in the templates. |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
45 (srecode-load-tables-for-mode 'makefile-mode) |
110526
b150a06c6999
Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
46 (srecode-load-tables-for-mode 'makefile-mode 'ede) |
b150a06c6999
Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
47 (srecode-load-tables-for-mode 'autoconf-mode) |
b150a06c6999
Synch EDE to CEDET 1.0.
Chong Yidong <cyd@stupidchicken.com>
parents:
106815
diff
changeset
|
48 (srecode-load-tables-for-mode 'autoconf-mode 'ede)) |
104502
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 (defmacro ede-srecode-insert-with-dictionary (template &rest forms) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 "Insert TEMPLATE after executing FORMS with a dictionary. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 TEMPLATE should specify a context by using a string format of: |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 context:templatename |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 Locally binds the variable DICT to a dictionary which can be |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 updated in FORMS." |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 `(let* ((dict (srecode-create-dictionary)) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 (temp (srecode-template-get-table (srecode-table) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 ,template |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 nil |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 'ede)) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 ) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (when (not temp) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (error "EDE template %s for %s not found!" |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 ,template major-mode)) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 (srecode-resolve-arguments temp dict) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 ;; Now execute forms for updating DICT. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 (progn ,@forms) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 (srecode-insert-fcn temp dict) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 )) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 (defun ede-srecode-insert (template &rest dictionary-entries) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 "Insert at the current point TEMPLATE. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 TEMPLATE should specify a context by using a string format of: |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 context:templatename |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 Add DICTIONARY-ENTRIES into the dictionary before insertion. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 Note: Just like `srecode-insert', but templates found in 'ede app." |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 (require 'srecode/insert) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 (ede-srecode-insert-with-dictionary template |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 ;; Add in optional dictionary entries. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 (while dictionary-entries |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 (srecode-dictionary-set-value dict |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 (car dictionary-entries) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 (car (cdr dictionary-entries))) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 (setq dictionary-entries |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 (cdr (cdr dictionary-entries)))) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 )) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 |
105312
1f2049cd0ba8
* emacs-lisp/eieio.el (boolean-p): Deleted.
Chong Yidong <cyd@stupidchicken.com>
parents:
105278
diff
changeset
|
92 (provide 'ede/srecode) |
104502
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 |
105377 | 94 ;; arch-tag: 75bec542-7cc8-41a4-b5a0-8fb247609f03 |
105312
1f2049cd0ba8
* emacs-lisp/eieio.el (boolean-p): Deleted.
Chong Yidong <cyd@stupidchicken.com>
parents:
105278
diff
changeset
|
95 ;;; ede/srecode.el ends here |