unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Adding to a submenu under the HTML menu
@ 2006-01-23  4:36 ken
  2006-01-24 17:21 ` Kevin Rodgers
  2006-01-24 19:35 ` François.Gannaz
  0 siblings, 2 replies; 7+ messages in thread
From: ken @ 2006-01-23  4:36 UTC (permalink / raw)



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?

TNX.

-- 
"This world ain't big enough for the both of us,"
said the big noema to the little noema.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding to a submenu under the HTML menu
  2006-01-23  4:36 Adding to a submenu under the HTML menu ken
@ 2006-01-24 17:21 ` Kevin Rodgers
  2006-01-24 22:12   ` ken
  2006-01-24 19:35 ` François.Gannaz
  1 sibling, 1 reply; 7+ messages in thread
From: Kevin Rodgers @ 2006-01-24 17:21 UTC (permalink / raw)


ken wrote:
> 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?

What HTML mode are you using?  `C-h v major-mode' to check.

The html-mode defined in sgml-mode.el distributed with Emacs 21 does not
have an "Insert Character Entities" submenu.

-- 
Kevin Rodgers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding to a submenu under the HTML menu
  2006-01-23  4:36 Adding to a submenu under the HTML menu ken
  2006-01-24 17:21 ` Kevin Rodgers
@ 2006-01-24 19:35 ` François.Gannaz
  2006-01-28 11:03   ` ken
  1 sibling, 1 reply; 7+ messages in thread
From: François.Gannaz @ 2006-01-24 19:35 UTC (permalink / raw)


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.

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.

--
François Gannaz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding to a submenu under the HTML menu
  2006-01-24 17:21 ` Kevin Rodgers
@ 2006-01-24 22:12   ` ken
  0 siblings, 0 replies; 7+ messages in thread
From: ken @ 2006-01-24 22:12 UTC (permalink / raw)


On Tue, 24 Jan 2006 10:21:22 -0700 Kevin Rodgers <ihs_4664@yahoo.com>
wrote:

> ken wrote:
> > 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?
> 
> What HTML mode are you using?  `C-h v major-mode' to check.

html-helper-mode

It probably doesn't matter, but this is emacs v. 21.3.1.

> 
> The html-mode defined in sgml-mode.el distributed with Emacs 21 does
> not have an "Insert Character Entities" submenu.

This one definitely does.  I've looked at it dozens of times.


Thanks,
ken


> 
> -- 
> Kevin Rodgers
> 
> 
> 
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs


-- 
"This world ain't big enough for the both of us,"
said the big noema to the little noema.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding to a submenu under the HTML menu
  2006-01-24 19:35 ` François.Gannaz
@ 2006-01-28 11:03   ` ken
  2006-01-28 23:57     ` François Gannaz
  0 siblings, 1 reply; 7+ messages in thread
From: ken @ 2006-01-28 11:03 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding to a submenu under the HTML menu
  2006-01-28 11:03   ` ken
@ 2006-01-28 23:57     ` François Gannaz
  2006-01-30  1:59       ` ken
  0 siblings, 1 reply; 7+ messages in thread
From: François Gannaz @ 2006-01-28 23:57 UTC (permalink / raw)


Le sam 28 jan 06:03, ken a écrit :
> >
> > 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.

Je vous en prie ^_^

> > 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-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.

In fact the problem is that you used the wrong hook. I you read above
carefully, you'll find that I suggested to use html-helper-load-hook.
Yet you used html-helper-mode-hook. A load-hook is evaluated once (when
the file is loaded) whereas a mode-hook might be evaluated several times
(in fact, each time you enter the mode).

So you should write something like:
(defun my-html-load-hook ()
  (mapcar                         ; just to avoid repeating hh-add-tag
   'html-helper-add-tag
   '(
     (entity "\C-c%"   "&ccedil;" "C cédille" ("&ccedil;"))
     (entity "\C-cD"   "&#135;" "double dagger (&#135;)" ("&#135;"))
     ;; and so on
     ))
  (html-helper-rebuild-menu))
(add-hook 'html-helper-load-hook 'my-html-load-hook)

Hope it helps.
--
François Gannaz

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Adding to a submenu under the HTML menu
  2006-01-28 23:57     ` François Gannaz
@ 2006-01-30  1:59       ` ken
  0 siblings, 0 replies; 7+ messages in thread
From: ken @ 2006-01-30  1:59 UTC (permalink / raw)


On Sun, 29 Jan 2006 00:57:59 +0100 François Gannaz
<mytskine@laposte.net> wrote:

> Le sam 28 jan 06:03, ken a écrit :
> > >
> > > ....
> 
> In fact the problem is that you used the wrong hook. I you read above
> carefully, you'll find that I suggested to use html-helper-load-hook.
> Yet you used html-helper-mode-hook. 

Obviously a cut-n-paste malfunction.  :)


> A load-hook is evaluated once
> (when the file is loaded) whereas a mode-hook might be evaluated
> several times (in fact, each time you enter the mode).
> 
> So you should write something like:
> (defun my-html-load-hook ()
>   (mapcar                         ; just to avoid repeating hh-add-tag
>    'html-helper-add-tag
>    '(
>      (entity "\C-c%"   "&ccedil;" "C cédille" ("&ccedil;"))
>      (entity "\C-cD"   "&#135;" "double dagger (&#135;)" ("&#135;"))
>      ;; and so on
>      ))
>   (html-helper-rebuild-menu))
> (add-hook 'html-helper-load-hook 'my-html-load-hook)
> 
> Hope it helps.

Works perfectly.  I would have never figured all this
out.  Merci vielmals.  


> --
> François Gannaz
> 
> 
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs


-- 
"This world ain't big enough for the both of us,"
said the big noema to the little noema.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-01-30  1:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-23  4:36 Adding to a submenu under the HTML menu ken
2006-01-24 17:21 ` Kevin Rodgers
2006-01-24 22:12   ` ken
2006-01-24 19:35 ` François.Gannaz
2006-01-28 11:03   ` ken
2006-01-28 23:57     ` François Gannaz
2006-01-30  1:59       ` ken

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).