emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] Update package: psgml (discard patch)


From: Lucien Pullen
Subject: Re: [ELPA] Update package: psgml (discard patch)
Date: Fri, 21 Apr 2017 02:06:25 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (darwin)

Also sprach Stefan Monnier on 2017-04-19:
> 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?

It's lisp and entity references between two SGML tags, like this:

  <style-specification>
  (element par (make paragraph start-indent: &indentS;))
  </style-specification>

The mode is dsssl-mode from the built-in scheme elisp library.

>> 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.

I read the buffer local sections in the manual again following your
example.  Emacs does do mode local.  That... isn't how I understood
buffer-local variables to work.

In this case, I consider the patch unnecessary.

> 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.

PSGML only understands the reference concrete syntax, so, with a few
exceptions such as for fontifying Null End Tags only when they can occur
and using the value of parameter entities for marked sections, it should
be able to use font lock using regular expressions.

> 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).

I've run into multi-major-mode a lot while doing SGML stuff.  I do miss
MuMaMo integration with nHTML, but I hardly write directly in HTML any
more and I don't use PHP, so...  There's something about the NOTATION
attribute giving the editor access to which major mode element content
is in that lends itself to multi-major-mode.

At least, that's how I'd like to use psgml, but I need to learn a lot
more about modes before I tried something like making emacs SGML-aware.



reply via email to

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