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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add to keymap


From: Ehud Karni
Subject: Re: add to keymap
Date: Sun, 19 Jan 2003 23:14:29 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 19 Jan 2003 20:50:01 GMT, matt <nwzmattXX@XXnetscape.net> wrote:
> 
> How do I add to an existing keymap automatically upon entering a mode. I 
> want to extend the html-mode-map with a few of my own.

If you'll run help on `html-mode' function you'll see in it the lines:
    To work around that, do:
       (eval-after-load "sgml-mode" '(aset sgml-char-names ?' nil))
So, obviously, one of the options is to put all you code within such 
form:   (eval-after-load "sgml-mode" <your code>)

Another, (better ?) option is to put you code in a function that will
be called EACH time you enter `html-mode'. The above help will show you
that `html-mode' is defined in "sgml-mode.el". A quick look at the 
definition will discover that `html-mode' run some hooks as its last
action:  (run-hooks 'text-mode-hook 'sgml-mode-hook 'html-mode-hook))
so you can add your function to any of these hooks. Put it (use the
`add-hook') on the most appropriate one.

Ehud.


- -- 
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 mailto:ehud@unix.mvs.co.il                  Better  Safe  Than  Sorry
-----BEGIN PGP SIGNATURE-----
Comment: use http://www.keyserver.net/ to get my key (and others)

iD8DBQE+KxU0LFvTvpjqOY0RAmrKAJ0f3cnizlALBY9MeSmOpyA2XSVWpACfWE70
O/CcXVIndXqMgSSzIL72I5g=
=cthF
-----END PGP SIGNATURE-----




reply via email to

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