forked from JKRT/modelica-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
executable file
·141 lines (102 loc) · 4.26 KB
/
README
File metadata and controls
executable file
·141 lines (102 loc) · 4.26 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
This directory contains extensions for Emacs supporting Modelica.
Modelica is a unified object-oriented language for physical systems modeling
(see http://www.Modelica.org).
This code has been written for use with Emacs and shares its licensing (See COPYING).
Emacs lisp code
===============
modelica-mode.el -- major mode for editing Modelica files
mdc-browse.el -- Modelica extension for the OO-Browser
br-mdc.el (see http://sourceforge.net/projects/oo-browser)
Installation
============
See the files modelica-mode.el and mdc-browse.el for installation
instuctions.
At least put the files
modelica-mode.el
mdc-browse.el
br-mdc.el
to an Emacs lisp directory, e.g. ~/elisp
and add the following lines to your file ~/.emacs
;; Modelica mode
(setq load-path (cons "~/elisp" load-path))
(autoload 'modelica-mode "modelica-mode" "Modelica Editing Mode" t)
(setq auto-mode-alist (cons '("\.mo$" . modelica-mode) auto-mode-alist))
;; Enable Modelica browsing
(autoload 'mdc-browse "mdc-browse" "Modelica Class Browsing" t)
(autoload 'br-mdc "br-mdc" "Modelica Class Browsing" t)
(defvar br-env-lang-avector
'[
("C++/C" . "c++-")
("Eiffel" . "eif-")
("Info" . "info-")
("Java" . "java-")
("Lisp" . "clos-")
("Modelica" . "mdc-")
("Obj-C" . "objc-")
("Python" . "python-")
]
"Association vector of elements of OO-Browser languages.")
;; Autostart OO-Browser (the installation is assumed under ~/oo-browser)
(setq load-path (append
'("~/oo-browser/"
"~/oo-browser/hypb/")
load-path))
(load "br-start")
(global-set-key "\C-c\C-o" 'oo-browser)
Modelica mode for Emacs
=======================
The aim is to provide basic support as known from many programming
languages under Emacs. This includes proper indentation, automated
closing of code blocks, movement by statements and code blocks,
support for writing comments, and syntax highlighting.
Tutorial introduction into OO-Browser for Modelica
==================================================
The following steps should be helpful to start investigating
OO-Browser for Modelica without the need to read its documentation
before. Please follow the installation instructions given above first.
Source files to browse can be placed in multiple directories, which
are grouped into library directories (for stable code to be re-used)
and system directories (for code under development). For now we will
just work with one system directory. Copy Modelica code examples there.
Now start Emacs and open one of the files in your directory.
-> select the menu item <OO-Browser -> Create-or-Load-Env>
It is prompted for the environment name.
-> Choose a name, e.g. hello-world.
It is prompted for the file to store class information in.
-> confirm the default name OOBR
Now you must choose a language to work with.
-> select Modelica
Finally specify system and library directories
(specify the current directory "." as the only system directory)
Hit RET to specify the code directories for the Environment
-> Return
Top-level system-specific code dir #1 (RET to end):
-> . Return
Top-level system-specific code dir #2 (RET to end):
-> Return
Top-level reusable code library dir #1 (RET to end):
-> Return
Now OO-Browser is ready to scan your Modelica files
Build Environment 'hello-world now? (y or n)
-> y
Build Environment in the background? (y or n)
-> n
Now all Modelica code files in the specified directories are scanned.
Afterwards a list with all obtained classes appears. Some basic
operations are:
- show ancestors and descendants of a class,
e.g. click on a listed class name to show its definition,
hit the "a" key to show ancestors
(hit the "x" key to return to the list of all classes
if ancestors were found)
hit the "d" key to show descendants
- obtain information about classes
e.g. hit the "i" key to obtain the class location and documentation
- view and edit class implementations
e.g. hit the "v" key to view the implementation of a class
hit the "e" key to edit the implementation of a class
- view class definition by clicking the Action Key
(shift-left mouse button or shift-middle mouse button)
over a class name in any buffer showing a Modelica file
Have fun!
Ruediger Franke <rfranke@users.sourceforge.net>