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: bind commands that change buffer contents to `undefined' when read-only? Date: Sun, 23 Sep 2007 13:42:51 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1190580199 15620 80.91.229.12 (23 Sep 2007 20:43:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 Sep 2007 20:43:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 23 22:43:14 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IZYIK-0002C1-6i for ged-emacs-devel@m.gmane.org; Sun, 23 Sep 2007 22:43:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZYIH-0007r8-N5 for ged-emacs-devel@m.gmane.org; Sun, 23 Sep 2007 16:43:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IZYID-0007og-JY for emacs-devel@gnu.org; Sun, 23 Sep 2007 16:43:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IZYID-0007o4-0X for emacs-devel@gnu.org; Sun, 23 Sep 2007 16:43:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZYIC-0007ns-L7 for emacs-devel@gnu.org; Sun, 23 Sep 2007 16:43:04 -0400 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IZYIC-0000m6-3a for emacs-devel@gnu.org; Sun, 23 Sep 2007 16:43:04 -0400 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l8NKh0ZZ001399; Sun, 23 Sep 2007 15:43:00 -0500 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id l8NKgxFv019916; Sun, 23 Sep 2007 14:42:59 -0600 Original-Received: from dhcp-amer-csvpn-gw2-141-144-72-44.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3236764371190580148; Sun, 23 Sep 2007 13:42:28 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-Detected-Kernel: Linux 2.4-2.6 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:79611 Archived-At: > In any case I don't like much this idea of adding explicit `undefined' > bindings, just in order to get a "undefined" message rather than > a "buffer is read-only" error. > > So maybe a better direction is to change the toplevel so that using > a command with a "*" (or a call to barf-if-buffer-read-only) in its > interactive spec when the buffer is read-only will signal > "undefined" rather than signalling the error. And similarly C-h k > may give information such as "the global binding is foo but is of > no use in this buffer because it's read-only". Sounds OK to me at first, but: 1. We would need to make sure that all such bases were covered. `C-h k' is one thing; `C-h b' might be another; the read-only error text is another; and there are perhaps others. 2. It doesn't really help users see that such keys are, in effect, available for binding in such read-only contexts. That was a main motivation behind my proposal. A user might check `C-h b' in Dired, for example, and s?he would see what? A long message explaining what you suggested, for each such key? Is it as clear to read something like that as it is to read `undefined'? I don't think so. And we might end up complicating the code that way, having different kinds of such messages for different contexts (error message, `C-h b' binding list, `C-h k', and so on). I don't think you have given any reason _why_ you "don't like much this idea"; you've just stated a preference. What are the disadvantages you see to this idea? Deciding on a good way to handle this should involve weighing the pros & cons.