Mercurial > hg > xemacs-beta
diff lisp/specifier.el @ 408:501cfd01ee6d r21-2-34
Import from CVS: tag r21-2-34
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:18:11 +0200 |
parents | 2f8bb876ab1d |
children | 697ef44129c6 |
line wrap: on
line diff
--- a/lisp/specifier.el Mon Aug 13 11:17:10 2007 +0200 +++ b/lisp/specifier.el Mon Aug 13 11:18:11 2007 +0200 @@ -1,7 +1,7 @@ ;;; specifier.el --- Lisp interface to specifiers ;; Copyright (C) 1997 Free Software Foundation, Inc. -;; Copyright (C) 1995, 1996 Ben Wing. +;; Copyright (C) 1995, 1996, 2000 Ben Wing. ;; Author: Ben Wing <ben@xemacs.org> ;; Keywords: internal, dumped @@ -275,18 +275,20 @@ VALUE is usually what is called an \"instantiator\" (which, roughly speaking, corresponds to the \"value\" of the property governed by -SPECIFIER). The valid instantiators for SPECIFIER depend on the -type of SPECIFIER (which you can determine using `specifier-type'). -The specifier `scrollbar-width', for example, is of type `integer', -meaning its valid instantiators are integers. The specifier -governing the background color of the `default' face (you can -retrieve this specifier using `(face-background 'default)') is -of type `color', meaning its valid instantiators are strings naming -colors and color-instance objects. For some types of specifiers, -such as `image' and `toolbar', the instantiators can be very -complex. Generally this is documented in the appropriate predicate -function -- `color-specifier-p', `image-specifier-p', -`toolbar-specifier-p', etc. +SPECIFIER). The valid instantiators for SPECIFIER depend on the type +of SPECIFIER (which you can determine using `specifier-type'). The +specifier `scrollbar-width', for example, is of type `integer', +meaning its valid instantiators are integers. The specifier governing +the background color of the `default' face (you can retrieve this +specifier using `(face-background 'default)') is of type `color', +meaning its valid instantiators are strings naming colors and +color-instance objects. For some types of specifiers, such as `image' +and `toolbar', the instantiators can be very complex. Generally this +is documented in the appropriate creation function -- +e.g. `make-color-specifier', `make-font-specifier', +`make-image-specifier' -- or in the global variable holding the most +common specifier for that type (`default-toolbar', `default-gutter', +`current-display-table'). NOTE: It does *not* work to give a VALUE of nil as a way of removing the specifications for a locale. Use `remove-specifier' @@ -526,6 +528,58 @@ ,(car oldval)))) oldvallist varlist)))))))) +(defun make-integer-specifier (spec-list) + "Return a new `integer' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for integer specifiers are integers." + (make-specifier-and-init 'integer spec-list)) + +(defun make-boolean-specifier (spec-list) + "Return a new `boolean' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for boolean specifiers are t and nil." + (make-specifier-and-init 'boolean spec-list)) + +(defun make-natnum-specifier (spec-list) + "Return a new `natnum' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for natnum specifiers are non-negative integers." + (make-specifier-and-init 'natnum spec-list)) + +(defun make-generic-specifier (spec-list) + "Return a new `generic' specifier object with the given specification list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for generic specifiers are all Lisp values. +They are returned back unchanged when a specifier is instantiated." + (make-specifier-and-init 'generic spec-list)) + +(defun make-display-table-specifier (spec-list) + "Return a new `display-table' specifier object with the given spec list. +SPEC-LIST can be a list of specifications (each of which is a cons of a +locale and a list of instantiators), a single instantiator, or a list +of instantiators. See `make-specifier' for more information about +specifiers. + +Valid instantiators for display-table specifiers are described in +detail in the doc string for `current-display-table'." + (make-specifier-and-init 'display-table spec-list)) + ;; Evaluate this for testing: ; (cl-prettyexpand '(let-specifier ((modeline-shadow-thickness 0 (selected-window) 'x) (fubar (value) baz)) (sit-for 1)))