At 02:19 AM 2/27/00 +0100, Jan Vroonhof wrote:
Andy Piper <andy(a)xemacs.org> writes:
> diff -u -r1.7.2.10 font-lock.el
> --- lisp/font-lock.el 2000/02/19 11:52:58 1.7.2.10
> +++ lisp/font-lock.el 2000/02/26 21:18:28
Did you want to include this...?
No. I sent the unedited patch. I didn't actually commit this.
Some comments (from a casual glance) about your specifier stuff. I
agree that the specifier stuff can be hard. (I had to debug
frob-face-property!)
Note that for each locale there is a LIST of cons pairs.
Ok.
You don't want to use 'remove-all, that would remove the
spec-list
from other locales too. Just use nil, which will do the right thing.
Ok.
> + (set-specifier gutter-specifier (list prop val) locale
tag-set))))
I don't think this a good idea. You probably want to inherit the other
properties from the lower locales. You should call plist-put on the
(specifier-instance gutter-specifier locale tag-set) if locale is a domain.
Yes you are right.
(defun modify-specifier-instances (specifier func &optional args
force
default
locale tag-set)
"Modify all specifications that match LOCALE and TAG-SET by FUNC.
For each specification that exists for SPECIFIER, in locale LOCALE that
matches
TAG-SET, call the function FUNC with the instance as its first
argument and
with optional arguments ARGS. The result is then used as the new value
of the instantiator.
If there is no specification in the domain LOCALE matching TAG-SET and
FORCE is
non-nil, an explicit one is created from the matching specifier
instance if
that exists or DEFAULT otherwise. If LOCALE is not a domain (i.e. a buffer),
DEFAULT is always used. FUNC is then applied like above and the
resulting specification is added."
(let ((spec-list (specifier-spec-list specifier locale tag-set)))
(cond
(spec-list
;; Distructively edit the spec-list
(mapc #'(lambda (spec)
(mapc #'(lambda (inst-pair)
(setcdr inst-pair
(apply func (cdr inst-pair) args)))
(cdr spec)))
spec-list)
(add-spec-list-to-specifier specifier))
(force
(set-specifier specifier
(apply func
(or (and (valid-specifier-domain-p locale)
(specifier-instance specifier))
default) args)
locale tag-set)))))
Excellent. You missed out a spec-list, but I have used this now. I was
going to get it working before I prettified it....
andy
--------------------------------------------------------------
Dr Andy Piper
Senior Consultant Architect, BEA Systems Ltd