/[climacs]/climacs/file-commands.lisp
ViewVC logotype

Diff of /climacs/file-commands.lisp

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

revision 1.28 by thenriksen, Tue Nov 20 12:59:54 2007 UTC revision 1.29 by thenriksen, Sat Dec 8 08:55:06 2007 UTC
# Line 136  Signals and error if the file does not e Line 136  Signals and error if the file does not e
136  ;;;  ;;;
137  ;;; Buffer commands  ;;; Buffer commands
138    
139  (define-command (com-switch-to-buffer :name t :command-table pane-table)  (define-command (com-switch-to-view :name t :command-table pane-table)
140      ((buffer 'buffer :default (or (second (buffers *application-frame*))      ((view 'view :default (or (second (views *application-frame*))
141                                    (any-buffer))))                                (any-view))))
142    "Prompt for a buffer name and switch to that buffer.    "Prompt for a buffer name and switch to that buffer.
143  If the a buffer with that name does not exist, create it. Uses  If the a buffer with that name does not exist, create it. Uses
144  the name of the next buffer (if any) as a default."  the name of the next buffer (if any) as a default."
145    (switch-to-buffer (current-window) buffer))    (handler-case (switch-to-view (current-window) view)
146        (view-already-displayed (condition)
147          (other-window (window condition)))))
148    
149  (set-key `(com-switch-to-buffer ,*unsupplied-argument-marker*)  (set-key `(com-switch-to-view ,*unsupplied-argument-marker*)
150           'pane-table           'pane-table
151           '((#\x :control) (#\b)))           '((#\x :control) (#\b)))
152    
153  (define-command (com-kill-buffer :name t :command-table pane-table)  (define-command (com-kill-view :name t :command-table pane-table)
154      ((buffer 'buffer      ((view 'view :prompt "Kill view"
155               :prompt "Kill buffer"                   :default (current-view)))
156               :default (current-buffer)))    "Prompt for a view name and kill that view.
157    "Prompt for a buffer name and kill that buffer.  If the view is of a buffer and the buffer needs saving, you will
158  If the buffer needs saving, will prompt you to do so before killing it. Uses the current buffer as a default."  be prompted to do so before killing it. Uses the current view
159    (kill-buffer buffer))  as a default."
160      (kill-view view))
161    
162  (set-key `(com-kill-buffer ,*unsupplied-argument-marker*)  (set-key `(com-kill-view ,*unsupplied-argument-marker*)
163           'pane-table           'pane-table
164           '((#\x :control) (#\k)))           '((#\x :control) (#\k)))
165    

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

  ViewVC Help
Powered by ViewVC 1.1.5