changeset 57700:0fcbc2db3d03

(menu-bar-make-toggle): Instead of interactive-p, use an arg set non-nil by the interactive spec.
author Richard M. Stallman <rms@gnu.org>
date Tue, 26 Oct 2004 08:31:40 +0000
parents f633084f70ae
children 28c08e3b5530
files lisp/menu-bar.el
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/menu-bar.el	Tue Oct 26 08:27:26 2004 +0000
+++ b/lisp/menu-bar.el	Tue Oct 26 08:31:40 2004 +0000
@@ -596,10 +596,12 @@
 
 (defmacro menu-bar-make-toggle (name variable doc message help &rest body)
   `(progn
-     (defun ,name ()
+     (defun ,name (&optional interactively)
        ,(concat "Toggle whether to " (downcase (substring help 0 1))
-		(substring help 1) ".")
-       (interactive)
+		(substring help 1) ".\
+In an interactive call, record this option as a candidate for saving
+by \"Save Options\" in Custom buffers.")
+       (interactive "p")
        (if ,(if body `(progn . ,body)
 	      `(progn
 		 (custom-load-symbol ',variable)
@@ -612,7 +614,7 @@
        ;; a variable is set interactively, as the purpose is to mark it as
        ;; a candidate for "Save Options", and we do not want to save options
        ;; the user have already set explicitly in his init file.
-       (if (interactive-p) (customize-mark-as-set ',variable)))
+       (if interactively (customize-mark-as-set ',variable)))
      '(menu-item ,doc ,name
 		 :help ,help
                  :button (:toggle . (and (default-boundp ',variable)