/[climacs]/climacs/packages.lisp
ViewVC logotype

Contents of /climacs/packages.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.116 - (show annotations)
Mon Sep 4 09:00:30 2006 UTC (7 years, 7 months ago) by thenriksen
Branch: MAIN
Changes since 1.115: +11 -1 lines
Added GNU Emacs-style rectangle editing.
1 ;;; -*- Mode: Lisp; Package: COMMON-LISP-USER -*-
2
3 ;;; (c) copyright 2004-2005 by
4 ;;; Robert Strandh (strandh@labri.fr)
5 ;;; (c) copyright 2005 by
6 ;;; Matthieu Villeneuve (matthieu.villeneuve@free.fr)
7 ;;; (c) copyright 2006 by
8 ;;; Troels Henriksen (athas@sigkill.dk)
9
10 ;;; This library is free software; you can redistribute it and/or
11 ;;; modify it under the terms of the GNU Library General Public
12 ;;; License as published by the Free Software Foundation; either
13 ;;; version 2 of the License, or (at your option) any later version.
14 ;;;
15 ;;; This library is distributed in the hope that it will be useful,
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;;; Library General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU Library General Public
21 ;;; License along with this library; if not, write to the
22 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;;; Boston, MA 02111-1307 USA.
24
25 ;;; Package definitions for the Climacs editor.
26
27 (in-package :cl-user)
28
29 (defpackage :climacs-buffer
30 (:use :clim-lisp :flexichain :binseq)
31 (:export #:buffer #:standard-buffer
32 #:mark #:left-sticky-mark #:right-sticky-mark
33 #:standard-left-sticky-mark #:standard-right-sticky-mark
34 #:clone-mark
35 #:no-such-offset #:offset-before-beginning #:offset-after-end
36 #:invalid-motion #:motion-before-beginning #:motion-after-end
37 #:size #:number-of-lines
38 #:offset #:mark< #:mark<= #:mark= #:mark> #:mark>=
39 #:forward-object
40 #:backward-object
41 #:forward-line-start #:backward-line-start
42 #:forward-line-end #:backward-line-end
43 #:beginning-of-buffer #:end-of-buffer
44 #:beginning-of-buffer-p #:end-of-buffer-p
45 #:beginning-of-line #:end-of-line
46 #:beginning-of-line-p #:end-of-line-p
47 #:buffer-line-number #:buffer-column-number
48 #:line-number #:column-number
49 #:insert-buffer-object #:insert-buffer-sequence
50 #:buffer-substring
51 #:insert-object #:insert-sequence
52 #:delete-buffer-range #:delete-range
53 #:delete-region
54 #:buffer-object #:buffer-sequence
55 #:object-before #:object-after #:region-to-sequence
56 #:low-mark #:high-mark #:modified-p #:clear-modify
57 #:binseq-buffer #:obinseq-buffer #:binseq2-buffer
58 #:persistent-left-sticky-mark #:persistent-right-sticky-mark
59 #:persistent-left-sticky-line-mark #:persistent-right-sticky-line-mark
60 #:p-line-mark-mixin #:buffer-line-offset
61 #:delegating-buffer #:implementation)
62 (:documentation "An implementation of the Climacs buffer
63 protocol. This package is quite low-level, not syntax-aware,
64 not CLIM-aware and not user-oriented at all."))
65
66 (defpackage :climacs-kill-ring
67 (:use :clim-lisp :flexichain)
68 (:export #:kill-ring
69 #:empty-kill-ring
70 #:kill-ring-length #:kill-ring-max-size
71 #:append-next-p
72 #:reset-yank-position #:rotate-yank-position #:kill-ring-yank
73 #:kill-ring-standard-push #:kill-ring-concatenating-push
74 #:kill-ring-reverse-concatenating-push
75 #:*kill-ring*)
76 (:documentation "An implementation of a kill ring."))
77
78 (defpackage :climacs-base
79 (:use :clim-lisp :climacs-buffer :climacs-kill-ring :esa-buffer)
80 (:export #:as-offsets
81 #:do-buffer-region
82 #:do-buffer-region-lines
83 #:previous-line #:next-line
84 #:open-line
85 #:delete-line
86 #:empty-line-p
87 #:line-indentation
88 #:buffer-display-column
89 #:number-of-lines-in-region
90 #:constituentp
91 #:just-n-spaces
92 #:move-to-column
93 #:buffer-whitespacep
94 #:buffer-region-case
95 #:name-mixin #:name
96 #:buffer-looking-at #:looking-at
97 #:buffer-search-forward #:buffer-search-backward
98 #:buffer-re-search-forward #:buffer-re-search-backward
99 #:search-forward #:search-backward
100 #:re-search-forward #:re-search-backward
101 #:downcase-buffer-region #:downcase-region
102 #:upcase-buffer-region #:upcase-region
103 #:capitalize-buffer-region #:capitalize-region
104 #:tabify-region #:untabify-region)
105 (:documentation "Basic functionality built on top of the buffer
106 protocol. Here is where we define slightly higher level
107 functions, that can be directly implemented in terms of the
108 buffer protocol, but that are not, strictly speaking, part of
109 that protocol. The functions in this package are not
110 syntax-aware, and are thus limited in what they can do. They
111 percieve the buffer as little more than a sequence of
112 characters."))
113
114 (defpackage :climacs-abbrev
115 (:use :clim-lisp :clim :climacs-buffer :climacs-base)
116 (:export #:abbrev-expander #:dictionary-abbrev-expander #:dictionary
117 #:expand-abbrev #:abbrev-mixin #:possibly-expand-abbrev
118 #:add-abbrev))
119
120 (defpackage :climacs-syntax
121 (:use :clim-lisp :clim :climacs-buffer :climacs-base :flexichain)
122 (:export #:syntax #:define-syntax #:*default-syntax*
123 #:eval-option
124 #:define-option-for-syntax
125 #:current-attributes-for-syntax
126 #:make-attribute-line
127 #:syntax-from-name
128 #:update-syntax #:update-syntax-for-display
129 #:grammar #:grammar-rule #:add-rule
130 #:parser #:initial-state
131 #:advance-parse
132 #:parse-tree #:start-offset #:end-offset
133 #:lexer #:nb-lexemes #:lexeme #:insert-lexeme
134 #:incremental-lexer #:next-lexeme
135 #:delete-invalid-lexemes #:inter-lexeme-object-p
136 #:skip-inter-lexeme-objects #:update-lex
137 #:parse-stack-top #:target-parse-tree #:parse-state-empty-p
138 #:parse-stack-next #:parse-stack-symbol
139 #:parse-stack-parse-trees #:map-over-parse-trees
140 #:no-such-operation #:no-expression
141 #:name-for-info-pane
142 #:display-syntax-name
143 #:syntax-line-indentation
144 #:forward-expression #:backward-expression
145 #:eval-defun
146 #:beginning-of-definition #:end-of-definition
147 #:redisplay-pane-with-syntax
148 #:backward-paragraph #:forward-paragraph
149 #:backward-sentence #:forward-sentence
150 #:forward-list #:backward-list
151 #:down-list #:up-list
152 #:backward-down-list #:backward-up-list
153 #:syntax-line-comment-string
154 #:line-comment-region #:comment-region
155 #:line-uncomment-region #:uncomment-region
156 #:word-constituentp
157 #:whitespacep
158 #:page-delimiter
159 #:paragraph-delimiter)
160 (:documentation "The Climacs syntax protocol. Contains
161 functions that can be used to implement higher-level operations
162 on buffer contents."))
163
164 (defpackage :undo
165 (:use :clim-lisp)
166 (:export #:no-more-undo
167 #:undo-tree #:standard-undo-tree
168 #:undo-record #:standard-undo-record
169 #:add-undo #:flip-undo-record #:undo #:redo))
170
171 (defpackage :climacs-pane
172 (:use :clim-lisp :clim :climacs-buffer :climacs-base :climacs-abbrev
173 :climacs-syntax :flexichain :undo :esa-buffer :esa-io)
174 (:export #:climacs-buffer #:needs-saving
175 #:filepath #:file-saved-p #:file-write-time
176 #:read-only-p #:buffer-read-only
177 #:climacs-pane #:point #:mark
178 #:clear-cache
179 #:redisplay-pane #:full-redisplay
180 #:display-cursor
181 #:display-region
182 #:offset-to-screen-position
183 #:page-down #:page-up
184 #:top #:bot
185 #:tab-space-count #:space-width #:tab-width
186 #:indent-tabs-mode
187 #:auto-fill-mode #:auto-fill-column
188 #:isearch-state #:search-string #:search-mark
189 #:search-forward-p #:search-success-p
190 #:isearch-mode #:isearch-states #:isearch-previous-string
191 #:query-replace-state #:string1 #:string2 #:buffers #:mark
192 #:query-replace-mode
193 #:region-visible-p
194 #:with-undo
195 #:url
196 #:climacs-textual-view #:+climacs-textual-view+))
197
198 (defpackage :climacs-motion
199 (:use :clim-lisp :climacs-base :climacs-buffer :climacs-syntax)
200 (:export #:forward-to-word-boundary #:backward-to-word-boundary
201 #:define-motion-fns
202 #:beep-limit-action #:revert-limit-action #:error-limit-action
203 #:motion-limit-error
204 #:make-diligent-motor
205
206 ;; Lines
207 #:forward-one-line
208 #:backward-one-line
209 #:forward-line
210 #:backward-line
211
212 ;; Words
213 #:forward-one-word
214 #:backward-one-word
215 #:forward-word
216 #:backward-word
217
218 ;; Pages
219 #:forward-one-page
220 #:backward-one-page
221 #:forward-page
222 #:backward-page
223
224 ;; Expressions
225 #:forward-one-expression
226 #:backward-one-expression
227 #:forward-expression
228 #:backward-expression
229
230 ;; Definitions
231 #:forward-one-definition
232 #:backward-one-definition
233 #:forward-definition
234 #:backward-definition
235
236 ;; Up
237 #:forward-one-up
238 #:backward-one-up
239 #:forward-up
240 #:backward-up
241
242 ;; Down
243 #:forward-one-down
244 #:backward-one-down
245 #:forward-down
246 #:backward-down
247
248 ;; Paragraphs
249 #:forward-one-paragraph
250 #:backward-one-paragraph
251 #:forward-paragraph
252 #:backward-paragraph
253
254 ;; Sentences
255 #:forward-one-sentence
256 #:backward-one-sentence
257 #:forward-sentence
258 #:backward-sentence)
259 (:documentation "Functions and facilities for moving a mark
260 around by syntactical elements. The functions in this package
261 are syntax-aware, and their behavior is based on the semantics
262 defined by the syntax of the buffer, that the mark they are
263 manipulating belong to. These functions are also directly used
264 to implement the motion commands."))
265
266 (defpackage :climacs-editing
267 (:use :clim-lisp :climacs-base :climacs-buffer
268 :climacs-syntax :climacs-motion :climacs-pane :climacs-kill-ring)
269 (:export #:transpose-objects
270
271 ;; Lines
272 #:forward-delete-line #:backward-delete-line
273 #:forward-kill-line #:backward-kill-line
274 #:transpose-lines
275 #:forward-delete-line-start #:backward-delete-line-start
276 #:forward-kill-line-start #:backward-kill-line-start
277 #:transpose-line-starts
278
279 ;; Words
280 #:forward-delete-word #:backward-delete-word
281 #:forward-kill-word #:backward-kill-word
282 #:transpose-words
283
284 ;; Pages
285 #:forward-delete-page #:backward-delete-page
286 #:forward-kill-page #:backward-kill-page
287 #:transpose-page
288
289 ;; Expressions
290 #:forward-delete-expression #:backward-delete-expression
291 #:forward-kill-expression #:backward-kill-expression
292 #:transpose-expressions
293
294 ;; Definitions
295 #:forward-delete-definition #:backward-delete-definition
296 #:forward-kill-definition #:backward-kill-definition
297 #:transpose-definitions
298
299 ;; Paragraphs
300 #:forward-delete-paragraph #:backward-delete-paragraph
301 #:forward-kill-paragraph #:backward-kill-paragraph
302 #:transpose-paragraphs
303
304 ;; Sentences
305 #:forward-delete-sentence #:backward-delete-sentence
306 #:forward-kill-sentence #:backward-kill-sentence
307 #:transpose-sentences)
308 (:documentation "Functions and facilities for changing the
309 buffer contents by syntactical elements. The functions in this package
310 are syntax-aware, and their behavior is based on the semantics
311 defined by the syntax of the buffer, that the mark they are
312 manipulating belong to. These functions are also directly used
313 to implement the editing commands."))
314
315 (defpackage :climacs-fundamental-syntax
316 (:use :clim-lisp :clim :climacs-buffer :climacs-base
317 :climacs-syntax :flexichain :climacs-pane)
318 (:export #:fundamental-syntax))
319
320 (defpackage :climacs-gui
321 (:use :clim-lisp :clim :climacs-buffer :climacs-base
322 :climacs-abbrev :climacs-syntax :climacs-motion
323 :climacs-kill-ring :climacs-pane :clim-extensions
324 :undo :esa :climacs-editing :climacs-motion :esa-buffer :esa-io)
325 ;;(:import-from :lisp-string)
326 (:export #:climacs ; Frame.
327
328 #:extended-pane
329 #:climacs-info-pane
330 #:typeout-pane
331 #:kill-ring
332
333 ;; GUI functions follow.
334 #:current-window
335 #:current-point
336 #:current-buffer
337 #:current-point
338 #:current-mark
339 #:point
340 #:syntax
341 #:mark
342 #:buffers
343 #:insert-character
344 #:display-window
345 #:split-window
346 #:typeout-window
347 #:delete-window
348 #:other-window
349 #:buffer-pane-p
350
351 ;; Some configuration variables
352 #:*bg-color*
353 #:*fg-color*
354 #:*info-bg-color*
355 #:*info-fg-color*
356 #:*mini-bg-color*
357 #:*mini-fg-color*
358 #:*with-scrollbars*
359
360 ;; The command tables
361 #:global-climacs-table #:keyboard-macro-table #:climacs-help-table
362 #:base-table #:buffer-table #:case-table #:comment-table
363 #:deletion-table #:development-table #:editing-table
364 #:fill-table #:indent-table #:info-table #:marking-table
365 #:movement-table #:pane-table #:search-table #:self-insert-table
366 #:window-table
367
368 ;; Other stuff
369 #:dabbrev-expansion-mark
370 #:original-prefix
371 #:prefix-start-offset
372 #:overwrite-mode
373 #:goal-column
374 ))
375
376 (defpackage :climacs-core
377 (:use :clim-lisp :climacs-base :climacs-buffer :climacs-fundamental-syntax
378 :climacs-syntax :climacs-motion :climacs-pane :climacs-kill-ring
379 :climacs-editing :climacs-gui :clim :climacs-abbrev :esa :esa-buffer :esa-io)
380 (:export #:display-string
381 #:object-equal
382 #:object=
383 #:no-upper-p
384 #:case-relevant-test
385
386 #:goto-position
387 #:goto-line
388
389 #:possibly-fill-line
390 #:insert-character
391 #:back-to-indentation
392 #:delete-horizontal-space
393 #:indent-current-line
394 #:insert-pair
395
396 #:downcase-word #:upcase-word #:capitalize-word
397
398 #:indent-region
399 #:fill-line #:fill-region
400
401 #:indent-line #:delete-indentation
402
403 #:set-syntax
404
405 #:switch-to-buffer
406 #:make-new-buffer
407 #:make-new-named-buffer
408 #:erase-buffer
409 #:kill-buffer
410
411 #:filepath-filename
412 #:update-attribute-line
413 #:evaluate-attribute-line
414 #:directory-pathname-p
415 #:find-file #:find-file-read-only
416 #:directory-of-buffer
417 #:set-visited-filename
418 #:check-file-times
419 #:save-buffer
420
421 #:input-from-stream
422 #:save-buffer-to-stream
423 #:make-buffer-from-stream
424
425 #:*killed-rectangle*
426 #:map-rectangle-lines
427 #:extract-and-delete-rectangle-line
428 #:insert-rectangle-at-mark
429 #:clear-rectangle-line
430 #:open-rectangle-line
431 #:replace-rectangle-line
432 #:insert-in-rectangle-line
433 #:delete-rectangle-line-whitespace)
434 (:documentation "Package for editor functionality that is
435 syntax-aware, but yet not specific to certain
436 syntaxes. Contains stuff like indentation, filling and other
437 features that require a fairly high-level view of the
438 application, but are not solely GUI-specific."))
439
440 (defpackage :climacs-commands
441 (:use :clim-lisp :clim :climacs-base :climacs-buffer
442 :climacs-syntax :climacs-motion :climacs-editing
443 :climacs-gui :esa :climacs-kill-ring :climacs-pane
444 :climacs-abbrev :undo :climacs-core)
445 (:export #:define-motion-commands
446 #:define-deletion-commands
447 #:define-editing-commands)
448 (:documentation "This package is meant to contain Climacs'
449 command definitions, as well as some useful automatic
450 command-defining facilities."))
451
452 (defpackage :climacs-html-syntax
453 (:use :clim-lisp :clim :climacs-buffer :climacs-base
454 :climacs-syntax :flexichain :climacs-pane :climacs-fundamental-syntax))
455
456 (defpackage :climacs-prolog-syntax
457 (:use :clim-lisp :clim :climacs-buffer :climacs-base
458 :climacs-syntax :flexichain :climacs-pane :climacs-core :climacs-fundamental-syntax)
459 (:shadow #:atom #:close #:exp #:integer #:open #:variable))
460
461 (defpackage :climacs-cl-syntax
462 (:use :clim-lisp :clim :climacs-buffer :climacs-base
463 :climacs-syntax :flexichain :climacs-pane :climacs-fundamental-syntax)
464 (:export))
465
466 (defpackage :climacs-lisp-syntax
467 (:use :clim-lisp :clim :clim-extensions :climacs-buffer :climacs-base
468 :climacs-syntax :climacs-fundamental-syntax :flexichain :climacs-pane :climacs-gui
469 :climacs-motion :climacs-editing :climacs-core)
470 (:export #:lisp-string
471 #:edit-definition))
472
473 (defpackage :climacs
474 (:use :clim-lisp :clim :clim-sys :clim-extensions :climacs-gui)
475 (:export #:climacs
476 #:climacs-rv
477 #:edit-definition)
478 (:documentation "Package containing entry points to Climacs."))

  ViewVC Help
Powered by ViewVC 1.1.5