i created this awhile ago and mentioned it on the lists, but no one responded.
i've fixed this up a bunch and tested it, and added it to lisp/.
we really should fix up fsf-compat.el to use this; then, we have no problems
putting it in the sumo.
In order to save my hands, I am cutting back on my mail. I also write
as succinctly as possible -- please don't be offended. If you send me
mail, you _will_ get a response, but please be patient, especially for
XEmacs-related mail. If you need an immediate response and it is not
apparent in your message, please say so. Thanks for your understanding.
See also http://www.666.com/ben/chronic-pain/
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/ChangeLog,v
retrieving revision 126.96.36.1990
diff -u -r188.8.131.520 ChangeLog
--- ChangeLog 2000/06/05 08:42:46 184.108.40.2060
+++ ChangeLog 2000/06/06 03:57:13
＠＠ -1,5 +1,8 ＠＠
2000-06-05 Ben Wing <ben(a)xemacs.org>
+ * compat.el: new file. provides a clean, non-intrusive way to
+ define compatibility functions.
* process.el (shell-quote-argument): temporary fix for lack
of nt-quote-process-args. #### I need to put back the overall
structure of that mechanism but redo the guts of it using the
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/auto-autoloads.el,v
retrieving revision 220.127.116.11
diff -u -r18.104.22.168 auto-autoloads.el
--- auto-autoloads.el 2000/04/28 09:25:14 22.214.171.124
+++ auto-autoloads.el 2000/06/06 03:57:14
＠＠ -276,95 +276,123 ＠＠
(defcustom font-lock-maximum-size (* 250 1024) "*If non-nil, the maximum size for
buffers for fontifying.\nOnly buffers less than this can be fontified when Font Lock mode
is turned on.\nIf nil, means size is irrelevant.\nIf a list, each element should be a cons
pair of the form (MAJOR-MODE . SIZE),\nwhere MAJOR-MODE is a symbol or t (meaning the
default). For example:\n ((c++-mode . 256000) (c-mode . 256000) (rmail-mode .
1048576))\nmeans that the maximum size is 250K for buffers in `c++-mode' or
`c-mode', one\nmegabyte for buffers in `rmail-mode', and size is irrelevant
otherwise." :type '(choice (const :tag "none" nil) (integer :tag
"size") (repeat :menu-tag "mode specific" :tag "mode
specific" :value ((t)) (cons :tag "Instance" (radio :tag "Mode"
(const :tag "all" t) (symbol :tag "name")) (radio :tag
"Size" (const :tag "none" nil) (integer :tag "size")))))
(defvar font-lock-keywords nil "\
-A list of the keywords to highlight.
-Each element should be of the form:
+A list defining the keywords for `font-lock-mode' to highlight.
- (MATCHER . MATCH)
- (MATCHER . FACENAME)
- (MATCHER . HIGHLIGHT)
- (MATCHER HIGHLIGHT ...)
- (eval . FORM)
-where HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED.
-FORM is an expression, whose value should be a keyword element,
-evaluated when the keyword is (first) used in a buffer. This feature
-can be used to provide a keyword that can only be generated when Font
-Lock mode is actually turned on.
+ FONT-LOCK-KEYWORDS := List of FONT-LOCK-FORM's.
-For highlighting single items, typically only MATCH-HIGHLIGHT is required.
-However, if an item or (typically) items is to be highlighted following the
-instance of another item (the anchor) then MATCH-ANCHORED may be required.
-MATCH-HIGHLIGHT should be of the form:
- (MATCH FACENAME OVERRIDE LAXMATCH)
+ FONT-LOCK-FORM :== MATCHER
+ | (MATCHER . MATCH)
+ | (MATCHER . FACE-FORM)
+ | (MATCHER . HIGHLIGHT)
+ | (MATCHER HIGHLIGHT ...)
+ | (eval . FORM)
+ MATCHER :== A string containing a regexp.
+ | A variable containing a regexp to search for.
+ | A function to call to make the search.
+ It is called with one arg, the limit of the search,
+ and should leave MATCH results in the XEmacs global
+ match data.
+ MATCH :== An integer match subexpression number from MATCHER.
+ FACE-FORM :== The symbol naming a defined face.
+ | Expression whos value is the face name to use. If you
+ want FACE-FORM to be a symbol that evaluates to a face,
+ use a form like \"(progn sym)\".
+ HIGHLIGHT :== MATCH-HIGHLIGHT
+ | MATCH-ANCHORED
+ FORM :== Expression returning a FONT-LOCK-FORM, evaluated when
+ the FONT-LOCK-FORM is first used in a buffer. This
+ feature can be used to provide a FONT-LOCK-FORM that
+ can only be generated when Font Lock mode is actually
+ turned on.
+ MATCH-HIGHLIGHT :== (MATCH FACE-FORM OVERRIDE LAXMATCH)
+ OVERRIDE :== t - overwrite existing fontification
+ | 'keep - only parts not already fontified are
+ | 'prepend - merge faces, this fontification has
+ precedence over existing
+ | 'append - merge faces, existing fontification has
+ precedence over
+ this face.
+ LAXMATCH :== If non-nil, no error is signalled if there is no MATCH
+ in MATCHER.
+ MATCH-ANCHORED :== (ANCHOR-MATCHER PRE-MATCH-FORM \\
+ POST-MATCH-FORM MATCH-HIGHLIGHT ...)
+ ANCHOR-MATCHER :== Like a MATCHER, except that the limit of the search
+ defaults to the end of the line after PRE-MATCH-FORM
+ is evaluated. However, if PRE-MATCH-FORM returns a
+ position greater than the end of the line, that
+ position is used as the limit of the search. It is
+ generally a bad idea to return a position greater than
+ the end of the line, i.e., cause the ANCHOR-MATCHER
+ search to span lines.
+ PRE-MATCH-FORM :== Evaluated before the ANCHOR-MATCHER is used, therefore
+ can be used to initialize before, ANCHOR-MATCHER is
+ used. Typically, PRE-MATCH-FORM is used to move to
+ some position relative to the original MATCHER, before
+ starting with the ANCHOR-MATCHER.
+ POST-MATCH-FORM :== Like PRE-MATCH-FORM, but used to clean up after the
+ ANCHOR-MATCHER. It might be used to move, before
+ resuming with MATCH-ANCHORED's parent's MATCHER.
+For example, an element of the first form highlights (if not already highlighted):
+ \"\\\\<foo\\\\>\" Discrete occurrences of
\"foo\" in the value
+ of the variable `font-lock-keyword-face'.
+ (\"fu\\\\(bar\\\\)\" . 1) Substring \"bar\" within all
+ \"fubar\" in the value of
+ (\"fubar\" . fubar-face) Occurrences of \"fubar\" in the
+ (\"foo\\\\|bar\" 0 foo-bar-face t) Occurrences of either \"foo\" or
\"bar\" in the
+ value of `foo-bar-face', even if already
+ (fubar-match 1 fubar-face) The first subexpression within all
+ occurrences of whatever the function
+ `fubar-match' finds and matches in the value
+ of `fubar-face'.
+ (\"\\\\<anchor\\\\>\" (0 anchor-face)
(\"\\\\<item\\\\>\" nil nil (0 item-face)))
+ -------------- --------------- ------------ --- --- -------------
+ | | | | | |
+ MATCHER | ANCHOR-MATCHER | +------+ MATCH-HIGHLIGHT
+ MATCH-HIGHLIGHT PRE-MATCH-FORM |
+ Discrete occurrences of \"anchor\" in the value of `anchor-face', and
+ subsequent discrete occurrences of \"item\" (on the same line) in the value
+ of `item-face'. (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil.
+ Therefore \"item\" is initially searched for starting from the end of the
+ match of \"anchor\", and searching for subsequent instance of
+ resumes from where searching for \"item\" concluded.)
-Where MATCHER can be either the regexp to search for, a variable
-containing the regexp to search for, or the function to call to make
-the search (called with one argument, the limit of the search). MATCH
-is the subexpression of MATCHER to be highlighted. FACENAME is either
-a symbol naming a face, or an expression whose value is the face name
-to use. If you want FACENAME to be a symbol that evaluates to a face,
-use a form like \"(progn sym)\".
-OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification may
-be overwritten. If `keep', only parts not already fontified are highlighted.
-If `prepend' or `append', existing fontification is merged with the new, in
-which the new or existing fontification, respectively, takes precedence.
-If LAXMATCH is non-nil, no error is signalled if there is no MATCH in MATCHER.
-For example, an element of the form highlights (if not already highlighted):
- \"\\\\\\=<foo\\\\\\=>\" Discrete occurrences of \"foo\" in
the value of the
- variable `font-lock-keyword-face'.
- (\"fu\\\\(bar\\\\)\" . 1) Substring \"bar\" within all occurrences
of \"fubar\" in
- the value of `font-lock-keyword-face'.
- (\"fubar\" . fubar-face) Occurrences of \"fubar\" in the value of
- (\"foo\\\\|bar\" 0 foo-bar-face t)
- Occurrences of either \"foo\" or \"bar\" in the value
- of `foo-bar-face', even if already highlighted.
-MATCH-ANCHORED should be of the form:
- (MATCHER PRE-MATCH-FORM POST-MATCH-FORM MATCH-HIGHLIGHT ...)
-Where MATCHER is as for MATCH-HIGHLIGHT with one exception; see below.
-PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after
-the last, instance MATCH-ANCHORED's MATCHER is used. Therefore they can be
-used to initialize before, and cleanup after, MATCHER is used. Typically,
-PRE-MATCH-FORM is used to move to some position relative to the original
-MATCHER, before starting with MATCH-ANCHORED's MATCHER. POST-MATCH-FORM might
-be used to move, before resuming with MATCH-ANCHORED's parent's MATCHER.
-For example, an element of the form highlights (if not already highlighted):
- (\"\\\\\\=<anchor\\\\\\=>\" (0 anchor-face)
(\"\\\\\\=<item\\\\\\=>\" nil nil (0 item-face)))
- Discrete occurrences of \"anchor\" in the value of `anchor-face', and
- discrete occurrences of \"item\" (on the same line) in the value of
- (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. Therefore \"item\" is
- initially searched for starting from the end of the match of \"anchor\", and
- searching for subsequent instance of \"anchor\" resumes from where searching
- for \"item\" concluded.)
-The above-mentioned exception is as follows. The limit of the MATCHER search
-defaults to the end of the line after PRE-MATCH-FORM is evaluated.
-However, if PRE-MATCH-FORM returns a position greater than the position after
-PRE-MATCH-FORM is evaluated, that position is used as the limit of the search.
-It is generally a bad idea to return a position greater than the end of the
-line, i.e., cause the MATCHER search to span lines.
-Note that the MATCH-ANCHORED feature is experimental; in the future, we may
-replace it with other ways of providing this functionality.
+For highlighting single items, typically only MATCH-HIGHLIGHT is required.
+However, if an item or (typically) several items are to be highlighted
+following the instance of another item (the anchor) then MATCH-ANCHORED may be
These regular expressions should not match text which spans lines. While
-\\[font-lock-fontify-buffer] handles multi-line patterns correctly, updating
-when you edit the buffer does not, since it considers text one line at a time.
+\\[font-lock-fontify-buffer] handles multi-line patterns correctly, updating when you
+edit the buffer does not, since it considers text one line at a time.
-Be very careful composing regexps for this list;
-the wrong pattern can dramatically slow things down!")
+Be very careful composing regexps for this list; the wrong pattern can
+dramatically slow things down!
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/cl-seq.el,v
retrieving revision 1.3
diff -u -r1.3 cl-seq.el
--- cl-seq.el 1998/03/31 20:11:02 1.3
+++ cl-seq.el 2000/06/06 03:57:15
＠＠ -65,6 +65,23 ＠＠
;;; this file independent from cl-macs.
(defmacro cl-parsing-keywords (kwords other-keys &rest body)
+ "Helper macro for functions with keyword arguments.
+This is a temporary solution, until keyword arguments are natively supported.
+Declare your function ending with (... &rest cl-keys), then wrap the
+function body in a call to `cl-parsing-keywords'.
+KWORDS is a list of keyword definitions. Each definition should be
+either a keyword or a list (KEYWORD DEFAULT-VALUE). In the former case,
+the default value is nil. The keywords are available in BODY as the name
+of the keyword, minus its initial colon and prepended with `cl-'.
+OTHER-KEYS specifies other keywords that are accepted but ignored. It
+is either the value 't' (ignore all other keys, equivalent to the
+&allow-other-keys argument declaration in Common Lisp) or a list in the
+same format as KWORDS. If keywords are given that are not in KWORDS
+and not allowed by OTHER-KEYS, an error will normally be signalled; but
+the caller can override this by specifying a non-nil value for the
+keyword :allow-other-keys (which defaults to t)."