Changeset 6598


Ignore:
Timestamp:
May 25, 2007, 4:49:40 AM (18 years ago)
Author:
Gary Byers
Message:

Need to tell text system when echo buffer is being modified. (May have
missed some cases.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ide-1.0/ccl/hemlock/src/echo.lisp

    r776 r6598  
    4141  "Function that verifies what's being parsed.")
    4242
     43(defmacro modifying-echo-buffer (&body body)
     44  `(unwind-protect
     45    (progn
     46      (buffer-document-begin-editing *echo-area-buffer*)
     47      ,@body)
     48    (buffer-document-end-editing *echo-area-buffer*)))
    4349;;; %Not-Inside-A-Parse  --  Internal
    4450;;;
     
    113119         (progn
    114120           (setf (current-buffer) *echo-area-buffer*)
    115            (delete-region *echo-area-region*)
     121           (modifying-echo-buffer
     122            (delete-region *echo-area-region*))
    116123           (setf (buffer-modified *echo-area-buffer*) nil))
    117124      (setf (current-buffer) b))))
     
    128135  control string and format arguments, respectively."
    129136  (maybe-wait)
    130   (cond ((eq *current-window* *echo-area-window*)
    131          (let ((point (buffer-point *echo-area-buffer*)))
    132            (with-mark ((m point :left-inserting))
    133              (line-start m)
    134              (with-output-to-mark (s m :full)
    135                (apply #'format s string args)
    136                (fresh-line s)))))
    137         (t
    138          (let ((mark (region-end *echo-area-region*)))
    139            (cond ((buffer-modified *echo-area-buffer*)
    140                   (clear-echo-area))
    141                  ((not (zerop (mark-charpos mark)))
    142                   (insert-character mark #\newline)
    143                   (clear-echo-area)))
    144            (apply #'format *echo-area-stream* string args)
    145            (setf (buffer-modified *echo-area-buffer*) nil))))
    146   (force-output *echo-area-stream*)
    147   (setq *last-message-time* (get-internal-real-time))
     137  (modifying-echo-buffer
     138   (cond ((eq *current-window* *echo-area-window*)
     139          (let ((point (buffer-point *echo-area-buffer*)))
     140            (with-mark ((m point :left-inserting))
     141              (line-start m)
     142              (with-output-to-mark (s m :full)
     143                (apply #'format s string args)
     144                (fresh-line s)))))
     145         (t
     146          (let ((mark (region-end *echo-area-region*)))
     147            (cond ((buffer-modified *echo-area-buffer*)
     148                   (clear-echo-area))
     149                  ((not (zerop (mark-charpos mark)))
     150                   (insert-character mark #\newline)
     151                   (clear-echo-area)))
     152            (apply #'format *echo-area-stream* string args)
     153            (setf (buffer-modified *echo-area-buffer*) nil))))
     154   (force-output *echo-area-stream*)
     155   (setq *last-message-time* (get-internal-real-time)))
    148156  nil)
    149157
Note: See TracChangeset for help on using the changeset viewer.