[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
If you’d like to add new HTML elements to this package, you should first take
a look at the file ‘hm--html-not-standard.el’, which
already contains some non-standard elements. If you find your tags
there, you should uncomment the line (require
'hm--html-not-standard)
in the file ‘hm--html-mode.el’. There are
also menu entries for these elements in the file
‘hm--html-menu.el’, which are commented out. Don’t forget to
recompile the changed lisp files after that!
If you don’t find your new elements there, you should do the following steps to add them:
hm--html-add-strong
and
hm--html-add-strong-to-region
. The first one is used if no
region is active, and the second if a region is active. The naming scheme
of these functions is always hm–html-add-<tagname> and
hm–html-add-<tagname>-to-region. <tagname> is not in all
cases the tagname. Sometimes a more human readable name is used (e.g.
bold instead of b).
hm--html-tag-name-alist
,
which is defined in the file ‘hm--html-configuration.el’. Let’s
assume that the new tagname is ‘foo’. The entry in
hm--html-tag-name-alist
should be
("foo" (:hm--html-one-element-tag t)) |
if the new element consists only of one tag (‘img’ is such an element) or
("foo" (:hm--html-two-element-tag t)) |
if the new element consists of two tags (‘strong’ is such an element) or
("foo" (:hm--html-one-or-two-element-tag t)) |
if the new element consists of two tags, but it is permissible to use the start tag without its end tag (‘p’ is such an element).
Now you are ready and able to insert the new tags with
M-x hm--html-add-foo |
and
M-x hm--html-add-foo-to-region |
If you want to add the new commands also to the popup menu,
then you have to take a look at ‘hm--html-menu.el’, where all the
menus are defined. Look at hm--html-menu-noregion-expert
and
hm--html-menu-region-expert
. The first one is used if no region is
active, and the second if a region is active (both are only available
if the "expert menus" are used; this is an option in the pulldown
menu). You should now add an entry like
["Foo" hm--html-add-foo t] |
to the hm--html-menu-noregion-expert
variable and an entry
["Foo" hm--html-add-foo-to-region t] |
to the hm--html-menu-region-expert
variable (only if
hm--html-add-foo-to-region
exists). You can do this by setting the
whole variable to a new value or by using the function
add-menu-button
. I recommend the last method.
If you’d like to have a key sequence for inserting the new tag as well, take a look at ‘hm--html-keys.el’. There are different key tables defined for region and no region cases and for different sorts of elements, like anchors, frame elements (doesn’t mean the Netscape element frame) and so on. These "groups" are the same as the submenu groups.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by Aidan Kehoe on December 27, 2016 using texi2html 1.82.