From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alex Schroeder Newsgroups: gmane.emacs.devel Subject: Re: Customizing key bindings Date: Sat, 07 Sep 2002 16:08:59 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <874rd1ki2s.fsf_-_@emacswiki.org> References: <87ofbji88u.fsf@emacswiki.org> <200209021705.g82H50d07442@rum.cs.yale.edu> <200209022324.g82NOoO08761@rum.cs.yale.edu> <20020903130247.GA6318@gnu.org> <20020903173120.GA29981@gnu.org> <87ptvttnyo.fsf@emacswiki.org> <200209061736.g86HaDi00352@rum.cs.yale.edu> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1031407710 18768 127.0.0.1 (7 Sep 2002 14:08:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 7 Sep 2002 14:08:30 +0000 (UTC) Return-path: Original-Received: from mail-relay.eunet.no ([193.71.71.242]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17ngGB-0004sT-00 for ; Sat, 07 Sep 2002 16:08:27 +0200 Original-Received: from quimby.gnus.org (quimby.gnus.org [80.91.224.244]) by mail-relay.eunet.no (8.12.2/8.12.2/GN) with ESMTP id g87E8SRb030318 for ; Sat, 7 Sep 2002 16:08:28 +0200 (CEST) (envelope-from emacs-devel-admin@gnu.org) Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17ngpA-0001gF-00 for ; Sat, 07 Sep 2002 16:44:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17ngG9-0008Pe-00; Sat, 07 Sep 2002 10:08:26 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17ngEV-0008Lh-00 for emacs-devel@gnu.org; Sat, 07 Sep 2002 10:06:43 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17ngET-0008LV-00 for emacs-devel@gnu.org; Sat, 07 Sep 2002 10:06:42 -0400 Original-Received: from relay01.cablecom.net ([62.2.33.101]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17ngES-0008LR-00 for emacs-devel@gnu.org; Sat, 07 Sep 2002 10:06:40 -0400 Original-Received: from smtp.swissonline.ch (mail-4.swissonline.ch [62.2.32.85]) by relay01.cablecom.net (8.12.5/8.12.5/SOL/AWF/MXRELAY/20020820) with ESMTP id g87E6d20042611 for ; Sat, 7 Sep 2002 16:06:39 +0200 (CEST) (envelope-from alex@emacswiki.org) Original-Received: from confusibombus (dclient217-162-239-98.hispeed.ch [217.162.239.98]) by smtp.swissonline.ch (8.11.6/8.11.6/SMTPSOL/AWF/2002040101) with ESMTP id g87E6dF26506 for ; Sat, 7 Sep 2002 16:06:39 +0200 (MEST) Original-Received: from alex by confusibombus with local (Exim 3.35 #1 (Debian)) id 17ngGh-00008C-00 for ; Sat, 07 Sep 2002 16:08:59 +0200 Original-To: emacs-devel@gnu.org X-Face: ^BC$`[IcggstLPyen&dqF+b2'zyK#r.mU*'Nms}@&4zw%SJ#5!/7SMVjBS7'lb;QK)|IPU5U'o1'522W4TyzB3Ab*IBo^iw]l4|kUbdZuUDO6=Um-.4IzhNiV'B"@K#jy_(wW|Zbk[34flKY^|PrQ?$u2\fKg^]AY>wOX#H32i In-Reply-To: <200209061736.g86HaDi00352@rum.cs.yale.edu> ("Stefan Monnier"'s message of "Fri, 06 Sep 2002 13:36:13 -0400") Original-Lines: 36 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2.90 (i686-pc-linux-gnu) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:7691 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:7691 "Stefan Monnier" writes: > This doesn't have to be the case. The custom info can simply > keep track of "what the user added with custom" and "what the user > removed with custom" and custom-set-variable would simply take the > current map and add/remove the corresponding entries. Hm, but while we are in the same session, potential bug remain (the ones that Per keeps talking about). 1. Load foo.el which uses defkeymap to create a keymap with binding A for one key. 2. Customize the keymap with binding B for the same key. The shadowed binding A is saved. 3. Load foo-extra or call a hook that uses define-key to change the binding for the same key to C. 4. Customize the keymap. I think it is ok to see binding C, because after all that is what happens to variables as well. The problem is that when the user removes the binding for that key, we revert to binding A, instead of B. We solved one particular problem which would have been solved with all the other approaches as well. When the original keybindings in the source (defkeymap) get improved, the user benefits at all times. So that is not the benefit of the current solution, that is a benefit of all solutions. We had a solution using two variables instead of one, which was considered a drawback. In step 4, however, this two-variable solution would have reverted to binding B. This is what Per calls the 100% solution. I actually think that this last step to 100% is not really required, so I am happy with the current code I posted. Alex.