Changeset 6657


Ignore:
Timestamp:
Jun 3, 2007, 2:51:59 AM (17 years ago)
Author:
Gary Byers
Message:

No %EXIT-HEMLOCK, %PAUSE-HEMLOCK.
Try to use the right flavor of CURRENT-POINT.

File:
1 edited

Legend:

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

    r2115 r6657  
    2929(dolist (buff *buffer-list*) (hcmd-new-buffer-hook-fun buff))
    3030
    31 (defcommand "Exit Hemlock" (p)
    32   "Exit hemlock returning to the Lisp top-level read-eval-print loop."
    33   "Exit hemlock returning to the Lisp top-level read-eval-print loop."
    34   (declare (ignore p))
    35   (exit-hemlock))
    36 
    37 (defcommand "Pause Hemlock" (p)
    38   "Pause the Hemlock/Lisp process returning to the process that invoked the
    39    Lisp."
    40   "Pause the Hemlock/Lisp process returning to the process that invoked the
    41    Lisp."
    42   (declare (ignore p))
    43   (pause-hemlock))
     31
     32
     33
    4434
    4535
     
    5646    (if (and p (> p 1))
    5747        (insert-string
    58          (current-point)
     48         (current-point-for-insertion)
    5949         (make-string p :initial-element char))
    60         (insert-character (current-point) char))))
     50        (insert-character (current-point-for-insertion) char))))
    6151
    6252(defcommand "Quoted Insert" (p)
     
    6454  With prefix argument, insert the character that many times."
    6555  "Reads a key-event from *editor-input* and inserts it at the point."
    66   (let ((char (hemlock-ext:key-event-char (get-key-event *editor-input* t)))
    67         (point (current-point)))
     56  (let ((char (hemlock-ext:key-event-char (get-key-event *editor-input* t))))
    6857    (unless char (editor-error "Can't insert that character."))
    69     (if (and p (> p 1))
     58    (let* ((point (current-point-for-insertion)))
     59      (if (and p (> p 1))
    7060        (insert-string point (make-string p :initial-element char))
    71         (insert-character point char))))
     61        (insert-character point char)))))
    7262
    7363(defcommand "Forward Character" (p)
     
    118108  (or left if prefix is negative)."
    119109  "Deletes p characters to the right of the point."
    120   (cond ((kill-characters (current-point) (or p 1)))
    121         ((and p (minusp p))
    122          (editor-error "Not enough previous characters."))
    123         (t
    124          (editor-error "Not enough next characters."))))
     110  (let* ((point (current-point-for-deletion)))
     111    (cond ((kill-characters point (or p 1)))
     112          ((and p (minusp p))
     113           (editor-error "Not enough previous characters."))
     114          (t
     115           (editor-error "Not enough next characters.")))))
    125116
    126117(defcommand "Delete Previous Character" (p)
     
    137128  "Exchanges the characters on either side of the point and moves forward."
    138129  (let ((arg (or p 1))
    139         (point (current-point)))
    140     (dotimes (i (abs arg))
    141       (when (minusp arg) (mark-before point))
    142       (let ((prev (previous-character point))
    143             (next (next-character point)))
    144 
    145         (cond ((not prev) (editor-error "No previous character."))
    146               ((not next) (editor-error "No next character."))
    147               (t
    148                (setf (previous-character point) next)
    149                (setf (next-character point) prev))))
    150       (when (plusp arg) (mark-after point)))))
     130        (point (current-point-unless-selection)))
     131    (when point
     132      (dotimes (i (abs arg))
     133        (when (minusp arg) (mark-before point))
     134        (let ((prev (previous-character point))
     135              (next (next-character point)))
     136
     137          (cond ((not prev) (editor-error "No previous character."))
     138                ((not next) (editor-error "No next character."))
     139                (t
     140                 (setf (previous-character point) next)
     141                 (setf (next-character point) prev))))
     142        (when (plusp arg) (mark-after point))))))
    151143
    152144
     
    363355
    364356
    365 (defcommand "Track Buffer Point" (p)
    366   "Make the current window track the buffer's point.
    367    This means that each time Hemlock redisplays, it will make sure the buffer's
    368    point is visible in the window.  This is useful for windows into buffer's
    369    that receive output from streams coming from other processes."
    370   "Make the current window track the buffer's point."
    371   (declare (ignore p))
    372   (setf (window-display-recentering (current-window)) t))
     357
    373358;;;
    374359(defun reset-window-display-recentering (window &optional buffer)
Note: See TracChangeset for help on using the changeset viewer.