596 |
|
|
597 |
(defmacro menu-bar-make-toggle (name variable doc message help &rest body) |
(defmacro menu-bar-make-toggle (name variable doc message help &rest body) |
598 |
`(progn |
`(progn |
599 |
(defun ,name () |
(defun ,name (&optional interactively) |
600 |
,(concat "Toggle whether to " (downcase (substring help 0 1)) |
,(concat "Toggle whether to " (downcase (substring help 0 1)) |
601 |
(substring help 1) ".") |
(substring help 1) ".\ |
602 |
(interactive) |
In an interactive call, record this option as a candidate for saving |
603 |
|
by \"Save Options\" in Custom buffers.") |
604 |
|
(interactive "p") |
605 |
(if ,(if body `(progn . ,body) |
(if ,(if body `(progn . ,body) |
606 |
`(progn |
`(progn |
607 |
(custom-load-symbol ',variable) |
(custom-load-symbol ',variable) |
614 |
;; a variable is set interactively, as the purpose is to mark it as |
;; a variable is set interactively, as the purpose is to mark it as |
615 |
;; a candidate for "Save Options", and we do not want to save options |
;; a candidate for "Save Options", and we do not want to save options |
616 |
;; the user have already set explicitly in his init file. |
;; the user have already set explicitly in his init file. |
617 |
(if (interactive-p) (customize-mark-as-set ',variable))) |
(if interactively (customize-mark-as-set ',variable))) |
618 |
'(menu-item ,doc ,name |
'(menu-item ,doc ,name |
619 |
:help ,help |
:help ,help |
620 |
:button (:toggle . (and (default-boundp ',variable) |
:button (:toggle . (and (default-boundp ',variable) |