From mboxrd@z Thu Jan 1 00:00:00 1970 From: Drew Adams Subject: Re: org-mode + icicles, avoid key binding redefinitions? Date: Wed, 22 Jan 2014 20:45:33 -0800 (PST) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6CAj-0006yi-Dx for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 23:45:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6CAb-0005Zm-TX for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 23:45:45 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:31892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6CAb-0005Zg-Lz for emacs-orgmode@gnu.org; Wed, 22 Jan 2014 23:45:37 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s0N4jaG7014413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 23 Jan 2014 04:45:36 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s0N4jZeN023653 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 23 Jan 2014 04:45:35 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s0N4jZ78020234 for ; Thu, 23 Jan 2014 04:45:35 GMT List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Someone pointed me to this thread. I am not subscribed to this list, so cc me if you want me to see a reply you write. Wrt some of what I read in the thread: 1. It is not true, (or else it is meaningless, depending on what you mean by that phrase) that "C-c ' is officially an Emacs keybinding". Just because Org is part of Emacs does not mean that any key bindings enabled for Org mode are somehow the "official" Emacs bindings for those keys, and so take precedence over bindings from "unofficial" packages. That would be absurd. Think about it. Is key `b' taken once and for all, just because "official Emacs" `compilation-minor-mode-map' binds it to `compile-mode-summary'? Is `C-x C-s' taken, just because official `rcirc-multiline-minor-mode-map' binds it to `rcirc-multiline-minor-submit'? Is `C-c C-SPC' taken, because `erc-track-minor-mode-map' binds it to `erc-track-switch-buffer'? 1a. From the Elisp manual, node `Key Binding Conventions': * Sequences consisting of `C-c' followed by `{', `}', `<', `>', `:' or `;' are also reserved for major modes. * Sequences consisting of `C-c' followed by any other punctuation character are allocated for minor modes. Using them in a major mode is not absolutely prohibited, but if you do that, the major mode binding may be shadowed from time to time by minor modes. IOW, no major mode should bind any of the latter group of keys, including `C-'' and `C-`', and any minor mode may do so - whether that mode is "official" or not. 1b. There is no global default binding for `C-'' in `emacs -Q'. And there should not be, since it is reserved for minor modes. I don't know whether Org binds `C-'' for a minor mode or for a major mode, but if it is the latter then it is in violation of the convention. If it is the former, then that is fine. 1c. Just as it is fine for any other minor mode to bind the same key. Icicle mode is a (global) minor mode. By default, Icicles binds `C-'' in `icicle-mode-map' (to command `icicle-occur'). 1d. By default only. It is trivial to customize user option `icicle-top-level-keybindings', to bind `icicle-occur' to a different key or to give it no key binding at all. (And no, you do not need to fiddle with Lisp to do that - not even `define-key'. `M-x customize-option' is your friend - just get yourself a separate `custom-file', for sanity.) 1e. The same holds for `C-`', which Icicles binds by default to `icicle-search'. And it holds for any other top-level keys. If you think that Icicles is "clobbering" any key bindings that you prefer from another package (such as Org), it is simple to change keys (in Icicles anyway; dunno about Org). Icicles does not "clobber" any keys without your permission - just customize `icicle-top-level-keybindings'. 1f. There are similar Icicles user options for key bindings in minibuffer keymaps. Minibuffer keymaps are major-mode maps. But any bindings Icicles makes in those maps are in effect only while you are in Icicle (minor) mode. 2. If you have a recent Emacs version, it is simple to download and install Icicles from MELPA. Likewise, to update it. There are also other easy ways to download it, listed here: http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Libraries#toc5. Icicles is 10 files of Lisp code and 3 files of non-code (doc and change history). If you download the files without using the package system, then just put the files in your `load-path' to "install" Icicles. All of this is clearly documented, both on Emacs Wiki and in the doc files that are part of your Icicles download. If you do not want to read the doc in general, then you can read just this about Icicles key bindings: http://www.emacswiki.org/emacs/Icicles_-_Key_Bindings HTH. Sorry for your trouble.