From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: redefine C-h Date: Sun, 10 Aug 2008 17:41:10 -0700 Message-ID: <004901c8fb4a$f3628190$0200a8c0@us.oracle.com> References: <6c2a4df0-eaa7-4617-9cb5-94f0ca4bd888@w7g2000hsa.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1218415322 23610 80.91.229.12 (11 Aug 2008 00:42:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2008 00:42:02 +0000 (UTC) To: "'YSK'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 11 02:42:53 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KSLUn-0006Yv-Q4 for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Aug 2008 02:42:50 +0200 Original-Received: from localhost ([127.0.0.1]:49666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSLTr-0005Go-PF for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Aug 2008 20:41:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSLTZ-0005DU-87 for help-gnu-emacs@gnu.org; Sun, 10 Aug 2008 20:41:33 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSLTY-0005CK-6y for help-gnu-emacs@gnu.org; Sun, 10 Aug 2008 20:41:32 -0400 Original-Received: from [199.232.76.173] (port=58497 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSLTY-0005CC-4E for help-gnu-emacs@gnu.org; Sun, 10 Aug 2008 20:41:32 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]:30493) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KSLTY-0006Hr-4l for help-gnu-emacs@gnu.org; Sun, 10 Aug 2008 20:41:32 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m7B0fKo2022408; Sun, 10 Aug 2008 18:41:20 -0600 Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m7AKedwR023364; Sun, 10 Aug 2008 18:41:20 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt358.oracle.com with ESMTP id 11343179891218415265; Sun, 10 Aug 2008 19:41:05 -0500 Original-Received: from dradamslap1 (/69.181.100.12) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 10 Aug 2008 17:41:05 -0700 X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 In-Reply-To: Thread-Index: Acj7EGo16t3UXeXGRqyQ/aAjnheeqwAL4Bbw X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:56429 Archived-At: > > C-h is a normally prefix key, but I want to bind 'backward-char- > > delete' to it. My .emacs has this: > > > > (global-unset-key "\C-h") > > (global-set-key "\C-\M-h" 'help-command) > > (global-set-key [C-h] 'delete-backward-char) > > > > I want to use C-M-h for help-command instead and use C-h for > > backspace. However...it's not working. C-h remains a prefix key. My > > understanding of prefix keys is basically nil, so there's probably > > something pretty basic I'm missing here. Would anyone here be kind > > enough to clue me in? > > Problem solved: looks like the "icicles" package was overriding my key > settings. Icicles does not bind `C-h'. `C-h' with Icicle mode is the same as it is without it. (*) If `C-h' remains a prefix key after your customizations, I am sure that has nothing to do with Icicles. And, as others have pointed out, [C-h] is not what you want anyway - use [(control ?h)] or "\C-h" or (kbd "C-h") or [?\C-h] or... And you should also customize `help-char', as Kevin pointed out. Similarly, for `C-M-h': Icicles should not affect it. Your binding of `C-M-h' to `help-command' should work OK everywhere. Is that not what you see? Icicle mode does, however make some changes in the minibuffer keymaps. One that is pertinent here is that it remaps command `delete-backward-char' to `icicle-delete-backward-char' in the minibuffer completion keymaps. This is so that whenever you delete a character in the minibuffer the set of candidate completions is updated to reflect your edited input. This is as it should be. This does not, however, affect the binding of `delete-backward-char' outside of the minibuffer. And it does not even affect its binding in the minibuffer, except during completion. If you successfully change the binding of `delete-backward-char' to `C-h', then, because Icicle mode remaps this to `icicle-delete-backward-char' in the minibuffer during completion, `C-h' during completion will delete a minibuffer character and update the set of completion candidates. IIUC, that should be just what you're after: `C-h' will always delete the character before point. In the minibuffer, it will also update the completion candidates - but that's the only difference. You can easily see all of this for yourself if you load library `help-fns+.el' (**) and then use `C-h M-k' (`describe-keymap'). You can use `C-h C-k' to show `icicle-mode-map' and each of the minibuffer maps: `minibuffer-local-map', `minibuffer-local-completion-map', and so on. Quit Icicle mode and check the minibuffer maps again, to see the difference. Check `global-map' too, to see whether your customizations have really taken effect as you expect. `describe-keymap' is your friend. You should be able to get what you want and still use Icicles, without any difficulty. If you have questions, feel free to ask. If you see a problem, please file a bug report: `M-x icicle-send-bug-report'. ---- (*) In Icicle mode, these two `C-h' bindings are changed, but only if you so choose - see option `icicle-top-level-key-bindings': `C-h C-o' - `icicle-describe-option-of-type' `C-h w' - `icicle-where-is' (multi-command version of `where-is') (**) `help-fns+.el' is available here: http://www.emacswiki.org/cgi-bin/wiki/help-fns%2b.el