From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?iso-8859-1?Q?Fran=E7ois?= Gannaz Newsgroups: gmane.emacs.help Subject: Re: Adding to a submenu under the HTML menu Date: Sun, 29 Jan 2006 00:57:59 +0100 Message-ID: <20060128235759.GB4681@free.fr> References: <20060122233614.6c6e895f@dellap.mousecar.net> <20060124193501.GE6260@free.fr> <20060128060340.2e925987@dellap.mousecar.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1138521107 361 80.91.229.2 (29 Jan 2006 07:51:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 Jan 2006 07:51:47 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 29 08:51:44 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F37Lc-0001iN-8N for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Jan 2006 08:51:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F37OV-0001qh-Ur for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Jan 2006 02:54:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F30rA-00026W-KU for help-gnu-emacs@gnu.org; Sat, 28 Jan 2006 19:55:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F30FV-0004JS-Av for help-gnu-emacs@gnu.org; Sat, 28 Jan 2006 19:16:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F302g-0002Op-V2 for help-gnu-emacs@gnu.org; Sat, 28 Jan 2006 19:03:43 -0500 Original-Received: from [194.158.104.67] (helo=relay-am.club-internet.fr) by monty-python.gnu.org with esmtp (Exim 4.52) id 1F300j-0005cL-3V for help-gnu-emacs@gnu.org; Sat, 28 Jan 2006 19:01:41 -0500 Original-Received: from pandion (d01v-213-44-194-8.d4.club-internet.fr [213.44.194.8]) by relay-am.club-internet.fr (Postfix) with ESMTP id 6CB2025601 for ; Sun, 29 Jan 2006 01:00:42 +0100 (CET) Original-Received: from zamansky by pandion with local (Exim 4.52) id 1F2zxA-0001wM-4y for help-gnu-emacs@gnu.org; Sun, 29 Jan 2006 00:58:00 +0100 Original-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <20060128060340.2e925987@dellap.mousecar.net> User-Agent: Mutt/1.5.11 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:32890 Archived-At: Le sam 28 jan 06:03, ken a =E9crit : > > > > So you could try in a *scratch buffer* : > > (html-helper-add-tag > > '(entity "\C-c%" "ç" "C c=E9dille" ("ç"))) > > (html-helper-rebuild-menu) > > After evaluating, it should appear automatically in the HTML menu. > > Marvelous! Works perfect. Thanks very much, Fran=E7ois. 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, lik= e > > (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=E9dille" ("ç"))) > (html-helper-add-tag > '(entity "\C-cD" "‡" "double dagger (‡)" ("‡"))) > [...] > (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 coul= d > 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%" "ç" "C c=E9dille" ("ç")) (entity "\C-cD" "‡" "double dagger (‡)" ("‡")) ;; and so on )) (html-helper-rebuild-menu)) (add-hook 'html-helper-load-hook 'my-html-load-hook) Hope it helps. -- Fran=E7ois Gannaz