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

Contents of /climacs/packages.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.109 - (show annotations)
Thu Jul 27 10:39:32 2006 UTC (7 years, 8 months ago) by thenriksen
Branch: MAIN
Changes since 1.108: +1 -0 lines
Updated the kill ring protocol to signal a condition if a yank
operation is attempted on an empty kill ring, updated the kill ring
documentation, added kill ring tests to the test suite.
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)
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 #:buffer-whitespacep
93 #:buffer-region-case
94 #:input-from-stream #:output-to-stream
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
123 #:eval-option
124 #:define-option-for-syntax
125 #:syntax-from-name
126 #:basic-syntax
127 #:update-syntax #:update-syntax-for-display
128 #:grammar #:grammar-rule #:add-rule
129 #:parser #:initial-state
130 #:advance-parse
131 #:parse-tree #:start-offset #:end-offset
132 #:lexer #:nb-lexemes #:lexeme #:insert-lexeme
133 #:incremental-lexer #:next-lexeme
134 #:delete-invalid-lexemes #:inter-lexeme-object-p
135 #:skip-inter-lexeme-objects #:update-lex
136 #:parse-stack-top #:target-parse-tree #:parse-state-empty-p
137 #:parse-stack-next #:parse-stack-symbol
138 #:parse-stack-parse-trees #:map-over-parse-trees
139 #:no-such-operation #:no-expression
140 #:name-for-info-pane
141 #:syntax-line-indentation
142 #:forward-expression #:backward-expression
143 #:eval-defun
144 #:beginning-of-definition #:end-of-definition
145 #:redisplay-pane-with-syntax
146 #:backward-paragraph #:forward-paragraph
147 #:backward-sentence #:forward-sentence
148 #:forward-list #:backward-list
149 #:down-list #:up-list
150 #:backward-down-list #:backward-up-list
151 #:syntax-line-comment-string
152 #:line-comment-region #:comment-region
153 #:line-uncomment-region #:uncomment-region
154 #:word-constituentp
155 #:whitespacep
156 #:page-delimiter
157 #:paragraph-delimiter)
158 (:documentation "The Climacs syntax protocol. Contains
159 functions that can be used to implement higher-level operations
160 on buffer contents."))
161
162 (defpackage :undo
163 (:use :clim-lisp)
164 (:export #:no-more-undo
165 #:undo-tree #:standard-undo-tree
166 #:undo-record #:standard-undo-record
167 #:add-undo #:flip-undo-record #:undo #:redo))
168
169 (defpackage :climacs-pane
170 (:use :clim-lisp :clim :climacs-buffer :climacs-base :climacs-abbrev
171 :climacs-syntax :flexichain :undo)
172 (:export #:climacs-buffer #:needs-saving
173 #:filepath #:file-saved-p #:file-write-time
174 #:read-only-p #:buffer-read-only
175 #:climacs-pane #:point #:mark
176 #:clear-cache
177 #:redisplay-pane #:full-redisplay
178 #:display-cursor
179 #:display-region
180 #:page-down #:page-up
181 #:top #:bot
182 #:tab-space-count #:space-width #:tab-width
183 #:indent-tabs-mode
184 #:auto-fill-mode #:auto-fill-column
185 #:isearch-state #:search-string #:search-mark
186 #:search-forward-p #:search-success-p
187 #:isearch-mode #:isearch-states #:isearch-previous-string
188 #:query-replace-state #:string1 #:string2 #:buffers #:mark
189 #:query-replace-mode
190 #:region-visible-p
191 #:with-undo
192 #:url
193 #:climacs-textual-view #:+climacs-textual-view+))
194
195 (defpackage :climacs-motion
196 (:use :clim-lisp :climacs-base :climacs-buffer :climacs-syntax)
197 (:export #:forward-to-word-boundary #:backward-to-word-boundary
198 #:define-motion-fns
199 #:beep-limit-action #:revert-limit-action #:error-limit-action
200 #:motion-limit-error
201 #:make-diligent-motor
202
203 ;; Lines
204 #:forward-one-line
205 #:backward-one-line
206 #:forward-line
207 #:backward-line
208
209 ;; Words
210 #:forward-one-word
211 #:backward-one-word
212 #:forward-word
213 #:backward-word
214
215 ;; Pages
216 #:forward-one-page
217 #:backward-one-page
218 #:forward-page
219 #:backward-page
220
221 ;; Expressions
222 #:forward-one-expression
223 #:backward-one-expression
224 #:forward-expression
225 #:backward-expression
226
227 ;; Definitions
228 #:forward-one-definition
229 #:backward-one-definition
230 #:forward-definition
231 #:backward-definition
232
233 ;; Up
234 #:forward-one-up
235 #:backward-one-up
236 #:forward-up
237 #:backward-up
238
239 ;; Down
240 #:forward-one-down
241 #:backward-one-down
242 #:forward-down
243 #:backward-down
244
245 ;; Paragraphs
246 #:forward-one-paragraph
247 #:backward-one-paragraph
248 #:forward-paragraph
249 #:backward-paragraph
250
251 ;; Sentences
252 #:forward-one-sentence
253 #:backward-one-sentence
254 #:forward-sentence
255 #:backward-sentence)
256 (:documentation "Functions and facilities for moving a mark
257 around by syntactical elements. The functions in this package
258 are syntax-aware, and their behavior is based on the semantics
259 defined by the syntax of the buffer, that the mark they are
260 manipulating belong to. These functions are also directly used
261 to implement the motion commands."))
262
263 (defpackage :climacs-editing
264 (:use :clim-lisp :climacs-base :climacs-buffer
265 :climacs-syntax :climacs-motion :climacs-pane :climacs-kill-ring)
266 (:export #:transpose-objects
267
268 ;; Lines
269 #:forward-delete-line #:backward-delete-line
270 #:forward-kill-line #:backward-kill-line
271 #:transpose-lines
272 #:forward-delete-line-start #:backward-delete-line-start
273 #:forward-kill-line-start #:backward-kill-line-start
274 #:transpose-line-starts
275
276 ;; Words
277 #:forward-delete-word #:backward-delete-word
278 #:forward-kill-word #:backward-kill-word
279 #:transpose-words
280
281 ;; Pages
282 #:forward-delete-page #:backward-delete-page
283 #:forward-kill-page #:backward-kill-page
284 #:transpose-page
285
286 ;; Expressions
287 #:forward-delete-expression #:backward-delete-expression
288 #:forward-kill-expression #:backward-kill-expression
289 #:transpose-expressions
290
291 ;; Definitions
292 #:forward-delete-definition #:backward-delete-definition
293 #:forward-kill-definition #:backward-kill-definition
294 #:transpose-definitions
295
296 ;; Paragraphs
297 #:forward-delete-paragraph #:backward-delete-paragraph
298 #:forward-kill-paragraph #:backward-kill-paragraph
299 #:transpose-paragraphs
300
301 ;; Sentences
302 #:forward-delete-sentence #:backward-delete-sentence
303 #:forward-kill-sentence #:backward-kill-sentence
304 #:transpose-sentences)
305 (:documentation "Functions and facilities for changing the
306 buffer contents by syntactical elements. The functions in this package
307 are syntax-aware, and their behavior is based on the semantics
308 defined by the syntax of the buffer, that the mark they are
309 manipulating belong to. These functions are also directly used
310 to implement the editing commands."))
311
312 (defpackage :climacs-gui
313 (:use :clim-lisp :clim :climacs-buffer :climacs-base
314 :climacs-abbrev :climacs-syntax :climacs-motion
315 :climacs-kill-ring :climacs-pane :clim-extensions
316 :undo :esa :climacs-editing :climacs-motion)
317 ;;(:import-from :lisp-string)
318 (:export #:climacs ; Frame.
319
320 #:extended-pane
321 #:climacs-info-pane
322 #:typeout-pane
323 #:kill-ring
324
325 ;; GUI functions follow.
326 #:current-window
327 #:current-point
328 #:current-buffer
329 #:current-point
330 #:point
331 #:syntax
332 #:mark
333 #:buffers
334 #:insert-character
335 #:display-window
336 #:split-window
337 #:typeout-window
338 #:delete-window
339 #:other-window
340 #:buffer-pane-p
341
342 ;; Some configuration variables
343 #:*bg-color*
344 #:*fg-color*
345 #:*info-bg-color*
346 #:*info-fg-color*
347 #:*mini-bg-color*
348 #:*mini-fg-color*
349 #:*with-scrollbars*
350
351 ;; The command tables
352 #:global-climacs-table #:keyboard-macro-table #:climacs-help-table
353 #:base-table #:buffer-table #:case-table #:comment-table
354 #:deletion-table #:development-table #:editing-table
355 #:fill-table #:indent-table #:info-table #:marking-table
356 #:movement-table #:pane-table #:search-table #:self-insert-table
357 #:window-table
358
359 ;; Other stuff
360 #:dabbrev-expansion-mark
361 #:original-prefix
362 #:prefix-start-offset
363 #:overwrite-mode
364 #:goal-column
365 ))
366
367 (defpackage :climacs-core
368 (:use :clim-lisp :climacs-base :climacs-buffer
369 :climacs-syntax :climacs-motion :climacs-pane :climacs-kill-ring
370 :climacs-editing :climacs-gui :clim :climacs-abbrev :esa)
371 (:export #:display-string
372 #:object-equal
373 #:object=
374 #:no-upper-p
375 #:case-relevant-test
376
377 #:goto-position
378 #:goto-line
379
380 #:possibly-fill-line
381 #:insert-character
382 #:back-to-indentation
383 #:delete-horizontal-space
384 #:indent-current-line
385 #:insert-pair
386
387 #:downcase-word #:upcase-word #:capitalize-word
388
389 #:indent-region
390 #:fill-line #:fill-region
391
392 #:indent-line #:delete-indentation
393
394 #:set-syntax
395
396 #:switch-to-buffer
397 #:make-buffer
398 #:erase-buffer
399 #:kill-buffer
400
401 #:filepath-filename
402 #:evaluate-attributes-line
403 #:directory-pathname-p
404 #:find-file
405 #:directory-of-buffer
406 #:set-visited-file-name
407 #:check-file-times
408 #:save-buffer)
409 (:documentation "Package for editor functionality that is
410 syntax-aware, but yet not specific to certain
411 syntaxes. Contains stuff like indentation, filling and other
412 features that require a fairly high-level view of the
413 application, but are not solely GUI-specific."))
414
415 (defpackage :climacs-commands
416 (:use :clim-lisp :clim :climacs-base :climacs-buffer
417 :climacs-syntax :climacs-motion :climacs-editing
418 :climacs-gui :esa :climacs-kill-ring :climacs-pane
419 :climacs-abbrev :undo :climacs-core)
420 (:export #:define-motion-commands
421 #:define-deletion-commands
422 #:define-editing-commands)
423 (:documentation "This package is meant to contain Climacs'
424 command definitions, as well as some useful automatic
425 command-defining facilities."))
426
427 (defpackage :climacs-fundamental-syntax
428 (:use :clim-lisp :clim :climacs-buffer :climacs-base
429 :climacs-syntax :flexichain :climacs-pane)
430 (:export #:fundamental-syntax))
431
432 (defpackage :climacs-html-syntax
433 (:use :clim-lisp :clim :climacs-buffer :climacs-base
434 :climacs-syntax :flexichain :climacs-pane))
435
436 (defpackage :climacs-prolog-syntax
437 (:use :clim-lisp :clim :climacs-buffer :climacs-base
438 :climacs-syntax :flexichain :climacs-pane)
439 (:shadow #:atom #:close #:exp #:integer #:open #:variable))
440
441 (defpackage :climacs-cl-syntax
442 (:use :clim-lisp :clim :climacs-buffer :climacs-base
443 :climacs-syntax :flexichain :climacs-pane)
444 (:export))
445
446 (defpackage :climacs-lisp-syntax
447 (:use :clim-lisp :clim :clim-extensions :climacs-buffer :climacs-base
448 :climacs-syntax :flexichain :climacs-pane :climacs-gui
449 :climacs-motion :climacs-editing :climacs-core)
450 (:export #:lisp-string
451 #:edit-definition))
452
453 (defpackage :climacs
454 (:use :clim-lisp :clim :clim-sys :clim-extensions :climacs-gui)
455 (:export #:climacs
456 #:climacs-rv
457 #:edit-definition)
458 (:documentation "Package containing entry points to Climacs."))

  ViewVC Help
Powered by ViewVC 1.1.5