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: 21 Apr 2002 13:08:36 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xwuv11f7v.fsf@kfs2.cua.dk> References: <5xbscpg7zl.fsf@kfs2.cua.dk> <200204112243.g3BMhmI01190@rum.cs.yale.edu> <5xd6x5i7ps.fsf@kfs2.cua.dk> <5x4rih12b2.fsf@kfs2.cua.dk> <200204121846.g3CIkZY16909@rum.cs.yale.edu> <5xofgoobzr.fsf@kfs2.cua.dk> <200204122021.g3CKLh217680@rum.cs.yale.edu> <5xu1qd29od.fsf@kfs2.cua.dk> <200204162018.g3GKI3S24358@aztec.santafe.edu> <5x662rxog2.fsf@kfs2.cua.dk> <200204181846.g3IIk2K00596@aztec.santafe.edu> <5xk7r4mwqs.fsf@kfs2.cua.dk> <200204191842.g3JIgnV01056@aztec.santafe.edu> <5x8z7juyxf.fsf@kfs2.cua.dk> <200204201727.g3KHRvu01477@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 1019383779 12840 127.0.0.1 (21 Apr 2002 10:09:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 21 Apr 2002 10:09:39 +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 16zEHq-0003Kz-00 for ; Sun, 21 Apr 2002 12:09:38 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16zEI1-0002JJ-00 for ; Sun, 21 Apr 2002 12:09:49 +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 16zEHS-0007VO-00; Sun, 21 Apr 2002 06:09:14 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 16zEGF-00074e-00; Sun, 21 Apr 2002 06:08:00 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 97CC47C04E; Sun, 21 Apr 2002 10:07:47 +0000 (GMT) Original-To: rms@gnu.org In-Reply-To: <200204201727.g3KHRvu01477@aztec.santafe.edu> Original-Lines: 70 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:2920 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2920 Richard Stallman writes: > The actual interpretation of C-x is done via three of cua's 7 keymaps. > > Using separate keymaps for C-x seems reasonable. > > I wonder, though, why simply putting all three in minor-mode-map-alist > won't do the job. As I recall, if any active keymap defines a binding > with a non-prefix definition, that should override all prefix > definitions regardless of the precedence order of the maps. Is that > not true now? If not, maybe we could make it true again. I wasn't aware of this functionality. I'll see if it is true now. > So there is > no need to worry about the relative order of your maps and all other > maps. > There are other cases where the ordering of those maps matters, but I might be able to further limit the dependence on the ordering (by making sure only one condition is true at a time), but I would still prefer if I could just rely on having my own (separate) cua-minor-mode-map-alist (on the emulation-mode-map-alists list), and be sure that noone would mess with it. And since I've already implemented it, I know the change to add emulation-mode-map-alists is trivial! > If you need to condition some of these maps on some symbol's being > false, then we could make the minimal extension so far proposed, which > is to allow minor-mode-map-alist (or another new alist) to have > conditions which are more complex than just a symbol. But you do see > if you can easily get away without that. If we don't allow some form of simple logical expression [e.g. the functions I listed in a previous mail], I really don't see any alternative to the present code cua (and viper) which refreshes a list of state variables and fixes any ordering problems in minor-mode-map-alist after each command. > > To facilitate this, three more keymaps are used which selectively does > command remapping of `kill-ring-save' to handle either region, rectangle, > or the global mark. > > It would be cleaner to define a single new command for that purpose. I don't agree. There are many other commands which are specific for the region, rectangle, and global mark cases, and handling those in separate functions is a lot clearer (to me). Actually, the new cua package consists of three files now: cua-base.el (for the basic functionality and region handling) cua-rect.el (for rectangle commands) cua-gmrk.el (for the global mark functionality) > > The final keymap is used to allow users to take advantage of cua's > uniform command set for rectangles (and the global mark), but still > continue to use C-w, M-w and C-y instead of C-x, C-c, and C-v (which > are the normal cua bindings). > > Which characters does this map redefine? > C-z -> undo, C-v -> yank -- Kim F. Storm http://www.cua.dk