From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: How global is a define-global-minor-mode mode? Date: Tue, 23 Jan 2007 18:00:46 -0500 Message-ID: References: <4581996F.3050700@student.lu.se> <87y7nxmqzh.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1169593272 32095 80.91.229.12 (23 Jan 2007 23:01:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 23 Jan 2007 23:01:12 +0000 (UTC) Cc: cyd@stupidchicken.com, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 24 00:01:05 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H9UdV-0001aG-6j for ged-emacs-devel@m.gmane.org; Wed, 24 Jan 2007 00:01:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9UdU-0003oU-QD for ged-emacs-devel@m.gmane.org; Tue, 23 Jan 2007 18:01:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H9UdJ-0003oB-ST for emacs-devel@gnu.org; Tue, 23 Jan 2007 18:00:53 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H9UdJ-0003nr-3m for emacs-devel@gnu.org; Tue, 23 Jan 2007 18:00:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9UdJ-0003no-0U for emacs-devel@gnu.org; Tue, 23 Jan 2007 18:00:53 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H9UdG-0006cM-6r; Tue, 23 Jan 2007 18:00:50 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id CCE452CF064; Tue, 23 Jan 2007 18:00:49 -0500 (EST) Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 2EF3A3FE0; Tue, 23 Jan 2007 18:00:46 -0500 (EST) Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 1B80E4C6D25; Tue, 23 Jan 2007 18:00:46 -0500 (EST) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Tue\, 23 Jan 2007 15\:55\:35 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.92 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.82, requis 5, autolearn=not spam, ALL_TRUSTED -2.82) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-kernel: Linux 2.6 (newer, 3) 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:65428 Archived-At: >> Isn't it the case that it works if the minor mode function >> corresponding to the variable is autoloaded? Otherwise, IIRC you need >> to add a :require to the definition of the minor mode. > Not really: if the global minor mode is autoloaded, then :require is > a nuisance, > I don't follow. Could you explain why it is a nuisance? The :require thingy is a risk: if you move the definition of the mode to another file, then the user's customizations will be broken (it happened with global-font-lock-mode). > And how does this relate to the question of whether the globalized > mode is autoloaded? If it's autoloaded, then the :require is not necessary because the handling of the autoload cookie will make sure that the minor mode function will be called when the user has customized the mode (and will thus trigger loading the relevant file). > so to do it automatically, define-global-minor-mode would have > to know whether it's autoloaded or not. And in most/all cases it's > autoloaded anyway and if not, it should. > Are you proposing that every use of define-global-minor-mode should > have an autoload cookie? As a general rule, yes. I'm sure we can come up with counter examples, tho, so there's no point trying to enforce it. Stefan