diff options
Diffstat (limited to 'generic/proof-utils.el')
-rw-r--r-- | generic/proof-utils.el | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/generic/proof-utils.el b/generic/proof-utils.el index 99e537c5..4a15301a 100644 --- a/generic/proof-utils.el +++ b/generic/proof-utils.el @@ -23,6 +23,7 @@ ;;; Code: +(eval-when-compile (require 'cl-lib)) ;; ;; Give Emacs version mismatch error here. ;; @@ -58,8 +59,6 @@ (require 'proof-autoloads) ; interface fns (require 'scomint) ; for proof-shell-live-buffer -;;; Code: - ;; ;; Handy macros ;; @@ -247,7 +246,8 @@ Experimentally we display a message from time to time advertising ;; IF there *isn't* a visible window showing buffer... (unless (get-buffer-window buffer 0) (if proof-three-window-enable - (if (< proof-advertise-layout-count 30) (incf proof-advertise-layout-count) + (if (< proof-advertise-layout-count 30) + (cl-incf proof-advertise-layout-count) (message (substitute-command-keys "Hit \\[proof-layout-windows] to reset layout")) (setq proof-advertise-layout-count 0))) ;; THEN either we are in 2 wins mode and we must switch the assoc @@ -589,25 +589,23 @@ The name of the defined function is returned." `(proof-deffloatset-fn (quote ,var) (quote ,othername))) (defun proof-defstringset-fn (var &optional othername) - "Define a function <VAR>-toggle for setting an integer customize setting VAR. -Args as for the macro `proof-defstringset', except will be evaluated." + "Define a function OTHERNAME for setting an string customize setting VAR. +OTHERNAME defaults to `VAR-stringset'." (eval - `(defun ,(if othername othername - (intern (concat (symbol-name var) "-stringset"))) (arg) - ,(concat "Set `" (symbol-name var) "' to ARG. -This function simply uses customize-set-variable to set the variable. + `(defun ,(or othername + (intern (concat (symbol-name var) "-stringset"))) + (arg) + ,(concat "Set `" (symbol-name var) "' to ARG. +This function simply uses `customize-set-variable' to set the variable. It was constructed with `proof-defstringset-fn'.") - (interactive ,(format "sValue for %s (a string): " - (symbol-name var))) - (customize-set-variable (quote ,var) arg)))) - -(defmacro proof-defstringset (var &optional othername) - "The setting function uses customize-set-variable to change the variable. -OTHERNAME gives an alternative name than the default <VAR>-stringset. -The name of the defined function is returned." - `(proof-defstringset-fn (quote ,var) (quote ,othername))) - - + (interactive (list + (read-string + (format "Value for %s (default %s): " + (symbol-name (quote ,var)) + (symbol-value (quote ,var))) + nil nil + (symbol-value (quote ,var))))) + (customize-set-variable (quote ,var) arg)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; |