Scheme Under ground Update (Now With More Buffers!)

2 views
Skip to first unread message

Jeff Dlouhy

unread,
May 22, 2009, 11:28:42 PM5/22/09
to edwin-...@googlegroups.com
We are now moving into a different era in porting Edwin. So far most of the work has been in porting the underlying systems and filling in the gaps left from leaving mit-scheme. Those commits are now a thing of the past, nowadays we are finding ourselves untangling the cables of a program written without a module system. The trick is to break up the subsystem into its smaller parts without getting more circular dependencies. We are trying to make a salad out of the 'undefined symbol soup.' The nice thing is that there was not much code that needed to be stubbed out to get buffers up and running.

Along with creating buffers, we can edit them. Once we edit them, we can undo our edits. See the examples below...

= edwin48: (master) =

Here is an example of a buffer (ignore pathnames for now):

(define foo-buff (make-buffer "test-case" (name->mode 'buffer-editor) "/tmp/foo.txt"))
,inspect foo-buff
'#{Buffer}

 [0: %name] "test-case"
 [1: %default-directory] "/tmp/foo.txt"
 [2: %name] "test-case"
 [3: group] '#{Group}
 [4: mark-ring] '#("Ring" 10 (#))
 [5: modes] '(#{Mode})
 [6: comtabs] '(#{Comtab})
 [7: windows] '()
 [8: display-start] #f
 [9: %default-directory] "/tmp/foo.txt"
 [10: %pathname] #f
 [11: %truename] #f
 [12: alist] '()
 [13: local-bindings] '()
 [14: local-bindings-installed?] #f
 [15: auto-save-pathname] #f
 [16: auto-saved?] #f
 [17: %save-length] 0
 [18: backed-up?] #f
 [19: modification-time] #f

inspect: 3
'#{Group}

 [0: buffer] '#{Buffer}
 [1: gap-start] 0
 [2: gap-length] 0
 [3: gap-end] 0
 [4: marks] '#{Weak-pair}
 [5: start-mark] '#{Mark}
 [6: end-mark] '#{Mark}
 [7: writeable?] #t
 [8: display-start] '#{Mark}
 [9: display-end] '#{Mark}
 [10: start-changes-index] #f
 [11: end-changes-index] #f
 [12: modified-tick] 0
 [13: clip-daemons] '(#{Procedure 17919 #})
 [14: undo-data] '()
 [15: modified?] #f
 [16: %point] '#{Mark}
 [17: buffer] '#{Buffer}
 [18: shrink-length] 0
 [19: text-properties] #f
 [20: text] ""

(group-insert-char! (buffer-group foo-buff) 0 #\H)
(group-insert-char! (buffer-group foo-buff) 1 #\e)
(group-insert-char! (buffer-group foo-buff) 2 #\l)
(group-insert-char! (buffer-group foo-buff) 3 #\l)
(group-insert-char! (buffer-group foo-buff) 4 #\o)
(group-insert-string! (buffer-group foo-buff) 5 " World!")

,inspect foo-buff
inspect: 3
....
 [20: text] "Hello World!????"
...


Lets undo some of that:

(define (current-point) (make-mark (buffer-group foo-buff) 0))
(undo-one-step foo-buff (undo-start foo-buff))

,inspect foo-buff
inspect: 3
....
 [14: undo-data] '(("Hello World!" . 0) 12 (0 . 12) (#t . #f))
...
 [20: text] ""
...

Commits:
* b2cf8c9 : Add tests for buffers.
* a8b7fd4 : Split up parts that make up buffers into different modules and stub out code where needed.
* 7528238 : Move Edwin variables out of comman.scm to variable.scm.

= pantene: (master) =

Commits:
* 0c33bbd : Implement tests for some of pantene. They can be run by opening pantene:tests.
* 57fcbd5 : Add srfi-78 for tests.
* df682e0 : Large set of changes to more fully implement mit-scheme's spec and add more convenient functionality

= nuscsh: (master) =

(Drew is busy writing parsers for the JVM)

Until next time ...

- Jeff

Reply all
Reply to author
Forward
0 new messages