From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: C-z (Re: Two GTK related feature requests) Date: 27 Oct 2003 18:36:41 +0200 Organization: JURTA Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <87brs2prhi.fsf@mail.jurta.org> References: <87oew8so3g.fsf@cs.cmu.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1067280932 2364 80.91.224.253 (27 Oct 2003 18:55:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 27 Oct 2003 18:55:32 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Oct 27 17:45:25 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AEAUf-0003Qb-00 for ; Mon, 27 Oct 2003 17:45:25 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AEAUf-0001VX-00 for ; Mon, 27 Oct 2003 17:45:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AEAQa-0007bL-04 for emacs-devel@quimby.gnus.org; Mon, 27 Oct 2003 11:41:12 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AEAP1-0006u9-Pa for emacs-devel@gnu.org; Mon, 27 Oct 2003 11:39:35 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AEAOS-0006eX-4e for emacs-devel@gnu.org; Mon, 27 Oct 2003 11:39:31 -0500 Original-Received: from [64.246.52.232] (helo=ns5.tangramltd.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1AEAOR-0006cY-9y for emacs-devel@gnu.org; Mon, 27 Oct 2003 11:38:59 -0500 Original-Received: from 80-235-37-89-dsl.mus.estpak.ee ([80.235.37.89] helo=mail.jurta.org) by ns5.tangramltd.com with esmtp (Exim 4.20) id 1AEAOJ-0003Ij-O2 for emacs-devel@gnu.org; Mon, 27 Oct 2003 18:38:52 +0200 Original-To: emacs-devel@gnu.org In-Reply-To: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Lines: 53 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ns5.tangramltd.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jurta.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:17466 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:17466 "Robert J. Chassell" 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