unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: C-z (Re: Two GTK related feature requests)
Date: Mon, 27 Oct 2003 12:44:10 -0700	[thread overview]
Message-ID: <3F9D758A.1030802@yahoo.com> (raw)
In-Reply-To: 87brs2prhi.fsf@mail.jurta.org

Juri Linkov wrote:

> Here is what I have in .emacs:
> 
> (defvar my-map nil)
> (if (not my-map)
>     (let ((c-z (global-key-binding "\C-z")))
>       (global-unset-key "\C-z")
>       (setq my-map (make-sparse-keymap))
>       (define-key global-map "\C-z" my-map)
>       (define-key my-map "\C-z" c-z)))
> (define-key my-map "t" ...)
> ...
> 
> BTW, I once had one problem with this code.  Before I added `if' condition,
> this code was called twice on the Emacs startup and created the cyclic
> keymap.  The double loading was caused by the bug in the function
> `command-line' in lisp/startup.el:

I can't argue about the bug, but the recommended way to do that is:

(defvar my-map
   (let ((map (make-sparse-keymap))
	(c-z (global-key-binding "\C-z")))
     (global-unset-key "\C-z")
     (define-key global-map "\C-z" my-map)
     (define-key map "\C-z" c-z)
     map))

(define-key my-map "t" ...)

Or maybe there's even a better way, using define-prefix-command.
-- 
Kevin Rodgers

  reply	other threads:[~2003-10-27 19:44 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21  4:09 Two GTK related feature requests Simon Josefsson
2003-10-21  4:17 ` Masatake YAMATO
2003-10-21  4:27   ` Simon Josefsson
2003-10-22  9:25 ` Richard Stallman
2003-10-22 12:04   ` Simon Josefsson
2003-10-22 12:39     ` Luc Teirlinck
2003-10-22 13:44       ` Simon Josefsson
2003-11-02 19:34         ` Jan D.
2003-10-23  2:08   ` Michael Welsh Duggan
2003-10-25 20:08     ` James H.Cloos Jr.
2003-10-26  4:10       ` C-z (Re: Two GTK related feature requests) Karl Eichwalder
2003-10-26  6:11         ` Eli Zaretskii
2003-10-26  8:01           ` Karl Eichwalder
2003-10-27  7:02             ` Richard Stallman
2003-10-27 12:22               ` Kim F. Storm
2003-10-27 12:46               ` Robert J. Chassell
2003-10-27 14:05                 ` Kim F. Storm
2003-10-27 18:08                   ` Karl Eichwalder
2003-10-27 22:16                   ` Robert J. Chassell
2003-10-27 15:47                 ` C-z Werner LEMBERG
2003-10-27 16:36                 ` C-z (Re: Two GTK related feature requests) Juri Linkov
2003-10-27 19:44                   ` Kevin Rodgers [this message]
2003-10-28 20:39                 ` Richard Stallman
2003-10-29  7:01                   ` Karl Eichwalder
2003-10-29  7:28                     ` Miles Bader
2003-10-30  4:19                       ` Richard Stallman
2003-10-29  9:43                     ` David Kastrup
2003-10-29 13:30                     ` Stefan Monnier
2003-10-29 14:03                       ` Eli Zaretskii
2003-10-29 16:00                     ` Luc Teirlinck
2003-10-26 19:01         ` Stefan Monnier
2003-10-26 21:06           ` Miles Bader
2003-10-27  5:50             ` Eli Zaretskii
2003-10-27  6:46               ` Miles Bader
2003-10-27 16:55                 ` Juri Linkov
2003-10-28  2:01                   ` Miles Bader
2003-10-29 14:15           ` Stephan Stahl
2003-10-29 15:29             ` David Kastrup
2003-11-17 20:40   ` Two GTK related feature requests Kai Grossjohann
2003-11-18 23:03     ` Richard Stallman
2003-11-19 21:43       ` tabs proposal Alex Schroeder
2003-11-21  4:08         ` Richard Stallman

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=3F9D758A.1030802@yahoo.com \
    --to=ihs_4664@yahoo.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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