From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: calc-undo keybinding Date: Wed, 19 Jan 2011 18:13:12 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1295479382 24588 80.91.229.12 (19 Jan 2011 23:23:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 19 Jan 2011 23:23:02 +0000 (UTC) Cc: Emacs developers To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 20 00:22:57 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PfhMb-0005Bg-68 for ged-emacs-devel@m.gmane.org; Thu, 20 Jan 2011 00:22:57 +0100 Original-Received: from localhost ([127.0.0.1]:41291 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfhDQ-0002pl-4h for ged-emacs-devel@m.gmane.org; Wed, 19 Jan 2011 18:13:24 -0500 Original-Received: from [140.186.70.92] (port=51778 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfhDJ-0002p1-Cq for emacs-devel@gnu.org; Wed, 19 Jan 2011 18:13:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfhDF-0008Rq-Qb for emacs-devel@gnu.org; Wed, 19 Jan 2011 18:13:14 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.183]:42846 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfhDF-0008Rm-N0 for emacs-devel@gnu.org; Wed, 19 Jan 2011 18:13:13 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArQGAI/+Nk1FpZLq/2dsb2JhbACWL44ZdL4nhVAEhG+ONw X-IronPort-AV: E=Sophos;i="4.60,347,1291611600"; d="scan'208";a="88646134" Original-Received: from 69-165-146-234.dsl.teksavvy.com (HELO ceviche.home) ([69.165.146.234]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 19 Jan 2011 18:13:13 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id DD0C266102; Wed, 19 Jan 2011 18:13:12 -0500 (EST) In-Reply-To: (joakim@verona.se's message of "Wed, 19 Jan 2011 22:48:14 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:134785 Archived-At: >> I missed the part where you describe the problem. Is it that >> calc-ext.el rebinds all standard undo keys to calc-undo but doesn't >> rebind your C-z binding? > Yes. I can fix it in the mode hook, but is this really the way it should > work? It just feels like calc should hook into the existing undo > function. I don't know enough about calc-undo's behavior to know whether it could work by hooking into Emacs's undo. Clearly, it was written long before Emacs's undo provided hooks. But I guess a change like the patch below would be in order and should fix the problem for you. Stefan === modified file 'lisp/calc/calc-ext.el' --- lisp/calc/calc-ext.el 2011-01-16 02:21:30 +0000 +++ lisp/calc/calc-ext.el 2011-01-19 23:12:20 +0000 @@ -136,8 +136,7 @@ (define-key calc-mode-map "\C-w" 'calc-kill-region) (define-key calc-mode-map "\M-w" 'calc-copy-region-as-kill) (define-key calc-mode-map "\M-\C-w" 'kill-ring-save) - (define-key calc-mode-map "\C-_" 'calc-undo) - (define-key calc-mode-map "\C-xu" 'calc-undo) + (substitute-key-definition 'undo 'calc-undo calc-mode-map global-map) (define-key calc-mode-map "\M-\C-m" 'calc-last-args) (define-key calc-mode-map "a" nil)