From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: chad Newsgroups: gmane.emacs.devel Subject: Re: interactive feel of Emacs: the need for speed, and -Q [measure.el] Date: Thu, 23 Apr 2020 13:05:43 -0700 Message-ID: References: <87tv26qvwh.fsf@ebih.ebihd> <87mu7njm9h.fsf@ebih.ebihd> <87h7xv44xr.fsf@md5i.com> <875zeasexm.fsf@ebih.ebihd> <87d08i3vvk.fsf@md5i.com> <87h7xph5a4.fsf@ebih.ebihd> <87sgh4ah4x.fsf@tcd.ie> <86imhzgs5f.fsf@stephe-leake.org> <2c7cfff7-240f-6444-9a79-b5c36b381272@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000af0a5205a3fac670" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="73132"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Cl=C3=A9ment_Pit=2DClaudel?= , EMACS development team To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Apr 23 22:06:39 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRi7K-000IuT-Kc for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Apr 2020 22:06:38 +0200 Original-Received: from localhost ([::1]:39340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRi7J-00065A-Mz for ged-emacs-devel@m.gmane-mx.org; Thu, 23 Apr 2020 16:06:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50254) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRi6g-0005Te-80 for emacs-devel@gnu.org; Thu, 23 Apr 2020 16:05:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRi6f-0007K1-Jr for emacs-devel@gnu.org; Thu, 23 Apr 2020 16:05:58 -0400 Original-Received: from mail-yb1-xb31.google.com ([2607:f8b0:4864:20::b31]:38755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRi6f-0007GX-52 for emacs-devel@gnu.org; Thu, 23 Apr 2020 16:05:57 -0400 Original-Received: by mail-yb1-xb31.google.com with SMTP id l5so3803337ybf.5 for ; Thu, 23 Apr 2020 13:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BzVey3j2nEF2lSnrZJ+D16KcVhUBaQ1NmHelULUVnxI=; b=H+xOH1IqQwjsZrwoLhprTslLJQhxX9eD45HzE4qdbEBLRqwieKznZdIGAjo+nDpECk J3o7BxNBfSRTN91Qe39PEabGd1LJ6r5LhmLh0wH5wsLp4EDa7TkevytGCn4Jyj5/l9jB 1RBDda88DRPKRupjyvfvrtuLFH4hZWmj3LttxfwdBVu/vV+qdMW3pqrC6V4rqg1/wzsC znNpEwif+0qK8JqHPAvzgldkkOfNi1q1ZL/D04O4Gmcvt9w2KsWfp33rtfnxrVcAyJyN fVnNZ5/YQIL2JCJP52swWUHFEXwTYrweZU79Eae6NA+9kb+9G8dUwbKoTOH9PF7E1xBZ bnQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BzVey3j2nEF2lSnrZJ+D16KcVhUBaQ1NmHelULUVnxI=; b=fGHxKhgRFceL3WtCEcuQdU/gsnAlT13Q2KbmCz2bD5kdGFXfxf5rEz6pauH3Z4ZUBz PuujonEmZINa6S7uYOqBQ3FREJpR5UUcEk23jXCCwY7C0GXphITIewezanMIiEIqccsf O+DBADMmffgDXL0yVR+9QCTIVbnlhypv/5bRO2EqgjOWRpgm3vyPPMdUbfLnVQTUlgcP RN2D3GnlYSb59bLl5kaSh1bRoA4udPDqPUbpW43IjS79ZI393FurdKeAS6uDcuR2Ihwt GLUR41FAcGxWxZwZ9fem0XdbnVC5Dd5wTMb4Esn419RSevVYWObHvFWoDVxsEgH2ujam aX/Q== X-Gm-Message-State: AGi0Pub/wo2e3dkyplAlTZqZHwiU9eN+LYJKym7l5A5qS1xz5svRmBMV frFZ1kf/BEiVsLy1sGjX3FrP6Df4p5qfWxl9BqM= X-Google-Smtp-Source: APiQypLcBs7oN8INQR2nMPLZzOd79EjOjS+6ASh8feuWEdoI+7VS7v1wyLyZ8U0txYlK1pCHTAZtI3YPe5ncaxGM5Fg= X-Received: by 2002:a25:4409:: with SMTP id r9mr9503451yba.469.1587672354063; Thu, 23 Apr 2020 13:05:54 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::b31; envelope-from=yandros@gmail.com; helo=mail-yb1-xb31.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::b31 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:247627 Archived-At: --000000000000af0a5205a3fac670 Content-Type: text/plain; charset="UTF-8" I long ago adopted the use of require in my .emacs file as a well-worn shorthand for "load this unless it's already loaded". Is there an alternative that I should be using instead? (Please forgive the thread necromancy; I just ran across this usage of require again today, and remembered this thread.) Thanks, ~Chad On Thu, Apr 16, 2020 at 1:14 PM Stefan Monnier wrote: > >>>>> Here are my requires: > >>> As a general rule, `require` should not appear in a `~/.emacs`. > >>> It's for use at the top of a library file. > > What's the replacement, then? > >> They should be replaced with the relevant (load-file "...autoloads"). > > That doesn't do the same thing at all. What if you want to use functions > > that are not autoloaded, or macros? > > In your ~/.emacs? > > Presumably if users can be expected to use a function/macro directly > from ~/.emacs, the package should mark that function/macro as autoloaded > (especially for macros; for functions this can often be avoided if the > function is expected to be called only from with the corresponding mode > hook or an `eval-after-load`). > > If not, it's a case that doesn't fall within the "general rule" and then > you'd have to consider the details to know what *should* happen and what > can be done temporarily until the ideal situation can be applied. > > > Stefan > > > --000000000000af0a5205a3fac670 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I long ago adopted the use of require in my .emacs file as= a well-worn shorthand for "load this unless it's already loaded&q= uot;. Is there an alternative that I should be using instead? (Please forgi= ve the thread necromancy; I just ran across this usage of require again tod= ay, and remembered this thread.)

Thanks,
~Chad=

On Thu, Apr 16, 2020 at 1:14 PM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
=
>>>>> Here= are my requires:
>>> As a general rule, `require` should not appear in a `~/.emacs`= .
>>> It's for use at the top of a library file.
> What's the replacement, then?
>> They should be replaced with the relevant (load-file "...auto= loads").
> That doesn't do the same thing at all.=C2=A0 What if you want to u= se functions
> that are not autoloaded, or macros?

In your ~/.emacs?

Presumably if users can be expected to use a function/macro directly
from ~/.emacs, the package should mark that function/macro as autoloaded (especially for macros; for functions this can often be avoided if the
function is expected to be called only from with the corresponding mode
hook or an `eval-after-load`).

If not, it's a case that doesn't fall within the "general rule= " and then
you'd have to consider the details to know what *should* happen and wha= t
can be done temporarily until the ideal situation can be applied.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan


--000000000000af0a5205a3fac670--