From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: enriched-mode and switching major modes. Date: Sun, 12 Sep 2004 05:10:35 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <200409042358.i84Nwjt19152@raven.dms.auburn.edu> <200409060059.i860xdo20431@raven.dms.auburn.edu> <200409110214.i8B2EaZ12276@raven.dms.auburn.edu> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1094980437 23017 80.91.229.6 (12 Sep 2004 09:13:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Sep 2004 09:13:57 +0000 (UTC) Cc: boris@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 12 11:13:50 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C6QQg-0005O8-00 for ; Sun, 12 Sep 2004 11:13:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C6QW8-00045n-VW for ged-emacs-devel@m.gmane.org; Sun, 12 Sep 2004 05:19:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C6QTJ-0003JP-Q2 for emacs-devel@gnu.org; Sun, 12 Sep 2004 05:16:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C6QTI-0003Im-HM for emacs-devel@gnu.org; Sun, 12 Sep 2004 05:16:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C6QTI-0003Ii-EI for emacs-devel@gnu.org; Sun, 12 Sep 2004 05:16:32 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C6QNY-00039q-GI for emacs-devel@gnu.org; Sun, 12 Sep 2004 05:10:36 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1C6QNX-0004gQ-QA; Sun, 12 Sep 2004 05:10:36 -0400 Original-To: Luc Teirlinck In-reply-to: <200409110214.i8B2EaZ12276@raven.dms.auburn.edu> (message from Luc Teirlinck on Fri, 10 Sep 2004 21:14:36 -0500 (CDT)) 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27039 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27039 I believe that we still have to use post-command-hook to avoid possibly very annoying and confusing inconsistencies that could otherwise arise in the case of error or quit (as well as for major modes that do not use `run-mode-hooks'). I want to avoid using post-command-hook for this, because it is not clean and reliable. It more or less does the right thing, in most cases, but not exactly, and not always. The right thing to do in case of an error would be to restore these bindings as part of error handling. Or, alternatively, there could be a list of local variables not to kill when changing major modes. This list would itself be local (that's how it differs from making the variables permanent). Enriched mode would put them onto this list. That way, it would not have to do anything like turn itself off and on. As regards the key bindings, it ought to do them with a minor mode keymap instead of its current method. That would be much cleaner anyway. Probably it was written before the minor mode keymap feature existed. Want to try it that way?