From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: no-spam@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: Enhancements to "minor-mode-map-alist" functionality. Date: 26 Apr 2002 15:44:05 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5xlmbaefru.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> <5xwuv11f7v.fsf@kfs2.cua.dk> <200204222236.g3MMamv02091@aztec.santafe.edu> <5xbscahe51.fsf@kfs2.cua.dk> <200204241755.g3OHtBZ03352@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 1019825134 8073 127.0.0.1 (26 Apr 2002 12:45:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 26 Apr 2002 12:45:34 +0000 (UTC) Cc: storm@cua.dk, 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 17156T-000266-00 for ; Fri, 26 Apr 2002 14:45:33 +0200 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 171597-0008Jd-00 for ; Fri, 26 Apr 2002 14:48:17 +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 17156P-0008Sv-00; Fri, 26 Apr 2002 08:45:29 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.34 #1 (Debian)) id 17154J-0008IS-00; Fri, 26 Apr 2002 08:43:20 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id C3BB17C047; Fri, 26 Apr 2002 12:43:17 +0000 (GMT) Original-To: rms@gnu.org In-Reply-To: <200204241755.g3OHtBZ03352@aztec.santafe.edu> Original-Lines: 33 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:3295 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:3295 Richard Stallman writes: > > This should be feasible with existing facilities, right? > > Yes, except that the condition on this keymap is > > (or (eq cua-enable-cua-keys t) > cua--last-region-shifted) > > Could you make a new variable to control this keymap, > and set it from post-command-hook? > > Likewise, maybe you could control the other maps > with variables set in post-command-hook. > This would not be much more complicated > and it probably would be about as fast. > Perhaps faster, since the hook function could be > byte-compiled, whereas if these expressions go straight > into the keymap they would have to be interpreted. That is exactly what I've done now. I set a total of 5 such variables in the post-command-hook to control the various cua related keymaps. The problem with this approach is that -- in some cases -- a subsequent post-command-hook function or another external event may change the state [notably clear the mark active state] so my state variables no longer contain the proper values. I still belive evalling those expressions when the keymaps are used is preferable (safer, simpler and more logical) rather than doing it in the post-command-hook.