From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: ffap bindings suggestion Date: Sun, 12 Feb 2006 13:19:31 -0800 Message-ID: References: <873bioxq2c.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1139779228 16248 80.91.229.2 (12 Feb 2006 21:20:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Feb 2006 21:20:28 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 12 22:20:24 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F8Odp-00018v-0O for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2006 22:20:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F8Odo-0007Sr-HO for ged-emacs-devel@m.gmane.org; Sun, 12 Feb 2006 16:20:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F8OdN-0007Sj-PS for emacs-devel@gnu.org; Sun, 12 Feb 2006 16:19:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F8OdL-0007SV-Qp for emacs-devel@gnu.org; Sun, 12 Feb 2006 16:19:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F8OdL-0007SS-Nk for emacs-devel@gnu.org; Sun, 12 Feb 2006 16:19:51 -0500 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1F8Ohe-00073l-Du for emacs-devel@gnu.org; Sun, 12 Feb 2006 16:24:18 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k1CLJmo0028023 for ; Sun, 12 Feb 2006 14:19:48 -0700 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k1CLJmeq021189 for ; Sun, 12 Feb 2006 14:19:48 -0700 Original-Received: from dradamslap (dhcp-amer-whq-csvpn-gw3-141-144-81-71.vpn.oracle.com [141.144.81.71]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k1CLJl5P021178 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Sun, 12 Feb 2006 14:19:47 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <873bioxq2c.fsf-monnier+emacs@gnu.org> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:50424 Archived-At: > In one of my libraries, I use a minor mode, and restore the > original bindings when the mode is exited. I find that > clean. However, the library currently just restores the vanilla > Emacs (-q) bindings; it would of course be better to save the > bindings at the time of entry into the mode, and restore those > (original user bindings) when the mode is exited. I'm not > referring here to a keymap that is local to the mode; in my > case, the minor mode changes minibuffer key bindings. (Using a > local keymap is obviously the way to go when appropriate.) BTW, why do you change the minibuffer-local-map rather than simply use a proper minor mode with minor-mode-map-alist? Perhaps I don't understand `minor-mode-map-alist' well enough. I don't know how to use it to create some bindings that will be used only in the minibuffer (some only for particular kinds of completion etc.), and that will be seen by built-in functions that work with the minibuffer. I change the various `minibuffer-*-map's because I use built-in functions such as `completing-read' that work with those maps (built-in functions don't know about my minor mode). For instance, the C code defining `completing-read' refers to `Vminibuffer_local_completion_map' (and so on) explicitly. It is only minibuffer maps that I need to change in this way. I do also have a minor-mode map that I use for some bindings that are not limited to the minibuffer. Let me know if I'm missing a better way to do this.