unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Ehud Karni" <ehud@unix.mvs.co.il>
Cc: help-gnu-emacs@gnu.org
Subject: Re: add to keymap
Date: Sun, 19 Jan 2003 23:14:29 +0200	[thread overview]
Message-ID: <200301192114.h0JLETpM019004@beta.mvs.co.il> (raw)
In-Reply-To: <3E2AE559.6070101@XXnetscape.net> (message from matt on Sun, 19 Jan 2003 20:50:01 GMT)

-----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	other threads:[~2003-01-19 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-19 20:50 add to keymap matt
2003-01-19 21:14 ` Ehud Karni [this message]
     [not found] ` <mailman.558.1043010919.21513.help-gnu-emacs@gnu.org>
2003-01-19 21:51   ` matt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200301192114.h0JLETpM019004@beta.mvs.co.il \
    --to=ehud@unix.mvs.co.il \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).