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: `define-globalized-minor-mode': why the need for a separate TURN-ON function? Date: Sat, 7 Apr 2012 07:45:00 -0700 Message-ID: References: <792A96A59B454A7596A0A1676765A152@us.oracle.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1333809917 4932 80.91.229.3 (7 Apr 2012 14:45:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 7 Apr 2012 14:45:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Stefan Monnier'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 07 16:45:16 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SGWtA-0001vw-Bo for ged-emacs-devel@m.gmane.org; Sat, 07 Apr 2012 16:45:16 +0200 Original-Received: from localhost ([::1]:59169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGWt9-0005JY-MY for ged-emacs-devel@m.gmane.org; Sat, 07 Apr 2012 10:45:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41943) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGWt6-0005JA-RJ for emacs-devel@gnu.org; Sat, 07 Apr 2012 10:45:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SGWt5-0002Xo-2q for emacs-devel@gnu.org; Sat, 07 Apr 2012 10:45:12 -0400 Original-Received: from rcsinet15.oracle.com ([148.87.113.117]:21083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGWt4-0002XZ-Sa for emacs-devel@gnu.org; Sat, 07 Apr 2012 10:45:11 -0400 Original-Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q37Ej7EH007486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 7 Apr 2012 14:45:07 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q37Ej63s007369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 7 Apr 2012 14:45:06 GMT Original-Received: from abhmt113.oracle.com (abhmt113.oracle.com [141.146.116.65]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q37Ej5rE003056; Sat, 7 Apr 2012 09:45:05 -0500 Original-Received: from dradamslap1 (/10.159.57.240) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 07 Apr 2012 07:45:05 -0700 X-Mailer: Microsoft Office Outlook 11 In-reply-to: Thread-Index: Ac0Ucl4HnhGdvBj+RG6/ZMgNxfD0YQAWdUFw X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-CT-RefId: str=0001.0A090204.4F8052F4.001A,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 148.87.113.117 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149464 Archived-At: > > why for `define-globalized-minor-mode' must one > > define a separate TURN-ON function to turn the mode on, but > > using the (local) minor-mode function suffices to turn it off? > > As the docstring says: "try to turn MODE on if applicable for that > buffer". That's different to MODE itself which should turn > it in if at all possible. I see; thanks. The "for that buffer" qualification did not jump out at me, especially since the local mode already presumably does its thing for the specific buffer where it is turned on. The difference is that in the local case it is the user who decides whether the mode makes sense and can be turned "for that buffer". In the global case it is the command that must decide separately, for each buffer. I understand now, but this was not at all obvious (to me) from just that 3-word qualification. You might want to make this distinction a bit more obvious in the doc. Perhaps say what you just said here, or add a brief example where the distinction makes sense.