From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ken Newsgroups: gmane.emacs.help Subject: Re: create new key prefix Date: Wed, 20 Feb 2013 04:35:08 -0500 Message-ID: <512498CC.3070009@mousecar.com> References: <51240A2C.7070206@mousecar.com> <512428A9.6010003@mousecar.com> Reply-To: gebser@mousecar.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1361353684 17717 80.91.229.3 (20 Feb 2013 09:48:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 09:48:04 +0000 (UTC) Cc: GNU Emacs List To: Tim Visher Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 20 10:48:27 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U86Hq-0001Jz-Vy for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2013 10:48:27 +0100 Original-Received: from localhost ([::1]:48548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86HW-0003FC-JE for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Feb 2013 04:48:06 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86HJ-0002yH-KY for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 04:47:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U86HI-0007VA-6k for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 04:47:53 -0500 Original-Received: from mout.perfora.net ([74.208.4.195]:59040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U86HI-0007UD-0o for help-gnu-emacs@gnu.org; Wed, 20 Feb 2013 04:47:52 -0500 Original-Received: from dellap.mousecar.net (dsl093-011-016.cle1.dsl.speakeasy.net [66.93.11.16]) by mrelay.perfora.net (node=mrus4) with ESMTP (Nemesis) id 0LmbBD-1Uhz80069z-00a7yz; Wed, 20 Feb 2013 04:35:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20130110 Thunderbird/10.0.12 In-Reply-To: X-Provags-ID: V02:K0:WWHKxMJ1TXw46EqmH9jvFW6A8QinEkM81KXXHsZnzDE S65EUb8voWHuO/JwpE0VRsad7OVC1roIXSjIVD27u9S6TVtPTs MOOcUGQR6Z5FEBtLQrOuLDGYaq5FYVqS9jIi99e21qL5Dk3fJv fW+ApZ/erAEBqSJSx7tO95M+VABmI5P97YYnVO7sLumGhNsIva Gj3ka9GfSul0+O1F9jgETzVM+IuEpxqHWqNkj6gB64GgiBHqIV TvJv+gm7Gho8LfJfGbf5AKCwtNur6PVCKQJEWgFeDu3vD1EcRC mCd9gixl6yq05b0uBt/dTacHJ1hhPloOuu1XN3FUCw3MD5lLrW XM/t82QrAC2YcfKmQOejFa18Cv+6rlbyBn5BZp6OF X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 74.208.4.195 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89172 Archived-At: On 02/19/2013 08:41 PM Tim Visher wrote: > On Tue, Feb 19, 2013 at 8:36 PM, ken wrote: >> On 02/19/2013 08:20 PM Tim Visher wrote: >>> On Tue, Feb 19, 2013 at 6:26 PM, ken wrote: >>>> >>>> I've defined quite a few new keys over the years and so would like to >>>> create >>>> a new key prefix. I.e., I want to be able to define keys such as "C-c p >>>> s", >>>> "C-c p m", etc. So how do I tell emacs that (for all possible modes) I >>>> want >>>> "C-c p" to look for the new key definitions. >>>> >>>> From what I've read so far, how this is done depends a lot on the >>>> particular >>>> emacs version. Mine's 22.1.1. >>> >>> >>> `(global-set-key (kbd "C-c p m") 'func-name)` doesn't work for you? >>> The caveat to that is that modes down the line can possible shadow the >>> binding. But that's easy enough to solve with `(eval-after-load…` >>> forms. >> >> Thanks much for the reply. I have almost no idea what you said, but it got >> me to try the code which I already wrote (which I didn't do before because I >> didn't think it would work, thought sure there was something missing). The >> code I already wrote and left sitting there untested for a couple-three >> hours... it works!! >> >> Well that's a completely new experience for me. B^D > > LOL. Good to know. > > As an aside, what are you confused about regarding what I said? Maybe > I can help clear some things up for you? What I read in several docs on the web implied that a command was needed first to create a sparse map (i.e., define-prefix-command) and then to assign it to a key prefix, in my case, "C-c p". So when you wrote/asked, "`(global-set-key... doesn't work for you?", it didn't compute with me at all at first because it seemed like you were ignoring/forgetting all that. But then 1% of me thought, maybe this guy is one of the 0.02% who knows what he's talking about, prompting me to try running my own code (which was likewise ignoring/forgoing sparse map creation etc.). My crap not only ran without error, but it also worked perfectly! The other part is the reference to "(eval-after-load..."; from your context I gather that it's meant to remedy some other code stepping on my keybindings (and perhaps too other definitions). But how, when, and where to actually implement that function gribbles the laft whicher bonkhaft.