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: fail to call edebug-defun Date: Sun, 14 Jul 2013 06:43:55 -0700 (PDT) Message-ID: References: <87d2qlfqqv.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1373809457 23609 80.91.229.3 (14 Jul 2013 13:44:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Jul 2013 13:44:17 +0000 (UTC) To: Hongxu Chen , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 14 15:44:15 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 1UyMb0-0001x0-46 for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Jul 2013 15:44:14 +0200 Original-Received: from localhost ([::1]:56882 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyMaz-0005kW-93 for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Jul 2013 09:44:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyMan-0005jG-29 for help-gnu-emacs@gnu.org; Sun, 14 Jul 2013 09:44:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyMal-0000aX-Vw for help-gnu-emacs@gnu.org; Sun, 14 Jul 2013 09:44:00 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:24211) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyMal-0000aL-Qe for help-gnu-emacs@gnu.org; Sun, 14 Jul 2013 09:43:59 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6EDhuis005360 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 14 Jul 2013 13:43:57 GMT Original-Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6EDht5J025681 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 14 Jul 2013 13:43:55 GMT Original-Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6EDhsq7017335; Sun, 14 Jul 2013 13:43:55 GMT In-Reply-To: <87d2qlfqqv.fsf@gmail.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7 (607090) [OL 12.0.6668.5000 (x86)] X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:92119 Archived-At: > byte-code: Key sequence C-x C-a C-s starts with non-prefix key C-x C-a This message means that `C-x C-a' has not yet been defined as a prefix key. Imagine that you wanted to set `C-x C-a C-s' in the global keymap to comman= d `forward-char'. If you try `M-x global-set-key RET C-x C-a C-s' you never get a chance to hit `C-s'. Emacs interrupts after `C-x C-a', thinking that you want to bind the key `C-x C-a'. Emacs doesn't know that you want that to be a prefix key. (Emacs does know, out of the box, that `C-x' is a prefix key - it is predefined as such.) Do this first: (define-key your-keymap (kbd "C-x C-a") nil) That still does not tell Emacs that `C-x C-a' is to be a prefix key, but it does liberate it to become one. It tells Emacs that `C-x C-a' has no key binding. Now you can bind `C-x C-a C-s': (define-key your-keymap (kbd "C-x C-a C-s") 'your-command) Now Emacs knows that `C-x C-a' is a prefix key in `your-keymap'. If you used `global-set-key' above, instead of `define-key' with `your-keymap', then after the `C-x C-a C-s' definition you would be able to do `M-x global-set-key RET C-x C-a C-s' and Emacs would not interrupt after `C-x C-a'. Instead, it would wait, expecting another key to follow. Someone else will be able to answer your question about edebug. I use ordinary `debug', myself. (E.g., `debug-on-entry', `toggle-debug-on-error', or explicit `(debug)' calls in the code.) See also (elisp) `Prefix Keys'.