aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorDavid Aspinall2009-07-30 11:57:12 +0000
committerDavid Aspinall2009-07-30 11:57:12 +0000
commit624fd955e0a5807c2980674f635109e66efdc40f (patch)
tree370c65ff6da047862928249940c3aaa5d1bf88cf /generic
parentc4c8e228283ac7ab1d6d1973d4735cb0afb94ed3 (diff)
Use descriptions of help items to set menu tooltips (resolve trac #218)
Diffstat (limited to 'generic')
-rw-r--r--generic/pg-pgip.el4
-rw-r--r--generic/pg-vars.el5
-rw-r--r--generic/proof-menu.el14
3 files changed, 12 insertions, 11 deletions
diff --git a/generic/pg-pgip.el b/generic/pg-pgip.el
index 282aaef8..a2a57949 100644
--- a/generic/pg-pgip.el
+++ b/generic/pg-pgip.el
@@ -185,9 +185,7 @@ Return a symbol representing the PGIP command processed, or nil."
(pg-pgip-debug
"haspref calling defpacustom: name:%s default:%s type:%s pgipcmd:%s" symname default type pgipcmd)
(eval
- `(defpacustom ,symname ,default
- (concat descr (if descr "\n")
- "Setting configured by <haspref> PGIP message")
+ `(defpacustom ,symname ,default ,descr
:type (quote ,type)
:pggroup ,prefcat
:pgipcmd ,pgipcmd))))
diff --git a/generic/pg-vars.el b/generic/pg-vars.el
index ea535a63..137db5d5 100644
--- a/generic/pg-vars.el
+++ b/generic/pg-vars.el
@@ -164,10 +164,11 @@ This is raw string, for internal use only.")
(defvar proof-assistant-settings nil
"A list of default values kept in Proof General for current proof assistant.
-A list of lists (SYMBOL SETTING TYPE) where SETTING is a string value
+A list of lists (SYMBOL SETTING TYPE DESCR) where SETTING is a string value
to send to the proof assistant using the value of SYMBOL and
and the function `proof-assistant-format'. The TYPE item determines
-the form of the menu entry for the setting.")
+the form of the menu entry for the setting and the DESCR description
+string is used as a help tooltip in the settings menu.")
(defvar pg-tracing-slow-mode nil
"Non-nil for slow refresh mode for tracing output.")
diff --git a/generic/proof-menu.el b/generic/proof-menu.el
index 2cb4b60a..55c8e5a7 100644
--- a/generic/proof-menu.el
+++ b/generic/proof-menu.el
@@ -713,7 +713,7 @@ KEY is the optional key binding."
(if grp (replace-in-string nm (concat (downcase grp) ":") "") nm)
"-" " "))))
-(defun proof-menu-entry-for-setting (symbol setting type)
+(defun proof-menu-entry-for-setting (symbol setting type descr)
(let ((entry-name (proof-menu-entry-name symbol))
(pasym (proof-ass-symv symbol)))
(cond
@@ -721,15 +721,16 @@ KEY is the optional key binding."
(vector entry-name
(proof-deftoggle-fn pasym)
:style 'toggle
- :selected pasym))
+ :selected pasym
+ :help descr))
((eq type 'integer)
(vector entry-name
(proof-defintset-fn pasym)
- t))
+ :help descr))
((eq type 'string)
(vector entry-name
(proof-defstringset-fn pasym)
- t)))))
+ :help descr)))))
(defun proof-settings-vars ()
"Return a list of proof assistant setting variables."
@@ -758,7 +759,7 @@ KEY is the optional key binding."
;;;###autoload
(defun proof-defpacustom-fn (name val args)
"As for macro `defpacustom' but evaluating arguments."
- (let (newargs setting evalform type)
+ (let (newargs setting evalform type descr)
(while args
(cond
((eq (car args) :setting)
@@ -785,6 +786,7 @@ KEY is the optional key binding."
(setq newargs (cons (car args) newargs))))
(setq args (cdr args)))
(setq newargs (reverse newargs))
+ (setq descr (car-safe newargs))
;; PG 3.5 patch 22.4.03: allow empty :setting, :eval,
;; because it's handy to put stuff on settings menu but
;; inspect the settings elsewhere in code.
@@ -828,7 +830,7 @@ KEY is the optional key binding."
(proof-assistant-invisible-command-ifposs
(proof-assistant-settings-cmd (quote ,name)))))))
(setq proof-assistant-settings
- (cons (list name setting (eval type))
+ (cons (list name setting (eval type) descr)
(assq-delete-all name proof-assistant-settings)))))
;;;###autoload