Commit bc6f08e9 authored by Troels Henriksen's avatar Troels Henriksen

Added sweet new menu items.

parent d1ab933e
......@@ -136,35 +136,6 @@ Signals and error if the file does not exist."
;;;
;;; Buffer commands
(define-command (com-switch-to-view :name t :command-table pane-table)
;; Perhaps the default should be an undisplayed view?
((view 'view :default (or (find (current-view) (views *application-frame*)
:test (complement #'eq))
(any-view))))
"Prompt for a buffer name and switch to that buffer.
If the a buffer with that name does not exist, create it. Uses
the name of the next buffer (if any) as a default."
(handler-case (switch-to-view (current-window) view)
(view-already-displayed (condition)
(other-window (window condition)))))
(set-key `(com-switch-to-view ,*unsupplied-argument-marker*)
'pane-table
'((#\x :control) (#\b)))
(define-command (com-kill-view :name t :command-table pane-table)
((view 'view :prompt "Kill view"
:default (current-view)))
"Prompt for a view name and kill that view.
If the view is of a buffer and the buffer needs saving, you will
be prompted to do so before killing it. Uses the current view
as a default."
(kill-view view))
(set-key `(com-kill-view ,*unsupplied-argument-marker*)
'pane-table
'((#\x :control) (#\k)))
(define-command (com-toggle-read-only :name t :command-table buffer-table)
((buffer 'buffer :default (current-buffer *application-frame*)))
(setf (read-only-p buffer) (not (read-only-p buffer))))
......@@ -183,4 +154,4 @@ as a default."
(modified com-toggle-modified buffer-table
:gesture :menu)
(object)
(list object))
\ No newline at end of file
(list object))
......@@ -203,8 +203,6 @@ window"))
(make-command-table 'buffer-table :errorp nil)
;;; Commands used for climacs development
(make-command-table 'development-table :errorp nil)
;;; Panes
(make-command-table 'pane-table :errorp nil)
;;; Windows
(make-command-table 'window-table :errorp nil)
......@@ -219,7 +217,6 @@ window"))
:errorp nil
:inherit-from '(base-table
buffer-table
pane-table
window-table
development-table
climacs-help-table
......@@ -242,30 +239,10 @@ window"))
(make-command-table 'climacs-global-table
:inherit-from (list (make-instance 'climacs-command-table
:name 'climacs-dispatching-table))
:menu `(("File" :menu ,(make-command-table nil
:inherit-from 'esa-io-table
:menu `(("Find File"
:command (com-find-file ,*unsupplied-argument-marker*))
("Find File (read-only)"
:command (com-find-file-read-only ,*unsupplied-argument-marker*))
("Save Buffer"
:command (com-save-buffer))
("Save Bufer As"
:command (com-write-buffer ,*unsupplied-argument-marker*))
("Set Visited File Name"
:command (com-set-visited-file-name ,*unsupplied-argument-marker*))
(nil :divider :line)
("Quit" :command com-quit))))
("Help" :menu ,(make-command-table nil
:inherit-from 'help-table
:menu `(("Where is" :command com-where-is)
("Describe Bindings" :command (com-describe-bindings nil))
("Describe Bindings (sorted)" :command (com-describe-bindings t))
("Describe Key" :command com-describe-key)
("Describe Command"
:command (com-describe-command ,*unsupplied-argument-marker*))
("Apropos Command"
:command (com-apropos-command ,*unsupplied-argument-marker*))))))
:menu `(("File" :menu esa-io-menu-table)
("Macros" :menu keyboard-macro-menu-table)
("Windows" :menu window-menu-table)
("Help" :menu help-menu-table))
:errorp nil)
(define-application-frame climacs (esa-frame-mixin
......
......@@ -82,8 +82,8 @@
#:global-climacs-table #:keyboard-macro-table #:climacs-help-table
#:base-table #:buffer-table #:case-table
#:development-table
#:info-table #:pane-table
#:window-table
#:info-table
#:window-table #:window-menu-table
;; Typeout
#:typeout-view #:typeout-view-p
......
......@@ -173,3 +173,46 @@ clone of `(current-view)' for the new window."
'window-table
'((#\x :control) (#\0)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Commands for switching/killing current view.
(define-command (com-switch-to-view :name t :command-table window-table)
;; Perhaps the default should be an undisplayed view?
((view 'view :default (or (find (current-view) (views *application-frame*)
:test (complement #'eq))
(any-view))))
"Prompt for a view name and switch to that view.
If the a view with that name does not exist, create a buffer-view
with the name and switch to it. Uses the name of the next
view (if any) as a default."
(handler-case (switch-to-view (current-window) view)
(view-already-displayed (condition)
(other-window (window condition)))))
(set-key `(com-switch-to-view ,*unsupplied-argument-marker*)
'window-table
'((#\x :control) (#\b)))
(define-command (com-kill-view :name t :command-table window-table)
((view 'view :prompt "Kill view"
:default (current-view)))
"Prompt for a view name and kill that view.
If the view is of a buffer and the buffer needs saving, you will
be prompted to do so before killing it. Uses the current view
as a default."
(kill-view view))
(set-key `(com-kill-view ,*unsupplied-argument-marker*)
'window-table
'((#\x :control) (#\k)))
(define-menu-table window-menu-table (window-table)
'(com-split-window-vertically nil)
'(com-split-window-horizontally nil)
'com-other-window
'com-single-window
'com-delete-window
:divider
`(com-switch-to-view ,*unsupplied-argument-marker*)
`(com-kill-view ,*unsupplied-argument-marker*))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment