From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Oliver Scholz Newsgroups: gmane.emacs.devel Subject: Re: enriched-mode and switching major modes. Date: Mon, 06 Sep 2004 09:36:21 +0200 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <200409042358.i84Nwjt19152@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1094456220 26754 80.91.224.253 (6 Sep 2004 07:37:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 6 Sep 2004 07:37:00 +0000 (UTC) Cc: boris@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 06 09:36:53 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 1C4E3Z-000372-00 for ; Mon, 06 Sep 2004 09:36:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C4E8j-0000r1-Lr for ged-emacs-devel@m.gmane.org; Mon, 06 Sep 2004 03:42:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C4E8Z-0000po-DP for emacs-devel@gnu.org; Mon, 06 Sep 2004 03:42:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C4E8X-0000pE-S2 for emacs-devel@gnu.org; Mon, 06 Sep 2004 03:42:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C4E8X-0000op-P8 for emacs-devel@gnu.org; Mon, 06 Sep 2004 03:42:01 -0400 Original-Received: from [213.165.64.20] (helo=mail.gmx.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1C4E38-0001wz-Ci for emacs-devel@gnu.org; Mon, 06 Sep 2004 03:36:26 -0400 Original-Received: (qmail 21668 invoked by uid 65534); 6 Sep 2004 07:36:24 -0000 Original-Received: from dsl-082-083-135-039.arcor-ip.net (EHLO USER-2MOEN8BWBA.gmx.de) (82.83.135.39) by mail.gmx.net (mp004) with SMTP; 06 Sep 2004 09:36:24 +0200 X-Authenticated: #1497658 Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sun, 05 Sep 2004 13:25:40 -0400") X-Attribution: os X-Face: "HgH2sgK|bfH$; PiOJI6|qUCf.ve<51_Od(%ynHr?=>znn#~#oS>",F%B8&\vus),2AsPYb -n>PgddtGEn}s7kH?7kH{P_~vu?]OvVN^qD(L)>G^gDCl(U9n{:d>'DkilN!_K"eNzjrtI4Ya6; Td% IZGMbJ{lawG+'J>QXPZD&TwWU@^~A}f^zAb[Ru;CT(UA]c& User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (windows-nt) 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:26819 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26819 Richard Stallman writes: > `enriched-mode' sets > buffer-local values for these variables, but when the major mode is > set by `after-find-file', these variables are killed. > > It sounds like enriched-mode is called too early. > What is the command that you give? > > One solution is to make Enriched mode into a major mode. It already > very much "feels" like one. > > The other solution would be to make all variables that Enriched mode > needs to set permanent locals. For `use-hard-newlines' we already > decided that there was no problem. > > The former is acceptable, but not really nice. IMO opinion enriched-mode actually serves two purposes: (1) editing of (very restricted) WP-like documents in the format text/enriched (2) a means to save the colours that appear in a buffer in a file. The difference is subtle. A usage scenario of type (1) would be, for example, that I'd want to keep notes with some text properties in a file. I'd create that file for this purpose, use text-mode as a major mode, turn on enriched-mode and then specify myself explicitely which text properties to use with M-g. A usage scenario of type (2) would be, that I have a buffer that got its text properties from some Elisp function and I want to save that buffer to a file, while also saving the text-properties -- or at least the colours. For instance, when I save my IRC logs (from ERC), I turn on enriched-mode before that. As (1) enriched-mode should clearly be a major mode IMO, a derivative of text-mode. If, for instance, a user wants to keep notes in a file in the format text/enriched, then I can't actually see the point of having text/enriched as a minor mode that is used together with text-mode instead of just being a major mode. As (2) it should be a minor mode, of course. However, currently some of enriched-mode's features that make it suitable for (1) get in the way here. For example I can't just turn on enriched-mode in an ERC buffer, because enriched-mode rebinds RET. As a minor mode, it should only affect the way a buffer is saved to a file and nothing else. So I'd suggest to make enriched-mode a major mode and create a new additional minor mode for the purpose of (2). There is a technical problem with making it a major mode: currently format.el expects modes specified in `format-alist' to be minor modes. However, fixing this would be an improvement anyways. But maybe this all can wait until after the release. I believe that (1) is the way it is used most of the time. Oliver -- Oliver Scholz 21 Fructidor an 212 de la Révolution Ostendstr. 61 Liberté, Egalité, Fraternité! 60314 Frankfurt a. M.