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: global minor modes that can be overridden locally? [was: highlight-changes-mode] Date: Sat, 9 Dec 2006 10:55:44 -0800 Message-ID: References: NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1165690617 28089 80.91.229.10 (9 Dec 2006 18:56:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 9 Dec 2006 18:56:57 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 09 19:56:55 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 1Gt7NS-00073Z-V0 for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 19:56:51 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt7NS-0002bg-DY for ged-emacs-devel@m.gmane.org; Sat, 09 Dec 2006 13:56:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gt7Mh-0002M7-0T for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:56:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gt7Mf-0002Kx-5N for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:56:02 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gt7Me-0002Kk-Nf for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:56:00 -0500 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gt7Me-00041u-Nz for emacs-devel@gnu.org; Sat, 09 Dec 2006 13:56:00 -0500 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 kB9ItvIw020405 for ; Sat, 9 Dec 2006 12:55:57 -0600 Original-Received: from rcsmt251.oracle.com (rcsmt251.oracle.com [148.87.90.196]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id kB9ITfws030245 for ; Sat, 9 Dec 2006 11:55:57 -0700 Original-Received: from dhcp-amer-csvpn-gw2-141-144-73-194.vpn.oracle.com by rcsmt250.oracle.com with ESMTP id 2270617961165690544; Sat, 09 Dec 2006 11:55:44 -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: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 Importance: Normal X-Whitelist: TRUE X-Whitelist: TRUE X-Brightmail-Tracker: AAAAAQAAAAI= 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:63524 Archived-At: > > > I think the real question is which way we want global > > > minor modes to work. Do we want the global mode command > > > to affect only buffers created subsequently? Do we want > > > it to affect all existing buffers? Only existing buffers > > > in which the user has not specified any setting for the mode? > > > > I want turning on or off a global minor mode to affect all > > existing and all future buffers (until another explicit > > mode change). Anything else would be > > a nuisance, in addition to being confusing. > > > > Do you use highlight-changes-mode? Would you say that this > > change would be an improvement for you, in highlight-changes-mode? > > No, I haven't used it. I can't speak to that. Some thoughts on global minor modes (for after the release). I'm no expert on minor modes, so please correct any misunderstandings; it's quite possible this makes no sense at all. 1. Assumption: global minor modes should, generally, let you turn on/off the mode everywhere at once: all existing and future buffers. This should be the most direct and easiest thing to do. 2. A minority of global minor modes might want to let you also turn on/off the mode differently in a particular buffer. IOW, for such modes, you might want to locally override the global setting (on or off). 3. Perhaps this could be treated analogously to setq-default and setq? For example, toggling the mode normally would set the default value of the mode variable everywhere. In buffers that had no different local value, this would also set the mode. But you could set the local value of the mode variable differently, if you wanted. 4. Perhaps an interface for #3 something like this? - M-x foo-mode toggles the mode everywhere (including in buffers that have local values?) - it is like using setq-default (should it also change the local values?). - C-u M-x foo-mode toggles the mode in the current buffer only - it is like using setq with a local variable. - C-9 M-x foo-mode turns the mode on globally. M-- M-x foo-mode turns it off globally. That is, you use a numeric prefix to explicitly turn it on or off globally (vs toggling). - C-u C-u foo-mode turns it on locally; C-u C-u C-u turns it off locally. That is, you use an non-numeric prefix to explicitly turn it on or off locally (vs toggling). Perhaps someone has a better idea here? Would this work also for minor modes that are not meant to be changed just by setting the mode variable? Is there even a need for such a feature (global modes that can be overridden locally)? Should global minor modes that use this feature be declared differently - e.g. via :global-local instead of :global, or should all global minor modes be open to such a use?