help-gnu-emacs
[Top][All Lists]
Advanced

[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%"   "&ccedil;" "C cédille" ("&ccedil;")))
>   (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%"   "&ccedil;" "C cédille" ("&ccedil;")))

     (html-helper-add-tag
      '(entity "\C-cD"   "&#135;" "double dagger (&#135;)" ("&#135;")))

     (html-helper-add-tag
      '(entity "\C-cd"   "&#134;" "dagger (&#134;)" ("&#134;")))

     (html-helper-add-tag       ; Scharfes S
      '(entity "\C-cs"   "&szlig;" "eszett ß (&szlig;)" ("&szlig;"))) 

     (html-helper-add-tag
      '(entity "\C-cU"   "&Uuml;" "Ü (&Uuml;)" ("&Uuml;")))
     (html-helper-add-tag
      '(entity "\C-cO"   "&Ouml;" "Ö (&Ouml;)" ("&Ouml;")))
;     (html-helper-add-tag
;      '(entity "\C-cI"   "&Iuml;" "Ï (&Iuml;)" ("&Iuml;")))
     (html-helper-add-tag
      '(entity "\C-cE"   "&Euml;" "Ë (&Euml;)" ("&Euml;")))
     (html-helper-add-tag
      '(entity "\C-cA"   "&Auml;" "Ä (&Auml;)" ("&Auml;")))
     
     (html-helper-add-tag
      '(entity "\C-cu"   "&uuml;" "ü (&uuml;)" ("&uuml;")))
     (html-helper-add-tag
      '(entity "\C-co"   "&ouml;" "ö (&ouml;)" ("&ouml;")))
;     (html-helper-add-tag
;      '(entity "\C-ci"   "&iuml;" "ï (&iuml;)" ("&iuml;")))
     (html-helper-add-tag
      '(entity "\C-ce"   "&euml;" "ë (&euml;)" ("&euml;")))
     (html-helper-add-tag
      '(entity "\C-ca"   "&auml;" "ä (&auml;)" ("&auml;")))
     (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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]