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: doc of defining minor modes Date: Fri, 19 May 2006 10:45:45 -0700 Message-ID: References: <85bqtu9dw0.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1148060880 17975 80.91.229.2 (19 May 2006 17:48:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 19 May 2006 17:48:00 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 19 19:48:00 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fh93D-0004CI-Te for ged-emacs-devel@m.gmane.org; Fri, 19 May 2006 19:46:12 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fh93D-0007g8-Es for ged-emacs-devel@m.gmane.org; Fri, 19 May 2006 13:46:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fh92z-0007fl-CK for emacs-devel@gnu.org; Fri, 19 May 2006 13:45:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fh92y-0007fE-6C for emacs-devel@gnu.org; Fri, 19 May 2006 13:45:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fh92y-0007fA-2C for emacs-devel@gnu.org; Fri, 19 May 2006 13:45:56 -0400 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1Fh96K-0006Dm-En for emacs-devel@gnu.org; Fri, 19 May 2006 13:49:24 -0400 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k4JHjr1W002797 for ; Fri, 19 May 2006 11:45:53 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw1-141-144-66-197.vpn.oracle.com [141.144.66.197]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k4JHjqow006923 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 19 May 2006 11:45:53 -0600 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <85bqtu9dw0.fsf@lola.goethe.zz> X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Importance: Normal 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:54825 Archived-At: > Consider a (typical) external library that is not required by any > other library. It is not part of Emacs itself; nothing in it is > preloaded. Are you saying that there is some way that browsing > Customize or using a menu or byte-compiling some file would cause > that library to be loaded? Is there some way for it to be loaded > without the user explicitly loading it? If so, this should be > explained, because it is really not obvious. Many external libraries use autoload cookies in order to create a short startup file that gets loaded unconditionally in order to make Emacs aware of the library's existence. Yes, thanks. I almost added autoload cookies to the list myself, but I didn't want to include something that wasn't already mentioned. IIUC, if a external library has no autoload cookies (and it is not required by another library etc.), then there should be no problem. Do you agree? And even if a library has autoload cookies, there can be a problem only if the user creates a loaddefs.el (or equivalent short startup file) that includes those autoloads. That is, the user must explicitly do something in order to manifest the problem in the case of a standalone library. And that something is fairly sophisticated, in Lisp - e.g. use `update-file-autoloads' on that library. This is hardly a case of surprising an uninformed user. The library is not loaded behind his back in this case. Of course, someone besides the end user might create the startup file based on that library. But that person can then set the mode variable to nil. IOW, if someone uninformed tries to use the library then there is no problem, and if someone informed sets the library up for use by others then s?he will know how to inhibit the mode at startup. > I do not see how Emacs would even know of the existence of such a > library until it is loaded. Autoloads. It does not make sense for larger libraries to get loaded when they are possibly not going to be needed. IIUC, it is not autoloads per se that are the problem, but creating a startup file based on them. That is, a plain autoload (autoload 'foo-cmd "foo" "foo t) that loads a library based on first use of a function should not be a problem - do you agree? The simple case of an unsophisticated user obtaining a standalone external library and using it is, I think, quite common. And perhaps the most common case is for such a library not to have autoload cookies. For such simple cases, I don't see the problem arising. It would be good for the doc to explain what the potential problem is and from where it can arise.