Changeset 569


Ignore:
Timestamp:
Feb 26, 2004, 11:58:06 AM (21 years ago)
Author:
Gary Byers
Message:

QUIT typechecks arg before it's too late to do so.

Location:
trunk/ccl
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/examples/cocoa-editor.lisp

    r568 r569  
    9595(define-objc-method ((:id init) lisp-editor-document)
    9696  (let* ((doc (send-super 'init)))
    97     (setf (slot-value doc 'textstorage)
    98           (make-textstorage-for-hemlock-buffer
    99            (hemlock-buffer-from-nsstring
    100             #@""
    101             (lisp-string-from-nsstring (send doc 'display-name))
    102             "Lisp")))
     97    (unless (%null-ptr-p doc)
     98      (let* ((buffer (hi::make-buffer
     99                      (lisp-string-from-nsstring (send doc 'display-name))
     100                      :modes '("Lisp"))))
     101        (setf (slot-value doc 'textstorage)
     102              (make-textstorage-for-hemlock-buffer
     103               buffer)
     104              (hi::buffer-document buffer) doc)))
    103105    doc))
    104106                     
     107
     108(define-objc-method ((:id :read-from-file filename
     109                          :of-type type)
     110                     lisp-editor-document)
     111  (declare (ignorable type))
     112  (let* ((pathname (lisp-string-from-nsstring filename))
     113         (buffer-name (hi::pathname-to-buffer-name pathname))
     114         (buffer (hi::make-buffer buffer-name))
     115         (data (make-objc-instance 'ns:ns-data
     116                                   :with-contents-of-file filename))
     117         (string (make-objc-instance 'ns:ns-string
     118                                     :with-data data
     119                                     :encoding #$NSMacOSRomanStringEncoding)))
     120    (setf (hi::buffer-pathname buffer) pathname)
     121    (nsstring-to-buffer string buffer)
     122    (hi::buffer-start (hi::buffer-point buffer))
     123    (setf (hi::buffer-modified buffer) nil)
     124    (hi::process-file-options buffer pathname)
     125    (setf (slot-value self 'textstorage)
     126          (make-textstorage-for-hemlock-buffer buffer)
     127          (hi::buffer-document buffer) (%setf-macptr (%null-ptr) self))))
     128   
     129 
     130
     131(define-objc-method ((:id :data-representation-of-type type)
     132                      lisp-editor-document)
     133  (declare (ignorable type))
     134  (send (send (slot-value self 'text-view) 'string)
     135        :data-using-encoding #$NSASCIIStringEncoding
     136        :allow-lossy-conversion t))
    105137
    106138(define-objc-method ((:void make-window-controllers) lisp-editor-document)
     
    110142                                    (slot-value self 'textstorage) nil nil))))
    111143    (send self :add-window-controller controller)
    112     (send controller 'release)))
    113 
    114 (define-objc-method ((:<BOOL> :load-data-representation data :of-type type)
    115                      lisp-editor-document)
    116     (declare (ignorable data type))
    117   (let* ((nsstring
    118   nil)
    119  
    120 
    121 (define-objc-method ((:id :data-representation-of-type ((* :char) type))
    122                       lisp-editor-document)
    123   (declare (ignorable type))
    124   (send (send (slot-value self 'text-view) 'string)
    125         :data-using-encoding #$NSASCIIStringEncoding
    126         :allow-lossy-conversion t))
    127 
    128          
     144    (send controller 'release)))         
    129145
    130146#|
     
    174190(define-objc-method ((:void close) lisp-editor-document)
    175191  (send-super 'close)
     192  (let* ((textstorage (slot-value self 'textstorage)))
     193    (setf (slot-value self 'textstorage) (%null-ptr))
     194    (unless (%null-ptr-p textstorage)
     195      (close-hemlock-textstorage textstorage)))
    176196  (let* ((info (info-from-document self)))
    177197    (when info
  • trunk/ccl/examples/cocoa-listener.lisp

    r568 r569  
    297297
    298298
    299  
     299) 
    300300;;; The LispListenerDocument class.
    301301
     
    305305  (:metaclass ns:+ns-object))
    306306
     307#-hemlock
     308(progn
    307309(define-objc-class-method ((:id top-listener) lisp-listener-document)
    308310  (let* ((all-documents (send *NSApp* 'ordered-Documents)))
  • trunk/ccl/examples/cocoa-window.lisp

    r568 r569  
    271271(defparameter *default-font-size* 12.0e0)
    272272
     273(defparameter *font-attribute-names*
     274  '((:bold . #.#$NSBoldFontMask)
     275    (:italic . #.#$NSItalicFontMask)
     276    (:small-caps . #.#$NSSmallCapsFontMask)))
    273277   
    274278;;; Try to find the specified font.  If it doesn't exist (or isn't
    275279;;; fixed-pitch), try to find a fixed-pitch font of the indicated size.
    276280(defun default-font (&key (name *default-font-name*)
    277                           (size *default-font-size*))
     281                          (size *default-font-size*)
     282                          (attributes ()))
     283                               
    278284  (setq size (float size 0.0f0))
    279285  (with-cstrs ((name name))
     
    284290          (let* ((fontname (send (@class ns-string) :string-with-c-string name))
    285291                 (font (send (@class ns-font)
    286                                   :font-with-name fontname :matrix matrix)))
     292                                  :font-with-name fontname :matrix matrix))
     293                 (implemented-attributes ()))
    287294            (if (or (%null-ptr-p font)
    288295                    (and
     
    291298              (setq font (send (@class ns-font)
    292299                               :user-fixed-pitch-font-of-size size)))
    293             font)))))
     300            (when attributes
     301              (dolist (attr-name attributes)
     302                (let* ((pair (assoc attr-name *font-attribute-names*))
     303                       (newfont))
     304                  (when pair
     305                    (setq newfont
     306                          (send
     307                           (send (@class "NSFontManager") 'shared-font-manager)
     308                           :convert-font font
     309                           :to-have-trait (cdr pair)))
     310                    (unless (eql font newfont)
     311                      (setq font newfont)
     312                      (push attr-name implemented-attributes))))))
     313            (values font implemented-attributes))))))
    294314
    295315(defparameter *tab-width* 8)
  • trunk/ccl/examples/hemlock-textstorage.lisp

    r568 r569  
    224224              (unless (eq buffer hi::*current-buffer*)
    225225                (setf (hi::current-buffer) buffer))
     226              (let* ((pane (text-view-pane self)))
     227                (unless (eql pane (hi::current-window))
     228                  (setf (hi::current-window) pane)))
     229              #+debug
     230              (format t "~& key-event = ~s" key-event)
    226231              (hi::interpret-key-event key-event info))))))))
    227232
     
    242247
    243248(defun make-textstorage-for-hemlock-buffer (buffer)
    244   (setf (hi::buffer-text-storage buffer)
    245         (make-objc-instance 'lisp-text-storage
    246                             :with-string
    247                             (make-instance
    248                              'hemlock-buffer-string
    249                              :display
    250                              (reset-display-cache
    251                               (make-hemlock-display)
    252                               buffer)))))
     249  (make-objc-instance 'lisp-text-storage
     250                      :with-string
     251                      (make-instance
     252                       'hemlock-buffer-string
     253                       :display
     254                       (reset-display-cache
     255                        (make-hemlock-display)
     256                        buffer))))
    253257
    254258(defclass modeline-view (ns:ns-view)
     
    257261
    258262
    259 (defloadvar *modeline-text-attributes*
    260     (create-text-attributes :color (send (@class "NSColor") 'black-color)
    261                             :font (default-font
    262                                       :name "Courier New Bold Italic"
    263                                       :size 10.0)))
     263(defloadvar *modeline-text-attributes* nil)
     264(defparameter *modeline-font-name* "Courier New Bold Italic")
     265(defparameter *modeline-font-size* 10.0)
    264266
    265267(defun buffer-for-modeline-view (mv)
     
    279281         (buffer (buffer-for-modeline-view modeline-view)))
    280282    (when buffer
     283      ;; You don't want to know why this is done this way.
     284      (unless *modeline-text-attributes*
     285        (setq *modeline-text-attributes*
     286              (create-text-attributes :color (send (@class "NSColor") 'black-color)
     287                                      :font (default-font
     288                                              :name *modeline-font-name*
     289                                              :size *modeline-font-size*))))
     290     
    281291      (let* ((string
    282292              (apply #'concatenate 'string
     
    470480
    471481(defun new-hemlock-document-window (&key
    472                                     (x 0.0)
    473                                     (y 0.0)
     482                                    (x 200.0)
     483                                    (y 200.0)
    474484                                    (height 200.0)
    475485                                    (width 500.0)
     
    537547(defun hemlock-buffer-from-nsstring (nsstring name &rest modes)
    538548  (let* ((buffer (hi::make-buffer name :modes modes)))
     549    (nsstring-to-buffer nsstring buffer)))
     550
     551(defun nsstring-to-buffer (nsstring buffer)   
    539552    (hi::delete-region (hi::buffer-region buffer))
    540553    (hi::modifying-buffer buffer)
     
    542555      (let* ((string-len (send nsstring 'length))
    543556             (line-start 0)
     557             (first-line-terminator ())
    544558             (first-line (hi::mark-line mark))
    545559             (previous first-line)
     
    550564            (do* ((number (+ (hi::line-number first-line) hi::line-increment)
    551565                          (+ number hi::line-increment)))
    552                  ((= line-start string-len))
     566                 ((= line-start string-len)
     567                  (let* ((line (hi::mark-line mark)))
     568                    (hi::insert-string mark (make-string 0))
     569                    (setf (hi::line-next previous) line
     570                          (hi::line-previous line) previous))
     571                  nil)
    553572              (setf (pref remaining-range :<NSR>ange.location) line-start)
    554573              (send nsstring
     
    558577                    :for-range remaining-range)
    559578              (let* ((contents-end (pref contents-end-index :unsigned))
     579                     (line-end (pref line-end-index :unsigned))
    560580                     (chars (make-string (- contents-end line-start))))
    561581                (do* ((i line-start (1+ i))
     
    563583                     ((= i contents-end))
    564584                  (setf (schar chars j) (code-char (send nsstring :character-at-index i))))
     585                (unless first-line-terminator
     586                  (let* ((terminator (code-char
     587                                      (send nsstring :character-at-index
     588                                            contents-end))))
     589                    (setq first-line-terminator
     590                    (case terminator
     591                      (#\return (if (= line-end (+ contents-end 2))
     592                                  :cp/m
     593                                  :mac))
     594                      (t :unix)))))
    565595                (if (eq previous first-line)
    566596                  (progn
     
    577607                      (setf (hi::line-next previous) line)
    578608                      (setq previous line))))
    579                 (setq line-start (pref line-end-index :unsigned))))))))
     609                (setq line-start line-end)))))
     610        (when first-line-terminator
     611          (setf (hi::buffer-external-format buffer) first-line-terminator))))
    580612    (setf (hi::buffer-modified buffer) nil)
    581     buffer))
    582 
     613    buffer)
     614
     615
     616
     617       
     618       
    583619(setq hi::*beep-function* #'(lambda (stream)
    584620                              (declare (ignore stream))
     
    616652                (funcall f tv)))))))))
    617653 
    618 (defun hi::textstorage-begin-editing (textstorage)
    619   (send textstorage 'begin-editing))
    620 
    621 (defun hi::textstorage-end-editing (textstorage)
    622   (send textstorage 'end-editing))
    623 
    624 (defun hi::textstorage-set-point-position (textstorage)
    625   (let* ((string (send textstorage 'string))
     654(defun hi::document-begin-editing (document)
     655  (send (slot-value document 'textstorage) 'begin-editing))
     656
     657(defun hi::document-end-editing (document)
     658  (send (slot-value document 'textstorage) 'end-editing))
     659
     660(defun hi::document-set-point-position (document)
     661  (let* ((textstorage (slot-value document 'textstorage))
     662         (string (send textstorage 'string))
    626663         (buffer (hemlock-display-buffer (hemlock-buffer-string-display string)))
    627664         (point (hi::buffer-point buffer))
     
    637674(defun hi::buffer-note-insertion (buffer mark n)
    638675  (when (hi::bufferp buffer)
    639     (let* ((textstorage (hi::buffer-text-storage buffer)))
     676    (let* ((document (hi::buffer-document buffer))
     677           (textstorage (if document (slot-value document 'textstorage))))
    640678      (when textstorage
    641679        (let* ((pos (mark-absolute-position mark)))
     
    655693                :change-in-length 0))))))
    656694
     695 
    657696
    658697(defun hi::buffer-note-deletion (buffer mark n)
    659698  (when (hi::bufferp buffer)
    660     (let* ((textstorage (hi::buffer-text-storage buffer)))
     699    (let* ((document (hi::buffer-document buffer))
     700           (textstorage (if document (slot-value document 'textstorage))))
    661701      (when textstorage
    662702        (let* ((pos (mark-absolute-position mark)))
     
    671711                :change-in-length (- n)))))))
    672712
    673            
     713(defun hi::set-document-modified (document flag)
     714  (let* ((windowcontrollers (send document 'window-controllers)))
     715    (dotimes (i (send windowcontrollers 'length))
     716      (send (send windowcontrollers :object-at-index i)
     717            :set-document-edited flag))))
     718
     719(defun hi::document-panes (document)
     720  (let* ((ts (slot-value document 'textstorage))
     721         (panes ()))
     722    (for-each-textview-using-storage
     723     ts
     724     #'(lambda (tv)
     725         (let* ((pane (text-view-pane tv)))
     726           (unless (%null-ptr-p pane)
     727             (push pane panes)))))
     728    panes))
    674729   
     730         
     731   
  • trunk/ccl/hemlock/src/bindings.lisp

    r566 r569  
    6565(bind-key "Scroll Next Window Up" #k"control-meta-V")
    6666
     67(bind-key "Process File Options" #k"control-meta-m")
     68(bind-key "Ensure File Options Line" #k"control-meta-M")
    6769(bind-key "Help" #k"home")
    6870(bind-key "Help" #k"control-_")
  • trunk/ccl/hemlock/src/buffer.lisp

    r6 r569  
    4646      (setf (buffer-modified-tick buffer) (tick))
    4747      (setf (buffer-unmodified-tick buffer) (tick)))
     48  (let* ((document (buffer-document buffer)))
     49    (if document (set-document-modified document sense)))
    4850  sense)
    4951
  • trunk/ccl/hemlock/src/cocoa-hemlock.lisp

    r566 r569  
    66
    77(in-package :hemlock-internals)
     8
     9(defun buffer-windows (buffer)
     10  (let* ((doc (buffer-document buffer)))
     11    (when doc
     12      (document-panes doc))))
     13
     14(defvar *current-window* ())
     15
     16(defvar *window-list* ())
     17(defun current-window ()
     18  "Return the current window.  The current window is specially treated by
     19  redisplay in several ways, the most important of which is that is does
     20  recentering, ensuring that the Buffer-Point of the current window's
     21  Window-Buffer is always displayed.  This may be set with Setf."
     22  *current-window*)
     23
     24(defun %set-current-window (new-window)
     25  #+not-yet
     26  (invoke-hook hemlock::set-window-hook new-window)
     27  #+clx
     28  (move-mark (window-point *current-window*)
     29             (buffer-point (window-buffer *current-window*)))
     30  #+clx
     31  (move-mark (buffer-point (window-buffer new-window))
     32             (window-point new-window))
     33  (setq *current-window* new-window))
     34
  • trunk/ccl/hemlock/src/filecoms.lisp

    r6 r569  
    212212  (declare (ignore p))
    213213  (process-file-options (current-buffer)))
     214
     215(defcommand "Ensure File Options Line" (p)
     216  "Insert a default file options line at the beginning of the buffer, unless such a line already exists."
     217  "Insert a default file options line at the beginning of the buffer, unless such a line already exists."
     218  (declare (ignore p))
     219  (let* ((buffer (current-buffer))
     220         (string
     221          (line-string (mark-line (buffer-start-mark buffer))))
     222         (found (search "-*-" string))
     223         (end (if found (search "-*-" string :start2 (+ found 3)))))
     224    (unless end
     225      (let* ((mode (buffer-major-mode buffer)))
     226        (unless mode
     227          ;; Try to derive the buffer's major mode from its pathname's
     228          ;; type.
     229          (let* ((pathname (buffer-pathname buffer))
     230                 (type (if pathname (pathname-type pathname)))
     231                 (hook (if type
     232                         (assoc (string-downcase type) *file-type-hooks*
     233                                :test #'string=))))
     234            (when hook
     235              (funcall (cdr hook) buffer type)
     236              (setq mode (buffer-major-mode buffer)))))
     237        (with-mark ((mark (buffer-start-mark buffer)))
     238          (if (string-equal mode "Lisp")
     239            (let* ((package-name
     240                    (if (hemlock-bound-p 'current-package :buffer buffer)
     241                      (variable-value 'hemlock::current-package
     242                                      :buffer buffer)
     243                      "CL-USER")))
     244              (insert-string
     245               mark
     246               (format nil ";;; -*- Mode: Lisp; Package: ~a -*-" package-name)))
     247            (insert-string
     248             mark
     249             (format nil ";;; -*- Mode: ~a -*-" (or mode "Fundamental"))))
     250          (insert-character mark #\NewLine))))
     251    (buffer-start (buffer-point buffer))))
     252   
     253   
     254                         
     255                           
     256           
     257       
     258           
     259           
     260         
     261                 
     262       
     263 
    214264
    215265(defcommand "Insert File" (p &optional pathname (buffer (current-buffer)))
  • trunk/ccl/hemlock/src/htext1.lisp

    r562 r569  
    162162  `(incf now-tick))
    163163
    164 (defun buffer-textstorage-begin-editing (buffer)
     164(defun buffer-document-begin-editing (buffer)
    165165  (when (bufferp buffer)
    166     (let* ((textstorage (buffer-text-storage buffer)))
    167       (when textstorage (textstorage-begin-editing textstorage)))))
    168 
    169 (defun buffer-textstorage-end-editing (buffer)
     166    (let* ((document (buffer-document buffer)))
     167      (when document (document-begin-editing document)))))
     168
     169(defun buffer-document-end-editing (buffer)
    170170  (when (bufferp buffer)
    171     (let* ((textstorage (buffer-text-storage buffer)))
    172       (when textstorage (textstorage-end-editing textstorage)))))
     171    (let* ((document (buffer-document buffer)))
     172      (when document (document-end-editing document)))))
    173173
    174174
     
    194194      (unwind-protect
    195195           (progn
    196              (if ,bp (buffer-textstorage-begin-editing ,b))
     196             (if ,bp (buffer-document-begin-editing ,b))
    197197             (hemlock-ext:without-interrupts ,@forms))
    198         (if ,bp (buffer-textstorage-end-editing ,b))))))
     198        (if ,bp (buffer-document-end-editing ,b))))))
    199199
    200200(defmacro always-change-line (mark new-line)
  • trunk/ccl/hemlock/src/htext2.lisp

    r562 r569  
    2222  (let* ((line (mark-line mark))
    2323         (buffer (if line (line-%buffer line)))
    24          (textstorage (if buffer (buffer-text-storage buffer))))
     24         (document (if buffer (buffer-document buffer))))
    2525    (if (and buffer
    2626             (eq mark (buffer-point buffer))
    27              textstorage)
    28       (textstorage-set-point-position textstorage))
     27             document)
     28      (document-set-point-position document))
    2929    mark))
    3030   
  • trunk/ccl/hemlock/src/htext3.lisp

    r562 r569  
    2727         (buffer (line-%buffer line)))
    2828    (modifying-buffer buffer
    29       (modifying-line line mark)
    30       (cond ((char= character #\newline)
    31              (let* ((next (line-next line))
    32                     (new-chars (subseq (the simple-string *open-chars*)
    33                                        0 *left-open-pos*))
    34                     (new-line (make-line :%buffer buffer
    35                                         :chars (decf *cache-modification-tick*)
    36                                         :previous line
    37                                         :next next)))
    38                (maybe-move-some-marks (charpos line new-line) *left-open-pos*
    39                                       (- charpos *left-open-pos*))
    40                (setf (line-%chars line) new-chars)
    41                (setf (line-next line) new-line)
    42                (if next (setf (line-previous next) new-line))
    43                (number-line new-line)
    44                (setq *open-line* new-line  *left-open-pos* 0)))
    45             (t
    46              (if (= *right-open-pos* *left-open-pos*)
    47                 (grow-open-chars))
     29                      (modifying-line line mark)
     30                      (cond ((char= character #\newline)
     31                             (let* ((next (line-next line))
     32                                    (new-chars (subseq (the simple-string *open-chars*)
     33                                                       0 *left-open-pos*))
     34                                    (new-line (make-line :%buffer buffer
     35                                                        :chars (decf *cache-modification-tick*)
     36                                                        :previous line
     37                                                        :next next)))
     38                               (maybe-move-some-marks (charpos line new-line) *left-open-pos*
     39                                                      (- charpos *left-open-pos*))
     40                               (setf (line-%chars line) new-chars)
     41                               (setf (line-next line) new-line)
     42                               (if next (setf (line-previous next) new-line))
     43                               (number-line new-line)
     44                               (setq *open-line* new-line  *left-open-pos* 0)))
     45                            (t
     46                             (if (= *right-open-pos* *left-open-pos*)
     47                              (grow-open-chars))
    4848             
    49              (maybe-move-some-marks (charpos line) *left-open-pos*
    50                                     (1+ charpos))
     49                             (maybe-move-some-marks (charpos line) *left-open-pos*
     50                                                    (1+ charpos))
    5151             
    52              (cond
    53               ((eq (mark-%kind mark) :right-inserting)
    54                (decf *right-open-pos*)
    55                (setf (char (the simple-string *open-chars*) *right-open-pos*)
    56                      character))
    57               (t
    58                (setf (char (the simple-string *open-chars*) *left-open-pos*)
    59                      character)
    60                (incf *left-open-pos*)))))
    61       (buffer-note-insertion buffer mark 1))))
     52                             (cond
     53                               ((eq (mark-%kind mark) :right-inserting)
     54                                (decf *right-open-pos*)
     55                                (setf (char (the simple-string *open-chars*) *right-open-pos*)
     56                                      character))
     57                               (t
     58                                (setf (char (the simple-string *open-chars*) *left-open-pos*)
     59                                      character)
     60                                (incf *left-open-pos*)))))
     61                      (buffer-note-insertion buffer mark 1))))
    6262
    6363
     
    7171    (declare (simple-string string))
    7272    (unless (zerop (- end start))
    73       (modifying-buffer buffer
    74         (modifying-line line mark)
    75         (if (%sp-find-character string start end #\newline)
    76             (with-mark ((mark mark :left-inserting))
    77               (do ((left-index start (1+ right-index))
    78                    (right-index
    79                     (%sp-find-character string start end #\newline)
    80                     (%sp-find-character string (1+ right-index) end #\newline)))
    81                   ((null right-index)
    82                    (if (/= left-index end)
    83                        (insert-string mark string left-index end)))
    84                 (insert-string mark string left-index right-index)
    85                 (insert-character mark #\newline)))
    86             (let ((length (- end start)))
    87               (if (<= *right-open-pos* (+ *left-open-pos* end))
    88                   (grow-open-chars (* (+ *line-cache-length* end) 2)))
     73      (modifying-buffer
     74       buffer
     75       (modifying-line line mark)
     76       (if (%sp-find-character string start end #\newline)
     77         (with-mark ((mark mark :left-inserting))
     78           (do ((left-index start (1+ right-index))
     79                (right-index
     80                 (%sp-find-character string start end #\newline)
     81                 (%sp-find-character string (1+ right-index) end #\newline)))
     82               ((null right-index)
     83                (if (/= left-index end)
     84                  (insert-string mark string left-index end)))
     85             (insert-string mark string left-index right-index)
     86             (insert-character mark #\newline)))
     87         (let ((length (- end start)))
     88           (if (<= *right-open-pos* (+ *left-open-pos* end))
     89             (grow-open-chars (* (+ *line-cache-length* end) 2)))
    8990             
    90               (maybe-move-some-marks (charpos line) *left-open-pos*
    91                                      (+ charpos length))
    92               (cond
    93                ((eq (mark-%kind mark) :right-inserting)
    94                 (let ((new (- *right-open-pos* length)))
    95                   (%sp-byte-blt string start *open-chars* new *right-open-pos*)
    96                   (setq *right-open-pos* new)))
    97                (t
    98                 (let ((new (+ *left-open-pos* length)))
    99                   (%sp-byte-blt string start *open-chars* *left-open-pos* new)
    100                   (setq *left-open-pos* new))))))
    101         (buffer-note-insertion buffer mark (- end start))))))
     91           (maybe-move-some-marks (charpos line) *left-open-pos*
     92                                  (+ charpos length))
     93           (cond
     94             ((eq (mark-%kind mark) :right-inserting)
     95              (let ((new (- *right-open-pos* length)))
     96                (%sp-byte-blt string start *open-chars* new *right-open-pos*)
     97                (setq *right-open-pos* new)))
     98             (t
     99              (let ((new (+ *left-open-pos* length)))
     100                (%sp-byte-blt string start *open-chars* *left-open-pos* new)
     101                (setq *left-open-pos* new))))))
     102       (buffer-note-insertion buffer mark (- end start))))))
    102103
    103104
  • trunk/ccl/hemlock/src/modeline.lisp

    r566 r569  
    100100                                   "Hemlock "))
    101101
    102 (make-modeline-field :name :external-format :width 4
    103                      :function #'(lambda (buffer window)
    104                                    "Returns indication of buffer's external-format"
    105                                    (declare (ignore window))
    106                                    (format nil "[~c] "
    107                                            (schar
    108                                             (string (buffer-external-format buffer)) 0))))
     102(make-modeline-field
     103 :name :external-format
     104 :function #'(lambda (buffer window)
     105               "Returns an indication of buffer's external-format, iff it's
     106other than :DEFAULT"
     107               (declare (ignore window))
     108               (let* ((external-format (buffer-external-format buffer)))
     109                 (case external-format
     110                   ((:unix nil))
     111                   (:mac "[CR] ")
     112                   (:cp/m "[CRLF] ")))))
     113
    109114
    110115(make-modeline-field
  • trunk/ccl/hemlock/src/struct.lisp

    r566 r569  
    9696  windows                     ; List of all windows into this buffer.
    9797  #-clx
    98   text-storage                ; text storage object associated with this buffer
     98  document                    ; NSDocument object associated with this buffer
    9999  var-values                  ; the buffer's local variables
    100100  variables                   ; string-table of local variables
  • trunk/ccl/level-1/l1-readloop.lisp

    r535 r569  
    158158
    159159(defun quit (&optional (exit-status 0))
     160  (unless (typep exit-status '(signed-byte 32))
     161    (report-bad-arg exit-status '(signed-byte 32)))
    160162  (let* ((ip *initial-process*)
    161163         (cp *current-process*))
Note: See TracChangeset for help on using the changeset viewer.