From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: Loading a package applies automatically to future sessions? Date: Sun, 4 Feb 2018 10:21:24 -0500 Message-ID: <0322c9de-6882-83f3-39ee-66bbb692579a@gmail.com> References: <76b1fb81-54c0-c213-a542-dc7b9838c473@gmail.com> <2df2ff0a-6bbd-4d39-c830-ce2891909418@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1517757633 2141 195.159.176.226 (4 Feb 2018 15:20:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 4 Feb 2018 15:20:33 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 04 16:20:28 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiM5Z-0007s4-1R for ged-emacs-devel@m.gmane.org; Sun, 04 Feb 2018 16:20:17 +0100 Original-Received: from localhost ([::1]:32873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiM7Y-0005rM-HV for ged-emacs-devel@m.gmane.org; Sun, 04 Feb 2018 10:22:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59091) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eiM6h-0005qU-9O for emacs-devel@gnu.org; Sun, 04 Feb 2018 10:21:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eiM6g-0007Ft-EC for emacs-devel@gnu.org; Sun, 04 Feb 2018 10:21:27 -0500 Original-Received: from mail-qk0-x229.google.com ([2607:f8b0:400d:c09::229]:43908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eiM6g-0007Fh-7y for emacs-devel@gnu.org; Sun, 04 Feb 2018 10:21:26 -0500 Original-Received: by mail-qk0-x229.google.com with SMTP id a5so29715746qkg.10 for ; Sun, 04 Feb 2018 07:21:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:cc:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=h+e3njClksohHIUeGyX+hf8DeOPlDuilmO5u+t3dbpk=; b=W2vnGb2dsWjmukep4kMXPun8z5HiOXLhUTWe0WWdzXEQ31rE01d95goPfEo+BRtgzt 06lGdGZRfWdiqM1gH5gvAzZY7rFhh7uSQ6hWSSgRhl5zwTHmUGEHCJUiynT9BK++OXeo 4h3/GPUvfzCl5SKwPItSXNI4sq5cGHMv0kYPLnzii1vy7XAszFTONF3ICRKrYE/a+krU bzr2dBhAgZqroPTOO7/xz6IWyFKhSFUYcE6SGVt6eND0S6SdS4jhYbSWLVCKMESfJ+s8 O5hKglV/+CoPcngqovUxJRKtQUA0SlyeFxr7l+LCdsmdHHI5DitkmITlNwudCLHLTHHx 2J7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=h+e3njClksohHIUeGyX+hf8DeOPlDuilmO5u+t3dbpk=; b=IHlR/OGmscWaZgRaJzR644O6fBXSdjT9LuGYxOzmSRtt1FMYlK0j4iDtQj+0GvGn3K 7YR7zsEVG6qt/Hysen6TyondA+xJSfZdEkVujB6aR1/3CZ4+sL9fVpcp2VUNb9JbfkTJ QvRHtb/QuZSf/fYYAMNrtj859P05jj2b+FUIVSYHmKzkUpkL6kk6ZpDURQXceAJ/tKlp SBx5q9dcvv3GjEyESi56338EejXVM/0YenHVHB/GYRaNkzM3H+JXeKYZ44rW0CANhNom c8JfV1VGUAhdVwaaGtu6KWxRAtPL+5Ll7NRKPy+ITEQ0viixQvxmVvdgAmetcS5Ex8Zk J2oQ== X-Gm-Message-State: APf1xPCv0e+UnNllnkf8eDv7DTqKnPYE+k0ygbAGe7SLtZcVGWzwksKz mpmFLcvqVUB1oalbHabXoibKX8Rm X-Google-Smtp-Source: AH8x225hCka6jbnNOSXIHPWdI9YWLdqbcm2KGYGKLbScbKfSuXv4FEFMyEqH4At/P4vhv3FZTdOtWg== X-Received: by 10.55.98.206 with SMTP id w197mr8868712qkb.202.1517757685530; Sun, 04 Feb 2018 07:21:25 -0800 (PST) Original-Received: from ?IPv6:2601:184:4180:66e7:b907:8a2e:155c:3c44? ([2601:184:4180:66e7:b907:8a2e:155c:3c44]) by smtp.gmail.com with ESMTPSA id g8sm4419226qth.73.2018.02.04.07.21.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Feb 2018 07:21:25 -0800 (PST) In-Reply-To: Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:222503 Archived-At: > > There may be a misunderstanding. Emacs already works in (mostly) the same way: Emacs' `require' is very close to Python's `import'. > > That's the behavior I'd expect a feature like this to have. > > > * Emacs has autoloads, small pieces of code from packages that are run inconditionally. > > I do know about autoloads; I implemented them. I know that; but I'm writing to the entire list, and there may be other readers who are less familiar with autoloads :) > The questions are (1) do a lot of these packages have autoloads, or just > a few, and (2) when do the autoloads get installed into Emacs. Most packages, AFAICT, make their main interactive entry points autoloads. I think that is the right behavior. > If adding a package to the list for loading has the effect of installing > its autploads in all future sessions, that results in behavior very > different from the 'require' behavior, and behavior that doesn't match > what I'd expect such a feature to have. > > Does Python have autoloads? I would expect not. Yes, in two senses: * Installing a package with 'pip' commonly installs small binaries in your path, so you can call the program from the command line. * Python has .pth files that work essentially like Emacs autoloads. These aren't used very commonly. > Since the effect of calling an autoload function is to call 'require', > it could be that lexical handling of 'require' will automatically > clean up the way these autoloads are handled. The thing is, I don't a the problem with the way autoloads are currently handled. seeWe just need to find a way to make processing autoloads faster, and in fact Stefan has a solution for that, IIUC. The fact that installing a package installs its autoloads is desirable; just like the fact that running 'apt-get install emacs' puts the emacs binary on your path. I think lexical vs dynamic 'require' is a different issue. Clément.