[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ELPA] Update package: psgml

From: Stefan Monnier
Subject: Re: [ELPA] Update package: psgml
Date: Wed, 19 Apr 2017 08:35:22 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

>> Could you give some further details about the context where you bumped
>> into the problem?
> I'm doing a lot of DSSSL at the moment, and I wanted the SGML editor
> commands to work in DSSSL mode.  With sgml-set-face turned on for
> editing SGML structure, doing something like sgml-insert-element
> fontifies for SGML up to point instead of fontifying for lisp because
> PSGML fontifies as it parses the buffer to figure out the current
> element.

I'm not really familiar with DSSSL, so I'm not sure what thie use case
looks like concretely.  Is that some Lisp-ish sublanguage that appears
between two SGML tags or on the contrary Lisp-ish language with SGML
tags within it (i.e. some sort of multi-major-mode situation)?

Do you use a dsssl-mode major mode for it?  Can you point me to it?

> I actually wanted it to be mode-local, which emacs doesn't really do,

Emacs does support "mode-local" in the following sense:

    (add-hook 'foo1-mode-hook (lambda () (setq-local VAR VAL1)))
    (add-hook 'foo2-mode-hook (lambda () (setq-local VAR VAL2)))

> I can set sgml-set-face in a hook for sgml-mode, but then I have to
> unset it if I want to edit in the other mode.  I figured a single list
> of modes where SGML should be fontified would be easier to keep track of
> than a slue of mode hooks.

A bunch of mode hooks is the "standard" way to deal with such situations
in Emacs.  Which is more convenient depends on the situation, admittedly.

In the specific case of psgml, I think the real fix should be to make
psgml interact more normally with font-lock.  I haven't looked into it
hard enough yet, tho.

> I looked into indirect buffers, but this seems more intuitive.

This makes me feel like you indeed have a multi-major-mode situation, in
which case sgml-set-face is probably just one part of the problem (and
using indirect buffers would just add more problems).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]