Changeset 711


Ignore:
Timestamp:
Mar 24, 2004, 8:44:53 AM (17 years ago)
Author:
gb
Message:

New (shared) gap-cache stuff.

Location:
trunk/ccl/hemlock/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/hemlock/src/decls.lisp

    r681 r711  
    6363;;; need to invent a new language to advise the compiler of that ...
    6464(declaim (special *mode-names* *current-buffer* *echo-area-buffer*
    65                   *open-line* *left-open-pos* *right-open-pos*
    66                   *line-cache-length* *open-chars* *the-sentinel*
     65                  *buffer-gap-context*
     66                  *the-sentinel*
    6767                  *in-the-editor* *buffer-list* *things-to-do-once*
    6868                  *gc-notify-before* *gc-notify-after*))
  • trunk/ccl/hemlock/src/struct.lisp

    r695 r711  
    105105  (external-format :unix)     ; Line-termination, for the time being
    106106  process                     ; Maybe a listener
    107   (line-cache-length 200)     ; initial/current length of open-chars
    108   (open-line nil)             ; the current open line
    109   (open-chars (make-string 200)) ; gap
    110   (left-open-pos 0)
    111   (right-open-pos 0)
    112  
     107  (gap-context )                        ; The value of *buffer-gap-context*
     108                              ; in the thread that can modify the buffer.
    113109  )
    114110
     
    668664  "Sets a modeline-field's function and updates this field for all windows in
    669665   any buffer whose fields list contains the field.")
     666
     667;;; Shared buffer-gap context, used to communicate between command threads
     668;;; and the event thread.  Note that this isn't buffer-specific; in particular,
     669;;; OPEN-LINE and friends may not point at a line that belongs to any
     670;;; buffer.
     671
     672(defstruct buffer-gap-context
     673  (lock (ccl::make-lock))
     674  (left-open-pos 0)
     675  (right-open-pos 0)
     676  (line-cache-length 200)
     677  (open-line nil)
     678  (open-chars (make-string 200)))
     679
     680(define-symbol-macro *line-cache-length* (buffer-gap-context-line-cache-length *buffer-gap-context*))
     681(define-symbol-macro *open-line* (buffer-gap-context-open-line *buffer-gap-context*))
     682(define-symbol-macro *open-chars* (buffer-gap-context-open-chars *buffer-gap-context*))
     683(define-symbol-macro *left-open-pos* (buffer-gap-context-left-open-pos *buffer-gap-context*))
     684(define-symbol-macro *right-open-pos* (buffer-gap-context-right-open-pos *buffer-gap-context*))
Note: See TracChangeset for help on using the changeset viewer.