aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>1998-11-18 13:37:17 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>1998-11-18 13:37:17 +0000
commit586b70712cb7ff3a57c94bb9cace33b71f0fe145 (patch)
treeec0941d0eee96a3dcc59b257dd46901e078763e1
parent97be34be017de2f168fee2b093de673d9f8c621f (diff)
Added Proof General menu to theory file mode.
-rw-r--r--isa/thy-mode.el35
1 files changed, 35 insertions, 0 deletions
diff --git a/isa/thy-mode.el b/isa/thy-mode.el
index c623b078..9e47231f 100644
--- a/isa/thy-mode.el
+++ b/isa/thy-mode.el
@@ -158,6 +158,37 @@ You can use the following format characters:
(define-key map "\C-k" 'thy-kill-line)
(setq thy-mode-map map)))
+;; NEW for Proof General
+(defun thy-add-proofgeneral-menu ()
+ "Add Proof General menu to current menu bar."
+ (require 'proof-script) ; Later: proof-menu, autoloaded
+ (easy-menu-define thy-mode-menu
+ thy-mode-map
+ "Menu for Isabelle Proof General, theory file mode."
+ (cons proof-general-name
+ (append
+ (list
+ ["Process theory" isa-process-thy-file
+ :active (proof-locked-region-empty-p)
+ ]
+ ["Retract theory" isa-retract-thy-file
+ :active (proof-locked-region-full-p)
+ ])
+ (cdr proof-shared-menu)
+ ;; begin UGLY COMPATIBILTY HACK
+ ;; older/non-existent customize doesn't have
+ ;; this function.
+ (if (fboundp 'customize-menu-create)
+ (list (customize-menu-create 'proof-general)
+ (customize-menu-create
+ 'proof-general-internals
+ "Internals"))
+ nil)
+ ;; end UGLY COMPATIBILTY HACK
+ )))
+ (easy-menu-add thy-mode-menu thy-mode-map))
+
+
(defun thy-mode (&optional nomessage)
"Major mode for editing Isabelle theory files.
\\<thy-mode-map>
@@ -187,6 +218,7 @@ Here is the full list of theory mode key bindings:
(setq mode-name "Theory")
(use-local-map thy-mode-map)
;; (isa-menus) ; Add "isabelle" menu.
+ (thy-add-proofgeneral-menu)
(set-syntax-table thy-mode-syntax-table)
(make-local-variable 'indent-line-function)
@@ -203,6 +235,7 @@ Here is the full list of theory mode key bindings:
;; (if (featurep 'proof-toolbar)
;; (proof-toolbar-setup))
;;
+
(run-hooks 'thy-mode-hook)
(force-mode-line-update)
@@ -217,6 +250,8 @@ Here is the full list of theory mode key bindings:
(thy-mode t))
+
+
;;; "use" and "use_thy" with theory files ========================
;;; FIXME: Isabelle has been improved, so the following code could