Changeset 674


Ignore:
Timestamp:
Mar 19, 2004, 11:36:23 PM (21 years ago)
Author:
Gary Byers
Message:

More command-interpreter changes.

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

Legend:

Unmodified
Added
Removed
  • trunk/ccl/hemlock/src/cocoa-hemlock.lisp

    r667 r674  
    1515  (prefix-argument-supplied nil)
    1616  frame
    17   (function nil)
     17  (event-mode-list nil)                 ; for extended modal
    1818  )
    1919
    2020(defvar *current-command-info* nil)
     21
     22(defun push-event-mode-function (f)
     23  (push f (command-interpreter-info-event-mode-list *current-command-info*))
     24  f)
     25
     26(defun exit-event-mode ()
     27  (setf (command-interpreter-info-event-mode-list *current-command-info*)
     28        (cdr (command-interpreter-info-event-mode-list *current-command-info*))))
     29
     30(defun current-event-mode ()
     31  (car (command-interpreter-info-event-mode-list *current-command-info*)))
     32
     33(defun add-one-shot-event-mode-function (f)
     34  (push-event-mode-function #'(lambda (key)
     35                                (exit-event-mode)
     36                                (funcall f key))))
     37
     38
    2139
    2240(defun buffer-windows (buffer)
     
    3856  #+not-yet
    3957  (invoke-hook hemlock::set-window-hook new-window)
    40   #+clx
    41   (move-mark (window-point *current-window*)
    42              (buffer-point (window-buffer *current-window*)))
    43   #+clx
    44   (move-mark (buffer-point (window-buffer new-window))
    45              (window-point new-window))
     58  (activate-hemlock-view new-window)
    4659  (setq *current-window* new-window))
    4760
  • trunk/ccl/hemlock/src/command.lisp

    r668 r674  
    6464  With prefix argument, insert the character that many times."
    6565  "Reads a key-event from *editor-input* and inserts it at the point."
    66   (setf (hi::command-interpreter-info-function hi::*current-command-info*)
    67         #'(lambda (key-event)
     66  (hi::add-one-shot-event-mode-function
     67   #'(lambda (key-event)
    6868            (let* ((char (hemlock-ext:key-event-char key-event))
    6969                   (point (current-point)))
  • trunk/ccl/hemlock/src/interp.lisp

    r670 r674  
    428428         (cmd (command-interpreter-info-current-command info))
    429429         (trans (command-interpreter-info-current-translation info))
    430          (func (command-interpreter-info-function info)))
     430         (func (current-event-mode)))
    431431    (handler-bind
    432432        ;; Bind this outside the invocation loop to save consing.
     
    450450                (write-char #\space *echo-area-stream*)))))
    451451      (cond (func
    452              (setf (command-interpreter-info-function info) nil)
    453452             (funcall func key-event))
    454453             (t
     
    493492;;;    Read commands from the terminal and execute them, forever.
    494493;;;
     494#+original
    495495(defun %command-loop ()
    496496  (let  ((cmd *current-command*)
     
    551551              (hash-table))))))))
    552552
     553(defun %command-loop ()
     554  (format t "~& in %command-loop: current buffer = ~s" (current-buffer)))
     555
     556
    553557
    554558;;; EXIT-HEMLOCK  --  Public
Note: See TracChangeset for help on using the changeset viewer.