From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: bind commands that change buffer contents to `undefined' when read-only? Date: Sun, 23 Sep 2007 14:16:14 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190571394 21808 80.91.229.12 (23 Sep 2007 18:16:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 23 Sep 2007 18:16:34 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 23 20:16:26 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 1IZW0G-0007mh-97 for ged-emacs-devel@m.gmane.org; Sun, 23 Sep 2007 20:16:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZW0D-0006PC-Fk for ged-emacs-devel@m.gmane.org; Sun, 23 Sep 2007 14:16:21 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IZW09-0006Oo-Ui for emacs-devel@gnu.org; Sun, 23 Sep 2007 14:16:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IZW08-0006Nq-L3 for emacs-devel@gnu.org; Sun, 23 Sep 2007 14:16:17 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZW08-0006Nn-CK for emacs-devel@gnu.org; Sun, 23 Sep 2007 14:16:16 -0400 Original-Received: from tomts10.bellnexxia.net ([209.226.175.54] helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IZW08-0007Vv-2y for emacs-devel@gnu.org; Sun, 23 Sep 2007 14:16:16 -0400 Original-Received: from pastel.home ([74.12.208.240]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20070923181615.SUGS9197.tomts10-srv.bellnexxia.net@pastel.home> for ; Sun, 23 Sep 2007 14:16:15 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id DCF358026; Sun, 23 Sep 2007 14:16:14 -0400 (EDT) In-Reply-To: (Drew Adams's message of "Sat\, 22 Sep 2007 19\:18\:35 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux) X-Detected-Kernel: Solaris 8 (1) 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:79603 Archived-At: >> That's not a problem. Your suggestion is really just an extension of >> `suppress-keymap' and should be used similarly: by putting those >> `undefined' bindings first and then adding the local bindings. > Yes, that would be OK for Emacs. In my own use, however, the various keymaps > can be already defined before I get to them. 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". Stefan