annotate lisp/hyperbole/kotl/kimport.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 376386a54a3c
children c53a95d3c46d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;!emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; FILE: kimport.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; SUMMARY: Convert and insert other outline file formats into koutlines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; USAGE: GNU Emacs V19 Lisp Library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; KEYWORDS: data, outlines, wp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; AUTHOR: Bob Weiner & Kellie Clark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; ORIG-DATE: 15-Nov-93 at 11:57:05
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; LAST-MOD: 1-Nov-95 at 23:19:09 by Bob Weiner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; Other required Elisp libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; kfile.el requires kotl-mode.el which requires kimport.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 (require 'wrolo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; Public variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; kimport:mode-alist and kimport:suffix-alist are defined in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; "../hyperbole.el".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Public functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (defun kimport:file (import-from output-to &optional children-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 "Import a buffer or file IMPORT-FROM into the koutline in buffer or file OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 Any suffix in IMPORT-FROM's buffer name is used to determine the type of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 importation. All others are imported as text, one paragraph per cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 See the documentation for the variable, `kimport:suffix-alist' for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 information on specific importation formats."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (interactive "FImport from buffer/file: \nFInsert into koutline buffer/file: \nP")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (let ((import-buf-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (cond ((or (bufferp import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (get-buffer import-from))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (buffer-name (get-buffer import-from)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ((get-file-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (buffer-name (get-file-buffer import-from)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ((stringp import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (file-name-nondirectory import-from))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (t (error "(kimport:buffer): `%s' is an invalid `import-from' argument"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (function))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (set-buffer import-buf-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (if (setq function (cdr (assq major-mode kimport:mode-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (let ((import-suffix (if (string-match "\\..+\\'" import-buf-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (match-string 0 import-buf-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (suffix-alist kimport:suffix-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 suffix-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (while (and import-suffix suffix-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (setq suffix-regexp (car (car suffix-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 function (cdr (car suffix-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 suffix-alist (cdr suffix-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (if (string-match suffix-regexp import-suffix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (setq function nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (if function nil (setq function (cdr (assq t kimport:mode-alist))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (funcall function import-from output-to children-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ;;; Augment right-side numbered files, blank line between cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (defun kimport:aug-post-outline (import-from output-to &optional children-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 "Insert Augment outline statements from IMPORT-FROM into koutline OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 Displays and leaves point in OUTPUT-TO. See documentation for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 `kimport:initialize' for valid values of IMPORT-FROM and OUTPUT-TO and for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 an explanation of where imported cells are placed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 If OUTPUT-TO is a new koutline, the first statement inserted will be the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 first cell. Otherwise, it will be the successor of the current cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 Each statement to be imported is delimited by an Augment relative id at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 end of the statement. \"1\" = level 1, \"1a\" = level 2 in outline and so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 on."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (interactive "FImport from Augment post-numbered buffer/file: \nFBuffer/file to insert cells into: \nP")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (let ((output-level 1) (klabel "1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 initially-empty-output no-renumber orig-point count total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ;; Don't change the order of import-from and output-to inits here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (setq import-from (kimport:copy-and-set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 output-to (kimport:initialize output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 orig-point (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 initially-empty-output (zerop (- (point-max) (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 no-renumber (or initially-empty-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (not (if children-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (kcell-view:child-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (kcell-view:sibling-p)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (if (eq import-from output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (error "(kimport:aug-post-outline): Import and output buffers may not be the same."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (show-all)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;; Total number of Augement statements.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (setq total (read (count-matches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 " +\\([0-9][0-9a-z]*\\)\n\\(\n\\|\\'\\)")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (if initially-empty-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ;; Insert first cell as sibling of current cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (set-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (if children-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ;; Insert as children.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (progn (setq klabel (klabel:child (kcell-view:label))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 output-level (klabel:level klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ;; Move to end of this cell since cell insertion will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ;; occur at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (goto-char (kcell-view:end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ;; Insert as successors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (setq klabel (klabel:increment (kcell-view:label))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 output-level (klabel:level klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 ;; Move to start of line of next tree since cell insertion will occur
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;; at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (goto-char (kotl-mode:tree-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (setq count (kimport:aug-post-statements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 import-from output-to klabel output-level 1 0 total)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (pop-to-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (kfile:narrow-to-kcells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (if no-renumber nil (klabel-type:update-labels klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (goto-char orig-point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (if (kotl-mode:buffer-empty-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (kotl-mode:to-valid-position))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (message "Imported %d of %d Augment statements." count total)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;;; Emacs outliner style files, leading '*' cell delimiters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (defun kimport:star-outline (import-from output-to &optional children-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 "Insert star outline nodes from IMPORT-FROM into koutline OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 Displays and leaves point in OUTPUT-TO. See documentation for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 `kimport:initialize' for valid values of IMPORT-FROM and OUTPUT-TO and for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 an explanation of where imported cells are placed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 \"* \" = level 1, \"** \" = level 2 in outline and so on."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (interactive "FImport from star delimited cells buffer/file: \nFBuffer/file to insert cells into: \nP")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 (let ((output-level 1) (klabel "1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 initially-empty-output no-renumber orig-point count total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 ;; Don't change the order of import-from and output-to inits here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (setq import-from (kimport:copy-and-set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 output-to (kimport:initialize output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 orig-point (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 initially-empty-output (zerop (- (point-max) (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 no-renumber (or initially-empty-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (not (if children-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (kcell-view:child-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (kcell-view:sibling-p)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (if (eq import-from output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (error "(kimport:star-outline): Import and output buffers may not be the same."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (show-all)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ;; If initial text in buffer is not an star outline node, add a star to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 ;; make it one, so it is not deleted from the import.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (if (not (looking-at "[ \t]*\\*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (insert "* "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ;; Total number of top-level cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (setq total (read (count-matches "^[ \t]*\\*[ \t\n]")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (if initially-empty-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ;; Insert first cell as sibling of current cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (set-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (if children-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ;; Insert as children.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (progn (setq klabel (klabel:child (kcell-view:label))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 output-level (klabel:level klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ;; Move to end of this cell since cell insertion will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ;; occur at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (goto-char (kcell-view:end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ;; Insert as successors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (setq klabel (klabel:increment (kcell-view:label))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 output-level (klabel:level klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ;; Move to start of line of next tree since cell insertion will occur
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ;; at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (goto-char (kotl-mode:tree-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (setq count (kimport:star-entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 import-from output-to klabel output-level 1 0 total)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (pop-to-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (kfile:narrow-to-kcells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (if no-renumber nil (klabel-type:update-labels klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (goto-char orig-point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (if (kotl-mode:buffer-empty-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (kotl-mode:to-valid-position))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (message "Imported %d of %d star outline trees." count total)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ;;; Generic text file import or koutline insertion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ;;;###autoload
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (defun kimport:text (import-from output-to &optional children-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 "Insert text paragraphs from IMPORT-FROM into koutline OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 Displays and leaves point in OUTPUT-TO. See documentation for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 `kimport:initialize' for valid values of IMPORT-FROM and OUTPUT-TO and for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 an explanation of where imported cells are placed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 Text paragraphs are imported as a sequence of same level cells. Koutlines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 are imported with their structure intact.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 The variable, 'paragraph-start,' is used to determine paragraphs."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (interactive "FImport from text/koutline buffer/file: \nFInsert cells into koutline buffer/file: \nP")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (let ((klabel "1") (output-level 1) (count 0) initially-empty-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 no-renumber orig-point total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ;; Don't change the order of import-from and output-to inits here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (setq import-from (kimport:copy-and-set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 output-to (kimport:initialize output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 orig-point (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 initially-empty-output (zerop (- (point-max) (point-min)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 no-renumber (or initially-empty-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (not (if children-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (kcell-view:child-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (kcell-view:sibling-p)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (if (eq import-from output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (error "(kimport:text): Import and output buffers may not be the same."))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (let ((kotl-import (eq major-mode 'kotl-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 visible-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (if initially-empty-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;; Insert first cell as sibling of current cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (set-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (if children-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ;; Insert as children.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (progn (setq klabel (klabel:child (kcell-view:label))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 output-level (klabel:level klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ;; Move to end of this cell since cell insertion will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ;; occur at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (goto-char (kcell-view:end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ;; Insert as successors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (setq klabel (klabel:increment (kcell-view:label))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 output-level (klabel:level klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ;; Move to start of line of next tree since cell insertion will occur
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ;; at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (goto-char (kotl-mode:tree-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (set-buffer import-from))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (if kotl-import
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ;; Importing from a koutline, so handle specially.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (progn (kotl-mode:beginning-of-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ;; Total number of cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (setq total (read (count-matches "[\n\r][\n\r]"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 visible-cells (read (count-matches "\n\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 count (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ;; Incredible non-local exit to ensure that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;; recursion ends at the right time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (catch 'end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (kimport:kcells import-from output-to klabel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 output-level 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 count total)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (show-all)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 ;; Total number of paragraphs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (setq total (read (count-matches paragraph-start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 count (kimport:text-paragraphs import-from output-to klabel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 output-level count total))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (pop-to-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (kfile:narrow-to-kcells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (if no-renumber nil (klabel-type:update-labels klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (goto-char orig-point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (if (kotl-mode:buffer-empty-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (kotl-mode:to-valid-position))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (if kotl-import
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (message "Imported %d of %d visible cells from a %d cell outline."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 count visible-cells total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (message "Imported %d of %d paragraphs." count total)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 ;;; Private functions - Don't call these functions from outside of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ;;; module or you may misuse them and cause data corruption.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 ;;; ************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (defun kimport:aug-label-lessp (label1 label2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 "Return non-nil iff Augment-style LABEL1 is less than LABEL2."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (let ((lev1 (klabel:level-alpha label1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (lev2 (klabel:level-alpha label2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (cond ((< lev1 lev2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 ((= lev1 lev2) (string-lessp label1 label2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (t nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (defun kimport:aug-post-statements (import-from output-to klabel output-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 import-level count total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 "Insert post-numbered Augment statements (contents only) from IMPORT-FROM into existing OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 KLABEL is the label to use for the first imported statement.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 OUTPUT-LEVEL is the level at which to insert the first statement.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 IMPORT-LEVEL is the depth of the current statement in the import file,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 \(initially 1).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 COUNT of inserted cells starts at 0. TOTAL is the total number of statements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 in IMPORT-FROM, used to show a running tally of the imported statements."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (let ((cell-end-regexp " +\\([0-9][0-9a-z]*\\)\n\\(\n+\\|\\'\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 contents start subtree-p end end-contents statement-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 child-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 ;; While find cells at import-level or deeper ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (while (and (setq start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (re-search-forward cell-end-regexp nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (<= import-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (setq statement-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (klabel:level-alpha
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (match-beginning 1) (match-end 1))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (setq end-contents (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 end (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (goto-char start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (skip-chars-forward " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (setq contents (kimport:unindent-region (point) end-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (setq subtree-p (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (if (re-search-forward cell-end-regexp nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (< statement-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (klabel:level-alpha
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (match-beginning 1) (match-end 1)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (set-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 ;; Add the cell starting at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (kview:add-cell klabel output-level contents nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (if subtree-p (setq child-label (klabel:child klabel)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 (message "%d of %d statements converted..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (setq count (1+ count)) total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (setq klabel (klabel:increment klabel)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 ;; Current buffer returns to `import-from' here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 ;; Handle each sub-level through recursion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (if subtree-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 ;; Subtree exists so insert its cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (setq count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (kimport:aug-post-statements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 import-from output-to child-label (1+ output-level)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (1+ import-level) count total))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (goto-char start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (defun kimport:copy-and-set-buffer (source)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 "Copy and untabify SOURCE, set copy buffer as current buffer for this command and return the copy buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 SOURCE may be a buffer name, a buffer or a file name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 If SOURCE buffer name begins with a space, it is not copied under the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 assumption that it already has been. If SOURCE is a koutline, it is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 copied since there is no need to copy it to import it."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ;; This buffer name format is used so that we can easily
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 ;; extract any file name suffix from the buffer name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (setq source (set-buffer (or (get-buffer source)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (find-file-noselect source))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (let ((mode (or (if (boundp 'kotl-previous-mode) kotl-previous-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 major-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 copy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (if (or (eq mode 'kotl-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (= ?\ (aref (buffer-name source) 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 source
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (setq copy (get-buffer-create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (concat " " (if (string-match ".+[|<]" (buffer-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (substring (buffer-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 0 (1- (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 (buffer-name)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (set-buffer copy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (setq buffer-read-only nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 major-mode mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (insert-buffer source)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (untabify (point-min) (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 ;; Ensure buffer ends with a newline so that we don't miss the last
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 ;; element during the import.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (if (/= (preceding-char) ?\n) (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (set-buffer-modified-p nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 copy)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (defun kimport:initialize (output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 "Setup to import elements into koutline OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 Return OUTPUT-TO buffer and set current buffer for the current command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 to OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 OUTPUT-TO may be a buffer, buffer-name or file name. If OUTPUT-TO exists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 already, it must be a koutline or an error will be signaled. For an existing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 OUTPUT-TO, the text cells are inserted after the cell at point or after the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 first cell for a newly loaded koutline. If OUTPUT-TO is nil, the current
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 buffer is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 If OUTPUT-TO is an existing koutline, the first cell imported will be added
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 as the successor of the current cell. If an existing file is read in as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 OUTPUT-TO within this function, point is left at the end of this buffer so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 that imported cells will be appended to the buffer. For a new file, this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 means the first cell imported will become the first outline cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 If a non-nil third argument, CHILDREN-P, is given to the caller of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 function and OUTPUT-TO contains at least one cell, then the imported cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 will be added as children of the cell where this function leaves point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 \(either the current cell or for a newly read in outline, the last cell)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (let* ((output-existing-buffer-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (if output-to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (or (get-buffer output-to) (get-file-buffer output-to))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (output-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (if output-to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (or output-existing-buffer-p (file-exists-p output-to))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 ;; current buffer will be used for output and it exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (setq output-to (if output-to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (or (get-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (find-file-noselect output-to))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 (current-buffer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 (set-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (if output-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (if (eq major-mode 'kotl-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (if (kotl-mode:buffer-empty-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 ;; Make imported cells be appended if the output buffer was
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 ;; just read in.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 (if output-existing-buffer-p nil (goto-char (point-max)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 (kotl-mode:to-valid-position))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 "(kimport:initialize): Second arg, %s, must be a koutline file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (buffer-name output-to)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (if (eq major-mode 'kotl-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (setq kview nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (kotl-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 (delete-region (point-min) (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (defun kimport:kcells (import-from output-to klabel output-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 import-level count total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 "Insert visible koutline cells (contents and attributes) from IMPORT-FROM into existing OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 KLABEL is the label to use for the first imported cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 OUTPUT-LEVEL is the level at which to insert the first cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 IMPORT-LEVEL is the depth of the current cell in the import file,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 \(initially 1).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 COUNT of inserted cells starts at 0. TOTAL is the total number of cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 in IMPORT-FROM, used to show a running tally of the imported cells."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (goto-char (kcell-view:start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (let ((again t) contents subtree-p child-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 ;; While find cells at import-level or deeper ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 (while (<= import-level (kcell-view:level))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (setq subtree-p (kcell-view:child-p nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 contents (kcell-view:contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (goto-char (kcell-view:end-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (set-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 ;; Add the cell starting at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (kview:add-cell klabel output-level contents nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (if subtree-p (setq child-label (klabel:child klabel)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 (message "%d of %d cells inserted..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (setq count (1+ count)) total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 (setq klabel (klabel:increment klabel)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 ;; Current buffer returns to `import-from' here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 ;; Handle each sub-level through recursion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (if (and (setq again (kcell-view:next t)) subtree-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 ;; Subtree exists so insert its cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (setq count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 (kimport:kcells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 import-from output-to child-label (1+ output-level)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 (1+ import-level) count total)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (if again nil (throw 'end count))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (defun kimport:star-entries (import-from output-to klabel output-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 import-level count total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 "Insert visible star outline entries from IMPORT-FROM into existing OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 KLABEL is the label to use for the first imported entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 OUTPUT-LEVEL is the level at which to insert the first entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 IMPORT-LEVEL is the depth of the current entry in the import file,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 \(initially 1).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 COUNT of inserted entries starts at 0. TOTAL is the total number of entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 in IMPORT-FROM, used to show a running tally of the imported entries."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (let ((start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (rolo-entry-regexp "^[ \t]*\\(\\*+\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 subtree-p end contents node-level child-label)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 ;; While find cells at import-level or deeper ...
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 (while (and (re-search-forward rolo-entry-regexp nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (<= import-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (setq node-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (length
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (match-beginning 1) (match-end 1))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (skip-chars-forward " \t")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (setq start (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 end (rolo-to-entry-end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 subtree-p (if (looking-at rolo-entry-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (< node-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (length (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (match-beginning 1) (match-end 1))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (skip-chars-backward "\n\r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (setq contents (kimport:unindent-region start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (set-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 ;; Add the cell starting at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 (kview:add-cell klabel output-level contents nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (if subtree-p (setq child-label (klabel:child klabel)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (message "%d of %d trees converted..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (if (= node-level 1) (setq count (1+ count)) count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (setq klabel (klabel:increment klabel)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 ;; Current buffer returns to `import-from' here.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 ;; Handle each sub-level through recursion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (if subtree-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 ;; Subtree exists so insert its cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 (setq count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (kimport:star-entries import-from output-to child-label
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 (1+ output-level) (1+ import-level)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 count total))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (goto-char start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (defun kimport:text-paragraphs (import-from output-to klabel
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 output-level count total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 "Insert text paragraphs from IMPORT-FROM into existing OUTPUT-TO.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 First cell is inserted with KLABEL at OUTPUT-LEVEL, as the sibling of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 previous cell, with the COUNT of inserted paragraphs starting at 0. TOTAL is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 the total number of paragraphs in IMPORT-FROM, used to show a running tally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 of the imported paragraphs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 The variable, 'paragraph-start' is used to determine paragraphs."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (let* ((count 0) start end contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 ;; Next line is needed when importing into an existing kview.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 ;; Move past blank lines at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 (skip-chars-forward " \t\n\r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (while (and (setq start (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 end (re-search-forward paragraph-start nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (/= start end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (setq contents (kimport:unindent-region start end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (set-buffer output-to)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 ;; Add the cell starting at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (kview:add-cell klabel output-level contents nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (setq count (1+ count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (message "%d of %d paragraphs converted..."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 count total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (setq klabel (klabel:increment klabel))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (set-buffer import-from)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 ;; Move past blank lines separating paragraphs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (skip-chars-forward " \t\n\r")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (beginning-of-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (message "%d of %d paragraphs converted" count total)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (defun kimport:unindent-region (start end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 "Calculate indent based upon the second line within the region START to END.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 Remove the indent and return the remaining region as a string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 (let (indent-regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 (goto-char start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 ;; Remove leading indent from lines in paragraph. Base paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 ;; indent on the 2nd paragraph line since the first line might be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 ;; further indented or outdented.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (setq indent-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (if (re-search-forward "[\n\r][ \t]+" end t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (concat "^" (make-string (current-column) ?\ ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (if indent-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (hypb:replace-match-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 indent-regexp (buffer-substring start end) "" t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (buffer-substring start end)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (provide 'kimport)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588