(defface): Quote the argument of `make-face'.
[elisp/apel.git] / tinycustom.el
1 ;; tinycustom.el -- a tiny custom.el for emulating purpose.
2
3 ;; Copyright (C) 1999 Mikio Nakajima <minakaji@osaka.email.ne.jp>
4
5 ;; Author: Mikio Nakajima <minakaji@osaka.email.ne.jp>
6 ;; Maintainer: Mikio Nakajima <minakaji@osaka.email.ne.jp>
7 ;; Keywords: emulating, custom
8
9 ;; This file is part of APEL (A Portable Emacs Library).
10
11 ;; This program is free software; you can redistribute it and/or
12 ;; modify it under the terms of the GNU General Public License as
13 ;; published by the Free Software Foundation; either version 2, or (at
14 ;; your option) any later version.
15
16 ;; This program is distributed in the hope that it will be useful, but
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 ;; General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26 ;;; Commentary:
27
28 ;; Purpose of this program is emulating for who does not have "custom".
29 ;; (custom.el bundled with v19 is old; does not have following macros.)
30 ;;
31 ;; DEFCUSTOM below has the same effect as the original DEFVAR has.
32 ;; DEFFACE only makes a face.
33 ;; DEFGROUP and DEFINE-WIDGET below are just nop macro.
34
35 ;;; Code:
36
37 (require 'poe)
38
39 (defmacro-maybe defgroup (symbol members doc &rest args)
40   "Declare SYMBOL as a customization group containing MEMBERS.
41 SYMBOL does not need to be quoted.
42 Third arg DOC is the group documentation.
43
44 This is a nop defgroup only for emulating purpose."
45   nil)
46     
47 (defmacro-maybe defcustom (symbol value doc &rest args) 
48   "Declare SYMBOL as a customizable variable that defaults to VALUE.
49 DOC is the variable documentation.
50
51 This is a defcustom only for emulating purpose.
52 Its effect is just as same as that of defvar."
53   (` (defvar (, symbol) (, value) (, doc))))
54     
55 (defmacro-maybe-cond defface (face value doc &rest args) 
56       "Declare FACE as a customizable face that defaults to SPEC.
57 FACE does not need to be quoted.
58 \[custom emulating macro]"
59       ((fboundp 'make-face)
60        (` (make-face (quote (, face)))))
61       (t
62        ;; do nothing.
63        ))
64
65 (defmacro-maybe define-widget (name class doc &rest args)
66   "Define a new widget type named NAME from CLASS.
67 The third argument DOC is a documentation string for the widget.
68
69 This is a nop define-widget only for emulating purpose."
70   nil)
71
72 (provide 'tinycustom)
73 (provide 'custom)
74
75 ;;; tinycustom.el ends here.