unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: tyler <tyler.smith@mail.mcgill.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: html-mode: adding tags to html-tag-alist
Date: Wed, 15 Jul 2009 12:23:10 -0300	[thread overview]
Message-ID: <874otenf6p.fsf@blackbart.sedgenet> (raw)
In-Reply-To: 4A5DB363.70902@pobox.com

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





      reply	other threads:[~2009-07-15 15:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15  1:49 html-mode: adding tags to html-tag-alist tyler
2009-07-15 10:45 ` Bernardo
2009-07-15 15:23   ` tyler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874otenf6p.fsf@blackbart.sedgenet \
    --to=tyler.smith@mail.mcgill.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).