comparison lisp/hyperbole/kotl/klink.el @ 36:c53a95d3c46d r19-15b101

Import from CVS: tag r19-15b101
author cvs
date Mon, 13 Aug 2007 08:53:38 +0200
parents 4103f0995bd7
children 131b0175ea99
comparison
equal deleted inserted replaced
35:279432d5c479 36:c53a95d3c46d
6 ;; KEYWORDS: extensions, hypermedia, outlines, wp 6 ;; KEYWORDS: extensions, hypermedia, outlines, wp
7 ;; 7 ;;
8 ;; AUTHOR: Bob Weiner & Kellie Clark 8 ;; AUTHOR: Bob Weiner & Kellie Clark
9 ;; 9 ;;
10 ;; ORIG-DATE: 15-Nov-93 at 12:15:16 10 ;; ORIG-DATE: 15-Nov-93 at 12:15:16
11 ;; LAST-MOD: 6-Jan-97 at 19:00:58 by Bob Weiner 11 ;; LAST-MOD: 6-Mar-97 at 01:19:19 by Bob Weiner
12 ;; 12 ;;
13 ;; DESCRIPTION: 13 ;; DESCRIPTION:
14 ;; 14 ;;
15 ;;; link = 15 ;;; link =
16 ;; < pathname [, cell-ref] [, position] > 16 ;; < pathname [, cell-ref] [, position] >
63 63
64 ;;;###autoload 64 ;;;###autoload
65 (defun klink:create (reference) 65 (defun klink:create (reference)
66 "Insert at point an implicit link to REFERENCE. 66 "Insert at point an implicit link to REFERENCE.
67 REFERENCE should be a cell-ref or a string containing \"filename, cell-ref\". 67 REFERENCE should be a cell-ref or a string containing \"filename, cell-ref\".
68 See documentation for 'kcell:ref-to-id' for valid cell-ref formats." 68 See documentation for `kcell:ref-to-id' for valid cell-ref formats."
69 (interactive 69 (interactive
70 ;; Don't change the name or delete default-dir used here. It is referenced 70 ;; Don't change the name or delete default-dir used here. It is referenced
71 ;; in "hargs.el" for argument getting. 71 ;; in "hargs.el" for argument getting.
72 (let ((default-dir default-directory)) 72 (let ((default-dir default-directory))
73 (barf-if-buffer-read-only) 73 (barf-if-buffer-read-only)
96 (setq file-ref (substring file-ref (match-end 0)))) 96 (setq file-ref (substring file-ref (match-end 0))))
97 (insert "<" file-ref) 97 (insert "<" file-ref)
98 (if cell-ref (insert ", " cell-ref)) 98 (if cell-ref (insert ", " cell-ref))
99 (insert ">")) 99 (insert ">"))
100 (cell-ref (insert "<@ " cell-ref ">")) 100 (cell-ref (insert "<@ " cell-ref ">"))
101 (t (error "(klink:create) Invalid reference, '%s'" reference))))) 101 (t (error "(klink:create) Invalid reference, `%s'" reference)))))
102 102
103 (defun klink:at-p () 103 (defun klink:at-p ()
104 "Return non-nil iff point is within a klink. 104 "Return non-nil iff point is within a klink.
105 See documentation for the `actypes::link-to-kotl' function for valid klink 105 See documentation for the `actypes::link-to-kotl' function for valid klink
106 formats. Value returned is a list of: link-label, link-start-position, and 106 formats. Value returned is a list of: link-label, link-start-position, and
159 LINK may be of any of the following forms, with or without delimiters: 159 LINK may be of any of the following forms, with or without delimiters:
160 < pathname [, cell-ref] > 160 < pathname [, cell-ref] >
161 < [-!&] pathname > 161 < [-!&] pathname >
162 < @ cell-ref > 162 < @ cell-ref >
163 163
164 See documentation for 'kcell:ref-to-id' for valid cell-ref formats." 164 See documentation for `kcell:ref-to-id' for valid cell-ref formats."
165 165
166 (interactive "sKotl link specifier: ") 166 (interactive "sKotl link specifier: ")
167 (or (stringp link) (error "(link-to-kotl): Non-string link argument, %s" 167 (or (stringp link) (error "(link-to-kotl): Non-string link argument, %s"
168 link)) 168 link))
169 (cond 169 (cond
214 pathname, cell-ref 214 pathname, cell-ref
215 cell-ref 215 cell-ref
216 |viewspec 216 |viewspec
217 :augment-viewspec (ignored for now) 217 :augment-viewspec (ignored for now)
218 218
219 See documentation for 'kcell:ref-to-id' for valid cell-ref formats." 219 See documentation for `kcell:ref-to-id' for valid cell-ref formats."
220 220
221 (or (stringp reference) 221 (or (stringp reference)
222 (error "(klink:parse): Non-string reference argument, %s" 222 (error "(klink:parse): Non-string reference argument, %s"
223 reference)) 223 reference))
224 (cond 224 (cond