[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding to a submenu under the HTML menu
From: |
ken |
Subject: |
Re: Adding to a submenu under the HTML menu |
Date: |
Sat, 28 Jan 2006 06:03:40 -0500 |
On Tue, 24 Jan 2006 20:35:01 +0100 François.Gannaz
<mytskine@laposte.net> wrote:
> Le dim 22 jan 23:36, ken a écrit :
> >
> > I want to add some German characters to the "Insert Character
> > Entities" submenu under the "HTML" menu. Yes, there's a lot of docs
> > on customizing menus, but I can't figure out the current code so
> > don't know which docs are applicable. Would anyone know how to add
> > a few nice characters to that submenu?
>
> I guess you're using html-helper-mode.
>
> Quoting from html-helper-mode.el :
> html-helper-add-tag (l)
> "Add a new tag to html-helper-mode.
> Builds a tempo-template for the tag and puts it into the
> appropriate keymap if a key is requested. Format:
> `(html-helper-add-tag '(type keybinding completion-tag menu-name
> template doc)'
> [...]
>
> So you could try in a *scratch buffer* :
> (html-helper-add-tag
> '(entity "\C-c%" "ç" "C cédille" ("ç")))
> (html-helper-rebuild-menu)
> After evaluating, it should appear automatically in the HTML menu.
Marvelous! Works perfect. Thanks very much, François.
>
> If its's OK, put it in your .emacs, for example in a
> html-helper-load-hook. For more details and examples, have a look at
> html-helper-mode.el.
Makes sense.... I've done that before, but with only one function, like
(add-hook 'html-helper-mode-hook 'turn-on-auto-fill)
I found and adapted some code, but my block of several entries shows up
in the menu multiple times-- more than enough times to make the submenu
extend from the top of the screen to the bottom.
(add-hook 'html-helper-mode-hook
; (function
(quote
(lambda ()
(html-helper-add-tag
'(entity "\C-c%" "ç" "C cédille" ("ç")))
(html-helper-add-tag
'(entity "\C-cD" "‡" "double dagger (‡)" ("‡")))
(html-helper-add-tag
'(entity "\C-cd" "†" "dagger (†)" ("†")))
(html-helper-add-tag ; Scharfes S
'(entity "\C-cs" "ß" "eszett ß (ß)" ("ß")))
(html-helper-add-tag
'(entity "\C-cU" "Ü" "Ü (Ü)" ("Ü")))
(html-helper-add-tag
'(entity "\C-cO" "Ö" "Ö (Ö)" ("Ö")))
; (html-helper-add-tag
; '(entity "\C-cI" "Ï" "Ï (Ï)" ("Ï")))
(html-helper-add-tag
'(entity "\C-cE" "Ë" "Ë (Ë)" ("Ë")))
(html-helper-add-tag
'(entity "\C-cA" "Ä" "Ä (Ä)" ("Ä")))
(html-helper-add-tag
'(entity "\C-cu" "ü" "ü (ü)" ("ü")))
(html-helper-add-tag
'(entity "\C-co" "ö" "ö (ö)" ("ö")))
; (html-helper-add-tag
; '(entity "\C-ci" "ï" "ï (ï)" ("ï")))
(html-helper-add-tag
'(entity "\C-ce" "ë" "ë (ë)" ("ë")))
(html-helper-add-tag
'(entity "\C-ca" "ä" "ä (ä)" ("ä")))
(html-helper-rebuild-menu))))
The problem, I'm fairly certain has to do with the placement of
(html-helper-rebuild-menu) and I've tried putting it in different
places, even within a separate "(add-hook 'html-helper-mode-hook
'html-helper-rebuild-menu)" but none gave satisfactory results. I could
be missing some syntax-- perhaps some quoting?--, but I really have no
idea what it might be.
Thanks very much for any further help,
ken
> --
> François Gannaz
--
"This world ain't big enough for the both of us,"
said the big noema to the little noema.