unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Subject: Re: C-z (Re: Two GTK related feature requests)
Date: 27 Oct 2003 18:36:41 +0200	[thread overview]
Message-ID: <87brs2prhi.fsf@mail.jurta.org> (raw)
In-Reply-To: <m1AE6l2-000UNaC@rattlesnake.com>

"Robert J. Chassell" <bob@rattlesnake.com> writes:
> One possibility is to make it a prefix reserved for users,
> like C-c followed by a letter.

This is what I used for many years.  I use the prefix key `C-z' for my
additional keymap.  On qwerty-keyboards `C-z' is one of the most
accessible keys like `C-x' and `C-c', but the prefix key `C-c' is
reserved for mode-specific commands (both user-defined and standard
Emacs extensions).  I reassigned the previous binding of `C-z'
(`suspend-emacs' or `iconify-or-deiconify-frame') to double key
sequence `C-z C-z'.

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:

		      (when (stringp custom-file)
                        (unless (assoc custom-file load-history)
                          ;; If the .emacs file has set `custom-file' but hasn't
                          ;; loaded the file yet, let's load it.
                          (load custom-file t t)))

If .emacs contains the following code:

(setq custom-file "/home/full/path/dotemacs.el")
(add-to-list 'load-path "/home/full/path/)
(load "dotemacs")

then the above condition in the startup.el fails, because the variable
`custom-file' has the absolute file name, whereas `load-history'
has the file name without directory, i.e.

(assoc "/home/full/path/dotemacs.el" (("dotemacs.el" ...) ...))

I think that either this code should be fixed, or the documentation
of the variable `custom-file' should be improved to warn about this
problem.

-- 
http://www.jurta.org/emacs/dotemacs.en.html

  parent reply	other threads:[~2003-10-27 16:36 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                 ` Juri Linkov [this message]
2003-10-27 19:44                   ` C-z (Re: Two GTK related feature requests) Kevin Rodgers
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=87brs2prhi.fsf@mail.jurta.org \
    --to=juri@jurta.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.
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).