forked from melton1968/math
-
Notifications
You must be signed in to change notification settings - Fork 0
/
math-link.el
31 lines (22 loc) · 1002 Bytes
/
math-link.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
(defconst math-l--target-index 0 "The target element to be indented.")
(defconst math-l--source-index 1 "The source element relative to which indent.")
(defconst math-l--offset-index 2 "The relative offset.")
(defconst math-l--start-index 3 "Link to start of source element.")
(defconst math-l--last-index 4 "The number of slots.")
(defun math-link (target source offset &optional start)
"Create an indentation link for target relative to source."
(let ((new-obj (make-vector math-l--last-index nil)))
(aset new-obj math-l--target-index target)
(aset new-obj math-l--source-index source)
(aset new-obj math-l--offset-index offset)
(aset new-obj math-l--start-index start)
new-obj))
(defun math-link-target (link)
(aref link math-l--target-index))
(defun math-link-source (link)
(aref link math-l--source-index))
(defun math-link-offset (link)
(aref link math-l--offset-index))
(defun math-link-start (link)
(aref link math-l--start-index))
(provide 'math-link)