From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Enhancements to "minor-mode-map-alist" functionality. Date: 16 Apr 2002 01:55:20 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xvgash5zr.fsf@kfs2.cua.dk> References: <5xbscpg7zl.fsf@kfs2.cua.dk> <200204131905.g3DJ5cC22812@aztec.santafe.edu> <5xbscnb2hh.fsf@kfs2.cua.dk> <200204152154.g3FLsjP23687@aztec.santafe.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1018911443 21379 127.0.0.1 (15 Apr 2002 22:57:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 15 Apr 2002 22:57:23 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16xFPW-0005Yi-00 for ; Tue, 16 Apr 2002 00:57:22 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16xFhS-0001Gl-00 for ; Tue, 16 Apr 2002 01:15:54 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16xFPH-0004Im-00; Mon, 15 Apr 2002 18:57:07 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16xFMm-0004CO-00; Mon, 15 Apr 2002 18:54:32 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 6D29C7C047; Mon, 15 Apr 2002 22:54:30 +0000 (GMT) Original-To: rms@gnu.org In-Reply-To: <200204152154.g3FLsjP23687@aztec.santafe.edu> Original-Lines: 48 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2651 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2651 Richard Stallman writes: > > I am surprised that the present facilities can't be used more easily. > > Could you explain WHY you think this is necessary? Perhaps there > > is already a better way. > > I'm pretty confiden that there isn't a _better_ way already. > > Would you please explain to me why not? > Before I agree that we need a new feature, > I want to make sure we have not overlooked an > existing good solution. Please show the reasons > why (you believe) these 7 keymaps are the only way. They are not the only way! In the CUA mode I've been promoting for the last few years I use (only) three keymaps, a pretty complicated pre-command-hook to select the proper keymap (to emulate the equivalent to the new command remapping feature!), and a very ugly/messy piece of code bound to C-c and C-x in the key-translation-map. In addition, most functions are pretty overloaded with conditionals to select the "proper action" for the current state. With the new code I've written to use the new command remapping, and the 7 keymaps, the code is _much_ simpler, as all the conditional code is now moved out of the functions and centralized around selecting the proper keymaps based on the current state. I know for sure that using 7 keymaps is a vast improvement to the old code which has been increasingly complex to maintain, so I definitely didn't want to include that code with the emacs base. > > E.g. for cua, I need to ensure that those 7 keymaps are in the front > of minor-mode-map-alist after every command, > > The first question is why you need 7 keymaps at all. Why isn't one > enough? Why can't one key binding for a given key sequence handle all > the various different circumstances, through conditionals in the code? I did that to some extent in the old version of CUA. I don't want to repeat that mistake (in this context), as it contributed significantly to the complexity of the old code. -- Kim F. Storm http://www.cua.dk