Mercurial > emacs
annotate lisp/cedet/ede/srecode.el @ 105843:4e4705fae3d0
(todo-add-category): Don't hardcode point-min==1.
(todo-top-priorities): Only display-buffer when called interactively.
(todo-item-start): Don't save excursion point.
(todo-item-end): Be slightly more careful. Add `include-sep' arg.
(todo-insert-item-here, todo-file-item, todo-remove-item):
Adjust uses of todo-item-start and todo-item-end.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 03 Nov 2009 22:24:34 +0000 |
parents | 5b8c8cd21526 |
children | 1d1d5d9bd884 |
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 |
105278 | 3 ;; Copyright (C) 2008, 2009 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) |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
46 (srecode-load-tables-for-mode 'makefile-mode 'ede)) |
104502
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 (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
|
49 "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
|
50 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
|
51 context:templatename |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 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
|
53 updated in FORMS." |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 `(let* ((dict (srecode-create-dictionary)) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 (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
|
56 ,template |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 nil |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 'ede)) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 ) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (when (not temp) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (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
|
62 ,template major-mode)) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (srecode-resolve-arguments temp dict) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 ;; 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
|
66 (progn ,@forms) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 (srecode-insert-fcn temp dict) |
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 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (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
|
72 "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
|
73 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
|
74 context:templatename |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 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
|
76 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
|
77 (require 'srecode/insert) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 (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
|
79 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 ;; Add in optional dictionary entries. |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 (while dictionary-entries |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 (srecode-dictionary-set-value dict |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 (car dictionary-entries) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 (car (cdr dictionary-entries))) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 (setq dictionary-entries |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 (cdr (cdr dictionary-entries)))) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 )) |
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 |
105312
1f2049cd0ba8
* emacs-lisp/eieio.el (boolean-p): Deleted.
Chong Yidong <cyd@stupidchicken.com>
parents:
105278
diff
changeset
|
90 (provide 'ede/srecode) |
104502
cdbbb89893d5
lisp/cedet/ede/pmake.el (ede-proj-makefile-create): Require
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 |
105377 | 92 ;; 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
|
93 ;;; ede/srecode.el ends here |