X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=tinycustom.el;h=cf982ac8c0056ea321093003de0541e5c0096223;hb=451afa3a908ed5e14f4aa10d64160dfe2f35ad2b;hp=a91210386369a7f30b040d7f87587361b540c668;hpb=ab53c9eeb511a944145391851b5499f5f294c65f;p=elisp%2Fapel.git diff --git a/tinycustom.el b/tinycustom.el index a912103..cf982ac 100644 --- a/tinycustom.el +++ b/tinycustom.el @@ -25,10 +25,12 @@ ;;; Commentary: -;; Purpose of this program is emulating for who does not have -;; `custom.el'. +;; Purpose of this program is emulating for who does not have "custom". +;; (custom.el bundled with v19 is old; does not have following macros.) +;; ;; DEFCUSTOM below has the same effect as the original DEFVAR has. -;; DEFGROUP and DEFFACE below are just nop macro. +;; DEFFACE only makes a face. +;; DEFGROUP and DEFINE-WIDGET below are just nop macro. ;;; Code: @@ -39,8 +41,8 @@ SYMBOL does not need to be quoted. Third arg DOC is the group documentation. -This is a nop defgroup only for emulating purpose.." - nil ) +This is a nop defgroup only for emulating purpose." + nil) (defmacro-maybe defcustom (symbol value doc &rest args) "Declare SYMBOL as a customizable variable that defaults to VALUE. @@ -48,16 +50,26 @@ DOC is the variable documentation. This is a defcustom only for emulating purpose. Its effect is just as same as that of defvar." - (` (defvar (, symbol) (, value) (, doc))) ) + (` (defvar (, symbol) (, value) (, doc)))) -(defmacro-maybe defface (symbol value doc &rest args) - "Declare FACE as a customizable face that defaults to SPEC. +(defmacro-maybe-cond defface (face value doc &rest args) + "Declare FACE as a customizable face that defaults to SPEC. FACE does not need to be quoted. +\[custom emulating macro]" + ((fboundp 'make-face) + (` (make-face (, face)))) + (t + ;; do nothing. + )) -This is a nop defface only for emulating purpose." - nil ) +(defmacro-maybe define-widget (name class doc &rest args) + "Define a new widget type named NAME from CLASS. +The third argument DOC is a documentation string for the widget. + +This is a nop define-widget only for emulating purpose." + nil) (provide 'tinycustom) (provide 'custom) -;; end of tinycustom.el +;;; tinycustom.el ends here.