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? [was:highlight-changes-mode] Date: Sun, 10 Dec 2006 17:40:37 -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 1165801318 9801 80.91.229.10 (11 Dec 2006 01:41:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 11 Dec 2006 01:41:58 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 11 02:41: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 1GtaAz-0003Aq-Sf for ged-emacs-devel@m.gmane.org; Mon, 11 Dec 2006 02:41:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GtaAz-0002cs-1z for ged-emacs-devel@m.gmane.org; Sun, 10 Dec 2006 20:41:53 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GtaAq-0002cd-0C for emacs-devel@gnu.org; Sun, 10 Dec 2006 20:41:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GtaAl-0002bQ-8L for emacs-devel@gnu.org; Sun, 10 Dec 2006 20:41:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GtaAl-0002bN-50 for emacs-devel@gnu.org; Sun, 10 Dec 2006 20:41:39 -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 1GtaAk-00011V-NB for emacs-devel@gnu.org; Sun, 10 Dec 2006 20:41:39 -0500 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id kBB1fYnH011202 for ; Sun, 10 Dec 2006 18:41:34 -0700 Original-Received: from rcsmt250.oracle.com (rcsmt250.oracle.com [148.87.90.195]) by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id kBAAkrkV016978 for ; Sun, 10 Dec 2006 18:41:33 -0700 Original-Received: from dhcp-amer-csvpn-gw1-141-144-65-20.vpn.oracle.com by rcsmt251.oracle.com with ESMTP id 2269903221165801244; Sun, 10 Dec 2006 18:40: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:63567 Archived-At: > - 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. > > That might be good. However, I'd rather have the simplest call > affect only the current buffer and use C-u to make it global. I think I disagree, if you mean that M-x foo-mode should toggle locally. With that design: . If there were no buffers where it was defined locally, then M-x foo-mode would still toggle everywhere (global). . If there were buffers where it was defined locally, then M-x foo-mode would toggle differently, depending on where it was invoked: - toggle only locally, if invoked in a buffer with a local value - toggle globally, if invoked in a buffer with no local value This inconsistency would be quite confusing. I think the best approach is to let M-x foo-mode always toggle the global value and C-u M-x foo-mode always toggle the local value. The latter could even be used to _define_ a local override of the global value, requiring nothing extra for that. > - 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). > > That would fit the current scheme (except that these should > operate locally). Not sure what you mean by the last part, but if it is similar to the previous, see above. > - 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? > > these might be ok for global turn on and off. I guess we agree on the essential: allow for local overrides of a global mode. But we disagree on the key bindings (UI). Please examine all cases and then make a proposal. My preference would be to keep the current treatment for a global minor mode that is not overridden anywhere. This is the most common case, so it should be the easiest to use. I would want toggling the global (and the local) value to always use the same key bindings (just M-x for global, with numeric arg to turn on or off explicitly). I would not want the bindings to change, depending on whether or not I'm in a buffer that has a local override. If you are saying that the global toggle would sometimes (if no local value) be via M-x and sometimes (if local values exist) be via C-u M-x, then I am against that inconsistency. If you are saying that the global toggle would always be C-u M-x, then I am against that too, because the _common_ global case is (the current one) where there are no local overrides, and it is inconvenient to use C-u each time just to toggle the mode. My assumption is that local overrides of global minor modes will not be too common, and that the common cases will be a) global minor modes with no local overrides and b) local minor modes.