[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: html-mode: adding tags to html-tag-alist
From: |
tyler |
Subject: |
Re: html-mode: adding tags to html-tag-alist |
Date: |
Wed, 15 Jul 2009 12:23:10 -0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) |
Bernardo <bernardo.bacic@pobox.com> writes:
>>
>> I'm trying to customize html-mode, but I'm having trouble with the
>> skeleton stuff. I want to get a prompt for class or id for div tags, but
>> I can't figure out how to do it. I think I have to change
>> html-tags-alist somehow, but I'm not sure how, or if there's anything
>> else I need to do in addition. The manual is pretty skimpy on this
>> topic, and I'm missing a few steps between the description of skeletons
>> in the wiki and the application of the skeletons in html-mode.
>
> i've bookmared this (if you are keen for more reading):
> http://www.panix.com/~tehom/my-code/skel-recipe.txt
>
> and there is always EmacsWiki:
> http://www.emacswiki.org/cgi-bin/wiki/SkeletonMode
Thanks for your help, but that's not where my problem is. I can follow,
sort of, the instructions for setting up a basic skeleton. What I need
to know how to do is to modify the html-tag-alist in html-mode to get it
to do what I want with div tags.
The help for sgml-tag says:
Prompt for a tag and insert it, optionally with attributes.
Completion and configuration are done according to `sgml-tag-alist'.
It goes on to say that this is built on skeleton-insert, pointing to
that help page. The basic syntax of skeletons I'm beginning to
understand, so I looked at the help for sgml-tag-alist. This page
describes two different alists, TAGRULE and ATTRIBUTERULE. This variable
is customizable, so I opened the customize dialogue and added a new
cons-cell with Tag Name: div, but I can't figure out a Tag Rule that
will provide class and id as options, and also separate the start and
end tags with a newline.
A further complication is that whatever I do in the customize dialogue
gets overwritten by the hard-coded contents of html-tag-alist anyways,
so it doesn't really matter.
So what I'm wondering now is if it is even possible to modify the way
sgml-tag works in html-mode, and if so, how? I could probably figure out
how to write my own skeleton from scratch and have that loaded with an
html-mode-hook, but that seems silly when html-mode is so close to
providing everything I'm looking for.
Any other suggestions? Thanks!
Tyler
--
There is something fascinating about science. One gets such wholesale
returns of conjecture out of such a trifling investment of fact.
--Mark Twain