From a0a585f41b571faf00a3a94393539e478d2bc667 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Fri, 12 May 2000 15:55:35 +0000 Subject: Moved utility functions to proof-utils. --- generic/proof-menu.el | 30 ------------------------------ generic/proof-utils.el | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 30 deletions(-) (limited to 'generic') 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 @@ -108,36 +108,6 @@ (proof-ass help-menu-entries)))))))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; -;;; Contents of the generic menus -;;; - - -(defun proof-deftoggle-fn (var &optional othername) - "Define a function -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 -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 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 -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 -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. -- cgit v1.2.3