From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tim Cross Newsgroups: gmane.emacs.devel Subject: Re: cl-lib warnings Date: Tue, 27 Dec 2022 14:43:30 +1100 Message-ID: <86ilhxh4ai.fsf@gmail.com> References: <83wn6kamwr.fsf@gnu.org> <83len0aldq.fsf@gnu.org> <20221226031314.lhwwazpjdq257k4j@Azure-Swing.local> <20221226234853.cj4sskzta46dvpbx@Azure-Swing> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36620"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.8; emacs 29.0.60 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 27 05:14:54 2022 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 1pA1Mc-0009FP-Ap for ged-emacs-devel@m.gmane-mx.org; Tue, 27 Dec 2022 05:14:54 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pA1Ls-0006d6-0A; Mon, 26 Dec 2022 23:14:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pA1Lr-0006ct-2Y for emacs-devel@gnu.org; Mon, 26 Dec 2022 23:14:07 -0500 Original-Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pA1Lp-0004AO-8g for emacs-devel@gnu.org; Mon, 26 Dec 2022 23:14:06 -0500 Original-Received: by mail-pl1-x62b.google.com with SMTP id u7so12172863plq.11 for ; Mon, 26 Dec 2022 20:14:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=t1ujaDrnamcoDYw+Dc3BFrSv48FenHSv7ySg6eJTb3g=; b=MxlkjCKCnmyrDbsxMRSz4EPJF+GeuySUfqda7mzChQBSNVfsG6+j5PAGYKkMBI8wzX VVUKrWgnSlAtGnh6N050Yj8Xsol4PQXMZFC7xSjLEYy4XYPmmqe4v1XDS0+gmRrSLohf eRn/x2sEDqjfYAwLEtjIZIcIUyNLhiz0zIqhR4uFnRW64n2AaXNqg8HyRTCPwkh+nYeA 5PKHyV2sGiTVKk4mLAwQdJIXFHBMymHRwtz++X1YlcLZ+OF2j+0fIUQxmypvg3MCYEmF jJuH87VIP1afPt+bLbZDE/sni7KuDugBg9cHfBHeZBezKzKoorgzYiO59ojhcHVc6JmW MWmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:to:from:user-agent:references:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t1ujaDrnamcoDYw+Dc3BFrSv48FenHSv7ySg6eJTb3g=; b=BetkL/GmkFS5la1tc0J/igONUWXTu5VDpuZCdS3KDFiuiMsZmo/hXMWrHw/Do3y1FN WhXNonKRxM6FCvUNbI2yLUYOSXkvHLENmX2kZli/krq0kSX1KK/+eor+DT9+G3JQUjAr zYglRGxFSNPLu67fiXBkNVcmAsrUE8o/WIgwpZd+J45NWog1Ij5sK7fALQW8m/PWLCdk 6JKLmQ/7G4i18q81fn/kzv+jVnlwlZr0X3H4tnDPe7KioJagRNrQdkt9aGRJ+q5bFSH1 D8zcBSsFY04DgCFJ/qSwqwwoO67p3io+V66FNKPoqTH56tf42aDlpQagwoe/6CqQmlyM T40w== X-Gm-Message-State: AFqh2kqawaUGbMxrcd3gxXW13Vh7ms0EdKnjAC3hDojpgpifkGXuIYZs ix1pO0I3jKNyoefp7J1lnSFtQO9oLhs= X-Google-Smtp-Source: AMrXdXt7cESArYHSOK/2Q6oXy3ohV+L1i0gqQgtSpV0MuvsBLPwlOGBpwdCt4eXvQPljygDo4c6CCA== X-Received: by 2002:a17:90a:7106:b0:226:3f8:5b78 with SMTP id h6-20020a17090a710600b0022603f85b78mr2327858pjk.13.1672114442837; Mon, 26 Dec 2022 20:14:02 -0800 (PST) Original-Received: from dingbat (203-173-24-107.dyn.iinet.net.au. [203.173.24.107]) by smtp.gmail.com with ESMTPSA id k1-20020a17090a148100b00218998eb828sm9295905pja.45.2022.12.26.20.14.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Dec 2022 20:14:02 -0800 (PST) In-reply-to: Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=theophilusx@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301951 Archived-At: Jo=C3=A3o T=C3=A1vora writes: > On Mon, Dec 26, 2022 at 11:49 PM Milan Glacier wr= ote: > > >I'm afraid mode options will make this even more > >complicated. And what's with that defvar? > > use-package is really a magic. But nobody uses a blank `(use-package > foo)`, usually a simple and pracctical use-package call would be > something like this: > > (use-package foo > :config (setq foo-1 nil) > :init (setq foo-2 nil) > :hook ((python-mode emacs-lisp-mode) . foo-mode)) > > which specifies the code to be evaluated before foo is loaded (:init > part), the code to be evaluated after foo is loaded (:config part), and > the hook related to this package, which expands to: > > My expansion of that same form is larger and harder to read,=20 > with condition-case and variables and stuff. But it would seem=20 > that the fluff overhead is constant, which is good. > > So I get your point: with enough practice, it's easy to see the > primitives in use. >=20=20 > (I personally am not a fan of use-package, I don't think it brings any > thing new. Often I need to expand it to see if its behavior is expected, > then why shouldn't I just write plain setq, add-hook stuffs directly?) > > Exactly.=20 > I am a fan of use-package. I've been using it for years. I really don't follow the reasoning of the argument against it on the basis that it brings nothing new in the sense you can achieve the same result using existing facilities. This could be argued about many things, especially when it comes to code and programming. Many 'new' things are really just further abstractions or alternative abstractions for features/functionality which already exists. By definition, anything achieved via a macro could also be done just by using 'existing primitives'. I also find the suggestion use package is not good because when you expand the macro, it will be harder to read than if you had simply implemented the code directly using existing primitives. This is true of many macros and I think completely misses the point. In the many years I've been using use-package, there has been exactly one instance where I needed to expand the macro to understand what it was doing. Actually, I didn't need to do it, I did it more out of interest. What I like about use-package is it has made my init file more concise and easier to manage and while I could achieve exactly the same outcome writing a lot of additional elisp myself, I appreciate the fact I don't have to and I can spend more time focusing on my real work. This is especially true because much of that additional elisp I would be forced to write if I didn't have use-package is very much 'boiler plate' code - boring utility code to add hooks, update mode, interpreter, filename magic, package installation, key bindings, setq etc. Essentially, I find use-package does exactly what a useful macros does - it adds some sugar which helps me avoid having to write boring repetitive code of low interest= .=20 I am completely neutral regarding the inclusion of use-package into Emacs core. It is a relatively small package and having it there is convenient. However, having to install it from ELPA was trivial and convenient as well. Having it as part of Emacs core has made no significant difference for me - perhaps my init file is now 2 lines smaller. I do admit not really understanding the need many seem to have regarding getting stuff into 'core'.=20