From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: Package initialization Date: Sat, 18 Jul 2015 20:20:22 +0100 Message-ID: References: Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1437247229 29932 80.91.229.3 (18 Jul 2015 19:20:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jul 2015 19:20:29 +0000 (UTC) Cc: emacs-devel To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 18 21:20:28 2015 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 1ZGXeu-00047U-6p for ged-emacs-devel@m.gmane.org; Sat, 18 Jul 2015 21:20:28 +0200 Original-Received: from localhost ([::1]:49464 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGXet-0003ym-99 for ged-emacs-devel@m.gmane.org; Sat, 18 Jul 2015 15:20:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGXeq-0003yd-50 for emacs-devel@gnu.org; Sat, 18 Jul 2015 15:20:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGXep-0008TJ-Bg for emacs-devel@gnu.org; Sat, 18 Jul 2015 15:20:24 -0400 Original-Received: from mail-la0-x22b.google.com ([2a00:1450:4010:c03::22b]:36706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGXep-0008SQ-3b for emacs-devel@gnu.org; Sat, 18 Jul 2015 15:20:23 -0400 Original-Received: by lagw2 with SMTP id w2so76912270lag.3 for ; Sat, 18 Jul 2015 12:20:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=qr7HphPk8sYHBTSRk8jmDtg6UOphUUF9uAaaVs9Tvck=; b=yVulWJQXSuDri775NzpEznBlx+K67A3VWyxqQC4Ik4oHmotJ/zwsaJqB4dryyO/J4R 02bRogvw7E3MRhN1NwJ/AcSa8yfATOBdzxnkKKQYK1SLqhoy+g35M96EHX2JTgj1PyxG P14QdRKts8GJM4T1h8UZuxxlpWGf+bxxHosWGJyev7dvQ6otf7kkR2fOdjwnRTBdw0RN hQ2ScxYMfBYD7P86RdyezYI8K9akcJv2gofpW0usUBsBBdqWQ0x5rClj16DPNr8yX7c1 0O1ZzxDDvoSOLHEulqPnMqGWErPJVoSJi7LnxcWezAbTUG5gm1ncfVI06eENhX6rMswk hwVw== X-Received: by 10.112.210.137 with SMTP id mu9mr19582246lbc.95.1437247222300; Sat, 18 Jul 2015 12:20:22 -0700 (PDT) Original-Received: by 10.25.134.139 with HTTP; Sat, 18 Jul 2015 12:20:22 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: sbeCSbvCDYK1MKl-N7gQtnw1wrA X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22b 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:187957 Archived-At: >>> Which seems to suggest that one should write some >>> ;;;###autoload (progn ...) >>> somewhere that does the initialization. Is this the way it should be >>> done? >> >> Yes, that line can be added to any of the package's =E2=80=9C.el=E2=80= =9D files. > > The question was not if it works; the question was if this is considered > good style. As long as these autoload cookies are restricted to autoloading commands and functions or running some very essential code (like adding a theme to custom-theme-load-path, or adding a mode entry to auto-mode-alist), then yes, it's good style. > Frankly, I think this is very ugly because I can no longer > load the foo-auotload.el file Why would you load the file manually? It gets loaded for you. Or are you complaining about the fact that it gets loaded automatically? (you can disable that) > without clobbering global variables. Autoload cookies should not go around changing any global variable. For instance, they should not change the fill-column or the default-input-method. But it makes sense for them to change some variables, like the auto-mode-alist or the custom-theme-load-path.