From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Newsgroups: gmane.emacs.devel Subject: Re: calc-undo keybinding Date: Thu, 20 Jan 2011 11:06:32 +0100 Message-ID: <87pqrryjmf.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1295518135 20472 80.91.229.12 (20 Jan 2011 10:08:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 20 Jan 2011 10:08:55 +0000 (UTC) Cc: joakim@verona.se, Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 20 11:08:51 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 1PfrRj-0002do-2g for ged-emacs-devel@m.gmane.org; Thu, 20 Jan 2011 11:08:51 +0100 Original-Received: from localhost ([127.0.0.1]:44952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfrRi-0000K3-Ac for ged-emacs-devel@m.gmane.org; Thu, 20 Jan 2011 05:08:50 -0500 Original-Received: from [140.186.70.92] (port=41995 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PfrRZ-0000Jy-Vs for emacs-devel@gnu.org; Thu, 20 Jan 2011 05:08:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PfrRY-00084m-SX for emacs-devel@gnu.org; Thu, 20 Jan 2011 05:08:41 -0500 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:43694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PfrRY-00084Y-O4 for emacs-devel@gnu.org; Thu, 20 Jan 2011 05:08:40 -0500 Original-Received: by fxm12 with SMTP id 12so422125fxm.0 for ; Thu, 20 Jan 2011 02:08:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type :content-transfer-encoding; bh=FHK82ABIQmlLhyNKfc2HjD3nNFsG+qyW5Wqwyf57NsU=; b=UVVtgv88Nw6uZr6s7804eGxXnFIsGKzu7GAKkFVenq2QUrTL+7FDDdeWOhlX/qAJKO 6IAGxqNClL2ndt8l1fjLyCp1rDFL+znJlVLIt0H86hzBs6M+GRj9xbh+LTbrM3H88p11 lwJdXUsn2WraJXT8FfrMH8OIx4qS9EYXt71j0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; b=iCQDTGOLydiiFtFntk/PWtGssjN97yi3eJ4NkpjVUguf9sZX3EiLndcSuW5zePhccu x9nvYoYY6kvvM3kG/mYKjC5vyChNIqljM012tYu/G9SC1JUwYMfxOPZaRvgn/vAApnml 3ndjbRrw6jUF3lDnNa0frnLF33gavWe17h5sE= Original-Received: by 10.223.113.131 with SMTP id a3mr1860761faq.135.1295518119434; Thu, 20 Jan 2011 02:08:39 -0800 (PST) Original-Received: from localhost (176.119.broadband10.iol.cz [90.177.119.176]) by mx.google.com with ESMTPS id n2sm3035517fam.28.2011.01.20.02.08.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 20 Jan 2011 02:08:37 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Wed, 19 Jan 2011 18:13:12 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:134810 Archived-At: Stefan Monnier writes: >>> 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 > > > =3D=3D=3D 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) >=20=20 > (define-key calc-mode-map "a" nil) Why not just use command remapping, i.e. (define-key calc-mode-map [remap undo] 'calc-undo) ? (It won't work on XEmacs AFAIK, but that's not a problem for you I'm guessing.) =C5=A0t=C4=9Bp=C3=A1n