aboutsummaryrefslogtreecommitdiffhomepage
path: root/generic/proof-toolbar.el
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>1999-10-12 13:10:18 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>1999-10-12 13:10:18 +0000
commitf032cc82573f4b447bf84c885e97d552e64d6bbd (patch)
tree62c168538a40aa4587bb83369a20c7761606cc38 /generic/proof-toolbar.el
parentf346e8294af0b27f44f17502f08c6e003ca73e6a (diff)
Added proof-toolbar-use-enablers setting, and automatically
disable enablers if < XEmacs 21.
Diffstat (limited to 'generic/proof-toolbar.el')
-rw-r--r--generic/proof-toolbar.el34
1 files changed, 20 insertions, 14 deletions
diff --git a/generic/proof-toolbar.el b/generic/proof-toolbar.el
index c78f430c..97a7359f 100644
--- a/generic/proof-toolbar.el
+++ b/generic/proof-toolbar.el
@@ -123,20 +123,25 @@ and chooses the best one for the display properites.")
(defun proof-toolbar-make-toolbar-item (tle)
"Make a toolbar button descriptor from a proof-toolbar-entries entry."
- (let
- ((token (car tle))
- (menuname (cadr tle))
- (tooltip (nth 2 tle))
- ;; FIXME: enabler now enabled, for testing at least.
- ;; (enablep nil))
- (enablep (nth 3 tle)))
- (vector
- (proof-toolbar-icon token)
- (proof-toolbar-function token)
- (if enablep
- (list (proof-toolbar-enabler token))
- t)
- tooltip)))
+ (let*
+ ((token (car tle))
+ (menuname (cadr tle))
+ (tooltip (nth 2 tle))
+ (existsenabler (nth 3 tle))
+ (enablep (and proof-toolbar-use-enablers
+ (>= emacs-major-version 21)
+ existsenabler))
+ (enabler (proof-toolbar-enabler token))
+ (enableritem (if enablep (list enabler) t))
+ (buttonfn (proof-toolbar-function token))
+ (icon (proof-toolbar-icon token))
+ (actualfn (if (or enablep (not existsenabler))
+ buttonfn
+ ;; Add the enabler onto the function if necessary.
+ `(lambda ()
+ (if (,enabler)
+ (call-interactively (quote ,buttonfn)))))))
+ (vector icon actualfn enableritem tooltip)))
(defvar proof-toolbar-button-list
(append
@@ -437,6 +442,7 @@ Move point if the end of the locked position is invisible."
t)
(defun proof-toolbar-help ()
+ (interactive)
(info "ProofGeneral"))
;;