Changeset 6657
- Timestamp:
- Jun 3, 2007, 2:51:59 AM (17 years ago)
- File:
-
- 1 edited
-
branches/ide-1.0/ccl/hemlock/src/command.lisp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/ide-1.0/ccl/hemlock/src/command.lisp
r2115 r6657 29 29 (dolist (buff *buffer-list*) (hcmd-new-buffer-hook-fun buff)) 30 30 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 44 34 45 35 … … 56 46 (if (and p (> p 1)) 57 47 (insert-string 58 (current-point )48 (current-point-for-insertion) 59 49 (make-string p :initial-element char)) 60 (insert-character (current-point ) char))))50 (insert-character (current-point-for-insertion) char)))) 61 51 62 52 (defcommand "Quoted Insert" (p) … … 64 54 With prefix argument, insert the character that many times." 65 55 "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)))) 68 57 (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)) 70 60 (insert-string point (make-string p :initial-element char)) 71 (insert-character point char)))) 61 (insert-character point char))))) 72 62 73 63 (defcommand "Forward Character" (p) … … 118 108 (or left if prefix is negative)." 119 109 "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."))))) 125 116 126 117 (defcommand "Delete Previous Character" (p) … … 137 128 "Exchanges the characters on either side of the point and moves forward." 138 129 (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)))))) 151 143 152 144 … … 363 355 364 356 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 373 358 ;;; 374 359 (defun reset-window-display-recentering (window &optional buffer)
Note:
See TracChangeset
for help on using the changeset viewer.
