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: global minor modes that can be overridden locally? Date: Mon, 11 Dec 2006 21:00:54 -0800 Message-ID: References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1165899710 9208 80.91.229.10 (12 Dec 2006 05:01:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Dec 2006 05:01:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 12 06:01:49 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1Gtzlx-0001Zt-07 for ged-emacs-devel@m.gmane.org; Tue, 12 Dec 2006 06:01:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gtzlw-00024f-Fp for ged-emacs-devel@m.gmane.org; Tue, 12 Dec 2006 00:01:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gtzll-00023T-AO for emacs-devel@gnu.org; Tue, 12 Dec 2006 00:01:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gtzlk-00022a-Hz for emacs-devel@gnu.org; Tue, 12 Dec 2006 00:01:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gtzlk-00022P-9A for emacs-devel@gnu.org; Tue, 12 Dec 2006 00:01:32 -0500 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gtzli-0003Xq-VU for emacs-devel@gnu.org; Tue, 12 Dec 2006 00:01:31 -0500 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id kBC51REx026026 for ; Mon, 11 Dec 2006 22:01:27 -0700 Original-Received: from rcsmt250.oracle.com (rcsmt250.oracle.com [148.87.90.195]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id kBC51Q34018961 for ; Mon, 11 Dec 2006 22:01:27 -0700 Original-Received: from dhcp-amer-csvpn-gw2-141-144-73-226.vpn.oracle.com by rcsmt251.oracle.com with ESMTP id 2277664701165899655; Mon, 11 Dec 2006 22:00:55 -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: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:63608 Archived-At: > > Uh, I never heard of global-*-mode. Is that documented? > > global-auto-composition-mode ... Actually, I had heard of (and used) global-font-lock-mode. I hadn't thought about it. > > I define a global minor mode using define-minor-mode with > > :global, and M-x foo-mode is the global toggle for it. > > There is no global-foo-mode defined > > for my mode by define-minor-mode with :global. > > You are confusing two slightly different situations. > > There are "true" global modes, which _only_ have a global effect, and > wouldn't make sense as a local mode; an example is `tool-bar-mode'. > Such modes are called FOO-mode because it is the obvious name (and > adding "global-" to the beginning would be pointless and annoying). I sure agree about that last part. > However there are global modes which are actually the effect of applying > a local mode globally, that is, they enable or disable the corresponding > local mode in all buffers. Such modes are called global-FOO-mode, > because the fundamental mode in question is the local FOO-mode, and > global-FOO-mode is merely a convenient adjunct. Ah, I didn't know that. Sorry if I confused things. I don't know if anything I wrote on this earlier in this thread makes any sense for that context. I had in mind only the other sort (the "truly" global sort) of global minor mode. I thought that someone was asking to be able to locally override a (truly) global mode locally, and I was proposing a way to perhaps do that. >>From what you say, there is probably no need for what I suggested. Sorry for the noise. In the version of Emacs 22 I was using, there was nothing about define-global-minor-mode in the manual. I picked up a new Emacs binary today (thanks to Lennart), however, and I see it there now. I wonder, however, if the terminology might not be confusing. The "pseudo" global minor modes are not the same thing as the "true" global minor modes, but it is they that result from using the macro named `define-global-minor-mode'. And the resulting mode names `global-*-mode' also seem to hinder clarity in the same way. Couldn't this be made clearer with some better choice of terminology? If the normal, "true" global minor mode is not the one that has "global" written all over it, then aren't we asking for trouble? And aren't we asking for trouble just by having two different animals that are both referred to as "global" minor modes? The local-turned-global beasts were not in my build of July, AFAICT. Assuming that they fit a real need, shouldn't we perhaps revisit the terminology? I don't have a good terminology suggestion (yet) - I'm still not too clear on their raison d'etre. Maybe someone can suggest a better way to talk about these different kinds of critters? It sounds like the pseudo global modes are not global modes, but local modes that are applied globally. If that's the case, then perhaps that's the best way to speak of them: don't call them global, but speak of them being applied globally. Perhaps rename `define-global-minor-mode' to `make-minor-mode-global' (a la `make-variable-buffer-local'), since the input is a minor mode and you are, in effect, making it serve globally (IIUC). Even that characterization of being applied globally (vs being inherently global) sounds like too fine a nuance and a possible source of confusion, however. One way or the other, I think there will need to be some distinction made in the doc, to guide people toward using one or the other sort of global mode, depending on their different needs. Miles's explanation is a start and helped me, and that explanation is missing from the doc, AFAICT.