forked from latte-int/latte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
latte.el
121 lines (96 loc) · 4 KB
/
latte.el
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
114
115
116
117
118
119
120
;;; latte.el --- Emacs editing helpers for the LattE project
;;;
;;; Copyright 2006 Matthias Koeppe
;;;
;;; This file is part of LattE.
;;;
;;; LattE is free software; you can redistribute it and/or modify it
;;; under the terms of the version 2 of the GNU General Public License
;;; as published by the Free Software Foundation.
;;;
;;; LattE 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 LattE; if not, write to the Free Software Foundation,
;;; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
(defconst ntl-types
'("ZZ" "vec_ZZ" "mat_ZZ"
"RR" "vec_RR" "mat_RR"))
(defconst gmp-types
'("mpz_class" "mpq_class"))
(defconst lidia-types
'("bigint" "bigint_matrix"))
(defconst cddlib-types
'("dd_MatrixPtr" "dd_rowset" "dd_colset" "dd_PolyhedraPtr"
"dd_ErrorType" "dd_SetFamilyPtr"))
(defconst latte-types
'("listCone" "listVector"
"vector" "rationalVector"
"PtrCone" "Cone"
"Integer"
"mpq_vector" "mpz_vector"
"PointsInParallelepipedGenerator" "IntCombEnum"
"NotGenericException"
"BarvinokParameters"
"Vertex" "Polyhedron"
"ConeConsumer"))
(setq c++-font-lock-extra-types
(cons (regexp-opt (append ntl-types latte-types gmp-types lidia-types cddlib-types))
c++-font-lock-extra-types))
(if load-file-name
(let ((directory (file-name-directory load-file-name)))
(if (file-exists-p (concat directory "TAGS"))
(visit-tags-table directory))))
(add-to-list 'auto-insert-alist
'(("\\.\\([Hh]\\|hh\\|hpp\\)\\'" . "C++ header")
"Short description: "
(progn (c++-mode)
"// This is a -*- C++ -*- header file.
/* ") (file-name-nondirectory buffer-file-name) " -- " str "
Copyright " (substring (current-time-string) -4) " " (user-full-name) "
This file is part of LattE.
LattE is free software; you can redistribute it and/or modify it
under the terms of the version 2 of the GNU General Public License
as published by the Free Software Foundation.
LattE 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 LattE; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
"
"#ifndef " (upcase (concat (file-name-nondirectory (substring buffer-file-name 0 (match-beginning 0)))
"_"
(substring buffer-file-name (1+ (match-beginning 0)))))
"
"
"#define " (upcase (concat (file-name-nondirectory (substring buffer-file-name 0 (match-beginning 0)))
"_"
(substring buffer-file-name (1+ (match-beginning 0)))))
"
" _ "
#endif"))
(add-to-list 'auto-insert-alist
'(("\\.\\(cpp\\)\\'" . "C++ source file")
"Short description: "
"/* "
(file-name-nondirectory buffer-file-name) " -- " str "
Copyright " (substring (current-time-string) -4) " " (user-full-name) "
This file is part of LattE.
LattE is free software; you can redistribute it and/or modify it
under the terms of the version 2 of the GNU General Public License
as published by the Free Software Foundation.
LattE 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 LattE; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
"))