diff options
author | 2000-05-12 15:55:35 +0000 | |
---|---|---|
committer | 2000-05-12 15:55:35 +0000 | |
commit | a0a585f41b571faf00a3a94393539e478d2bc667 (patch) | |
tree | 1f3fa90d799458d37c6801a073ddbb2fb25fe58d | |
parent | 833036e6f808a0ca7086795333633167c8d450a7 (diff) |
Moved utility functions to proof-utils.
-rw-r--r-- | generic/proof-menu.el | 30 | ||||
-rw-r--r-- | generic/proof-utils.el | 33 |
2 files changed, 33 insertions, 30 deletions
diff --git a/generic/proof-menu.el b/generic/proof-menu.el index 3552835f..4710ecaa 100644 --- a/generic/proof-menu.el +++ b/generic/proof-menu.el @@ -113,36 +113,6 @@ ;;; Contents of the generic menus ;;; - -(defun proof-deftoggle-fn (var &optional othername) - "Define a function <VAR>-toggle for toggling a boolean customize setting VAR. -The toggle function uses customize-set-variable to change the variable. -OTHERNAME gives an alternative name than the default <VAR>-toggle." - (eval - `(defun ,(if othername othername - (intern (concat (symbol-name var) "-toggle"))) (arg) - ,(concat "Toggle `" (symbol-name var) "'. With ARG, turn on iff ARG>0. -This function simply uses customize-set-variable to set the variable. -It was constructed with `proof-customize-toggle-fn'.") - (interactive "P") - (customize-set-variable - (quote ,var) - (if (null arg) (not ,var) - (> (prefix-numeric-value arg) 0)))))) - -;;;###autoload -(defmacro proof-deftoggle (var &optional othername) - "Define a function VAR-toggle for toggling a boolean customize setting VAR. -VAR, OTHERNAME are not evaluated. -The function is defined with `proof-customize-toggle-fn', which see." - `(proof-deftoggle-fn (quote ,var) (quote ,othername))) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Contents of the generic menus -;;; - (defvar proof-help-menu '("Help" ["Proof General home page" diff --git a/generic/proof-utils.el b/generic/proof-utils.el index 7c8cfa54..50c2f926 100644 --- a/generic/proof-utils.el +++ b/generic/proof-utils.el @@ -7,6 +7,9 @@ ;; ;; $Id$ ;; +;; +;; Loading note: this file is required immediately from proof.el, so +;; no autoloads are used here. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -380,6 +383,36 @@ Returns non-nil if response buffer was cleared." http://zermelo.dcs.ed.ac.uk/~proofgen/ProofGeneral/BUGS ]"))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Utils for making functions to adjust user settings +;;; + + +(defun proof-deftoggle-fn (var &optional othername) + "Define a function <VAR>-toggle for toggling a boolean customize setting VAR. +The toggle function uses customize-set-variable to change the variable. +OTHERNAME gives an alternative name than the default <VAR>-toggle." + (eval + `(defun ,(if othername othername + (intern (concat (symbol-name var) "-toggle"))) (arg) + ,(concat "Toggle `" (symbol-name var) "'. With ARG, turn on iff ARG>0. +This function simply uses customize-set-variable to set the variable. +It was constructed with `proof-customize-toggle-fn'.") + (interactive "P") + (customize-set-variable + (quote ,var) + (if (null arg) (not ,var) + (> (prefix-numeric-value arg) 0)))))) + +(defmacro proof-deftoggle (var &optional othername) + "Define a function VAR-toggle for toggling a boolean customize setting VAR. +VAR, OTHERNAME are not evaluated. +The function is defined with `proof-customize-toggle-fn', which see." + `(proof-deftoggle-fn (quote ,var) (quote ,othername))) + + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; Stuff for developing PG, not needed for ordinary users really. |