/[climacs]/climacs/gui.lisp
ViewVC logotype

Diff of /climacs/gui.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.172 by dmurray, Mon Aug 8 12:15:05 2005 UTC revision 1.173 by dmurray, Mon Aug 8 14:48:21 2005 UTC
# Line 764  Line 764 
764            while (whitespacep (object-after point))            while (whitespacep (object-after point))
765            do (incf (offset point)))))            do (incf (offset point)))))
766    
767    (define-named-command com-delete-horizontal-space ((backward-only-p
768                                                        'boolean :prompt "Delete backwards only?"))
769      (let* ((point (point (current-window)))
770             (mark (clone-mark point)))
771        (loop until (beginning-of-line-p point)
772              while (whitespacep (object-before point))
773              do (backward-object point))
774        (unless backward-only-p
775          (loop until (end-of-line-p mark)
776                while (whitespacep (object-after mark))
777                do (forward-object mark)))
778        (delete-region point mark)))
779    
780    
781  (define-named-command com-goto-position ()  (define-named-command com-goto-position ()
782    (setf (offset (point (current-window)))    (setf (offset (point (current-window)))
783          (handler-case (accept 'integer :prompt "Goto Position")          (handler-case (accept 'integer :prompt "Goto Position")
# Line 909  as two values" Line 923  as two values"
923                      (cadr (windows *application-frame*)))                      (cadr (windows *application-frame*)))
924             (com-delete-window))             (com-delete-window))
925    (setf *standard-output* (car (windows *application-frame*))))    (setf *standard-output* (car (windows *application-frame*))))
926    
927    (define-named-command com-scroll-other-window ()
928      (let ((other-window (second (windows *application-frame*))))
929        (when other-window
930          (page-down other-window))))
931    
932  (define-named-command com-delete-window ()  (define-named-command com-delete-window ()
933    (unless (null (cdr (windows *application-frame*)))    (unless (null (cdr (windows *application-frame*)))
# Line 1277  as two values" Line 1295  as two values"
1295          (loop repeat count do (forward-sentence point syntax))          (loop repeat count do (forward-sentence point syntax))
1296          (loop repeat (- count) do (backward-sentence point syntax)))))          (loop repeat (- count) do (backward-sentence point syntax)))))
1297    
1298    (define-named-command com-kill-sentence ((count 'integer :prompt "Number of sentences"))
1299      (let* ((pane (current-window))
1300             (point (point pane))
1301             (mark (clone-mark point))
1302             (syntax (syntax (buffer pane))))
1303        (if (plusp count)
1304            (loop repeat count do (forward-sentence point syntax))
1305            (loop repeat (- count) do (backward-sentence point syntax)))
1306        (kill-ring-standard-push *kill-ring* (region-to-sequence point mark))
1307        (delete-region point mark))))
1308    
1309    (define-named-command com-backward-kill-sentence ((count 'integer :prompt "Number of sentences"))
1310      (let* ((pane (current-window))
1311             (point (point pane))
1312             (mark (clone-mark point))
1313             (syntax (syntax (buffer pane))))
1314        (if (plusp count)
1315            (loop repeat count do (backward-sentence point syntax))
1316            (loop repeat (- count) do (forward-sentence point syntax)))
1317        (kill-ring-standard-push *kill-ring* (region-to-sequence point mark))
1318        (delete-region point mark)))
1319    
1320  (defun forward-page (mark &optional (count 1))  (defun forward-page (mark &optional (count 1))
1321    (loop repeat count    (loop repeat count
1322          unless (search-forward mark (coerce (list #\Newline #\Page) 'vector))          unless (search-forward mark (coerce (list #\Newline #\Page) 'vector))
# Line 1304  as two values" Line 1344  as two values"
1344          (backward-page point count)          (backward-page point count)
1345          (forward-page point count))))          (forward-page point count))))
1346    
1347    (define-named-command com-mark-page ((count 'integer :prompt "Move how many pages")
1348                                         (numargp 'boolean :prompt "Move to another page?"))
1349      (let* ((pane (current-window))
1350             (point (point pane))
1351             (mark (mark pane)))
1352        (cond ((and numargp (/= 0 count))
1353               (if (plusp count)
1354                   (forward-page point count)
1355                   (backward-page point (1+ count))))
1356              (t (backward-page point count)))
1357        (setf (offset mark) (offset point))
1358               (forward-page mark 1)))
1359    
1360  (define-named-command com-count-lines-page ()  (define-named-command com-count-lines-page ()
1361    (let* ((pane (current-window))    (let* ((pane (current-window))
1362           (point (point pane))           (point (point pane))
# Line 1507  as two values" Line 1560  as two values"
1560  (global-set-key '(#\w :control) 'com-kill-region)  (global-set-key '(#\w :control) 'com-kill-region)
1561  (global-set-key '(#\e :meta) `(com-forward-sentence ,*numeric-argument-marker*))  (global-set-key '(#\e :meta) `(com-forward-sentence ,*numeric-argument-marker*))
1562  (global-set-key '(#\a :meta) `(com-backward-sentence ,*numeric-argument-marker*))  (global-set-key '(#\a :meta) `(com-backward-sentence ,*numeric-argument-marker*))
1563    (global-set-key '(#\k :meta) `(com-kill-sentence ,*numeric-argument-marker*))
1564  (global-set-key '(#\@ :meta :control :shift) `(com-mark-expression ,*numeric-argument-marker*))  (global-set-key '(#\@ :meta :control :shift) `(com-mark-expression ,*numeric-argument-marker*))
1565  (global-set-key '(#\f :meta) `(com-forward-word ,*numeric-argument-marker*))  (global-set-key '(#\f :meta) `(com-forward-word ,*numeric-argument-marker*))
1566  (global-set-key '(#\b :meta) `(com-backward-word ,*numeric-argument-marker*))  (global-set-key '(#\b :meta) `(com-backward-word ,*numeric-argument-marker*))
# Line 1519  as two values" Line 1573  as two values"
1573  (global-set-key '(#\w :meta) 'com-copy-region)  (global-set-key '(#\w :meta) 'com-copy-region)
1574  (global-set-key '(#\v :control) 'com-page-down)  (global-set-key '(#\v :control) 'com-page-down)
1575  (global-set-key '(#\v :meta) 'com-page-up)  (global-set-key '(#\v :meta) 'com-page-up)
1576    (global-set-key '(#\v :control :meta) 'com-scroll-other-window)
1577  (global-set-key '(#\< :shift :meta) 'com-beginning-of-buffer)  (global-set-key '(#\< :shift :meta) 'com-beginning-of-buffer)
1578  (global-set-key '(#\> :shift :meta) 'com-end-of-buffer)  (global-set-key '(#\> :shift :meta) 'com-end-of-buffer)
1579  (global-set-key '(#\m :meta) 'com-back-to-indentation)  (global-set-key '(#\m :meta) 'com-back-to-indentation)
1580    (global-set-key '(#\\ :meta) `(com-delete-horizontal-space ,*numeric-argument-p*))
1581  (global-set-key '(#\^ :shift :meta) 'com-delete-indentation)  (global-set-key '(#\^ :shift :meta) 'com-delete-indentation)
1582  (global-set-key '(#\q :meta) 'com-fill-paragraph)  (global-set-key '(#\q :meta) 'com-fill-paragraph)
1583  (global-set-key '(#\d :meta) `(com-kill-word ,*numeric-argument-marker*))  (global-set-key '(#\d :meta) `(com-kill-word ,*numeric-argument-marker*))
# Line 1590  as two values" Line 1646  as two values"
1646  (c-x-set-key '(#\u) 'com-undo)  (c-x-set-key '(#\u) 'com-undo)
1647  (c-x-set-key '(#\]) `(com-forward-page ,*numeric-argument-marker*))  (c-x-set-key '(#\]) `(com-forward-page ,*numeric-argument-marker*))
1648  (c-x-set-key '(#\[) `(com-backward-page ,*numeric-argument-marker*))  (c-x-set-key '(#\[) `(com-backward-page ,*numeric-argument-marker*))
1649    (c-x-set-key '(#\p :control) `(com-mark-page ,*numeric-argument-marker* ,*numeric-argument-p*))
1650  (c-x-set-key '(#\l) 'com-count-lines-page)  (c-x-set-key '(#\l) 'com-count-lines-page)
1651  (c-x-set-key '(#\s :control) 'com-save-buffer)  (c-x-set-key '(#\s :control) 'com-save-buffer)
1652  (c-x-set-key '(#\t :control) 'com-transpose-lines)  (c-x-set-key '(#\t :control) 'com-transpose-lines)
1653  (c-x-set-key '(#\w :control) 'com-write-buffer)  (c-x-set-key '(#\w :control) 'com-write-buffer)
1654  (c-x-set-key '(#\x :control) 'com-exchange-point-and-mark)  (c-x-set-key '(#\x :control) 'com-exchange-point-and-mark)
1655  (c-x-set-key '(#\=) 'com-what-cursor-position)  (c-x-set-key '(#\=) 'com-what-cursor-position)
1656    (c-x-set-key '(#\Backspace) `(com-backward-kill-sentence ,*numeric-argument-marker*))
1657    
1658  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1659  ;;;  ;;;

Legend:
Removed from v.1.172  
changed lines
  Added in v.1.173

  ViewVC Help
Powered by ViewVC 1.1.5