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

Re: Emacs HTML modes



On 19/01/02 Manoj Srivastava did speaketh:

>  - User Option: sgml-markup-faces
>      A list of markup to face mappings.  Each element looks like
>      `(MARKUP-TYPE . FACE)'.  Possible values for MARKUP-TYPE is:
>     `comment'         comment declaration
>     `doctype'         doctype declaration
>     `end-tag'         end-tag
>     `ignored'         ignored marked section
>     `ms-start'        marked section end, if not ignored
>     `ms-end'          marked section start, if not ignored
>     `pi'              processing instruction
>     `sgml'            SGML declaration
>     `start-tag'       start-tag
>     `entity'          entity reference
>     `shortref'        short reference

    Ok. I got the reply to the bug officially as well, thanks for that. I'll
play with this, and RTFM since it's obvious that I should have done that
already. ;-)

    Just to ensure that I understand the limitation here, let me explain it
back to you and you can tell me if I'm right. 
    Normally the font-lock faces are set during initialization of emacs,
either from default values or from the user's ~/.emacs file (like in my case).
However, psgml-mode can't use font-lock because instead of knowing the
patterns to specify to font-lock when the mode initializes, it must first
parse the DTD for the language being used, and pull out the keywords from it. 
    Why is it that this newly-parsed information cannot be used to make a new
dynamic call to font-lock? I understood that lisp was quite a
dynamically-bound language and such tricks as common in Perl and Python were
done much earlier in Lisp. Forgive my ignorance of the font-lock API. As I
understand it, you can call font-lock, passing it a list of regexp patterns
and corresponding faces for that pattern. I don't follow why updating the
patterns and re-fontifying can't be done. 

> 	I meant for psgml's modes. As for perl, well, Perl syntax is
>  hard to parse for anything but, umm, perl itself.  I wouldn't plcae
>  blame on indent region or cperl mode for that ;-)

    And occasionally not even by perl. :) The fact that it makes sense to me
is often a source of fear and trepidation that perhaps I've gone too far into
a world that's going to suck me in and never let me out. Strangely, I like it. 

    Thanks for the help Manoj,

    Mike

-- 
Michael P. Soulier <msoulier@mcss.mcmaster.ca>, GnuPG pub key: 5BC8BE08
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to Unix

Attachment: pgpBupz0Z4XNW.pgp
Description: PGP signature


Reply to: