annotate lisp/cedet/ede/srecode.el @ 112453:06719a229a46 default tip

* calc/calc.el (calc-default-power-reference-level) (calc-default-field-reference-level): New variables. * calc/calc-units.el (math-standard-units): Add dB and Np. (math-logunits): New variable. (math-extract-logunits, math-logcombine, calcFunc-luplus) (calcFunc-luminus, calc-luplus, calc-luminus, math-logunit-level) (calcFunc-fieldlevel, calcFunc-powerlevel, calc-level): New functions. (math-find-base-units-rec): Add entry for ln(10). * calc/calc-help.el (calc-u-prefix-help): Add logarithmic help. (calc-ul-prefix-help): New function. * calc/calc-ext.el (calc-init-extensions): Autoload new units functions. Add keybindings for new units functions.
author Jay Belanger <jay.p.belanger@gmail.com>
date Sun, 23 Jan 2011 23:08:04 -0600
parents ef719132ddfa
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
112218
376148b31b5e Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents: 110526
diff changeset
3 ;; Copyright (C) 2008, 2009, 2010, 2011 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
bde759149ba1 Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 104502
diff changeset
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
105312
1f2049cd0ba8 * emacs-lisp/eieio.el (boolean-p): Deleted.
Chong Yidong <cyd@stupidchicken.com>
parents: 105278
diff changeset
94 ;;; ede/srecode.el ends here