From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: cl-lib warnings Date: Mon, 26 Dec 2022 15:10:34 +0000 Message-ID: References: <86bknx8783.fsf@mail.linkov.net> <837cylapt4.fsf@gnu.org> <83wn6kamwr.fsf@gnu.org> <83len0aldq.fsf@gnu.org> <20221226031314.lhwwazpjdq257k4j@Azure-Swing.local> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000001fbec505f0bc8a0c" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19220"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Milan Glacier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 26 16:11:29 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 1p9p8T-0004rU-JM for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Dec 2022 16:11:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9p7r-0001Ua-7h; Mon, 26 Dec 2022 10:10:51 -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 1p9p7p-0001UC-1u for emacs-devel@gnu.org; Mon, 26 Dec 2022 10:10:49 -0500 Original-Received: from mail-oa1-x33.google.com ([2001:4860:4864:20::33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9p7n-0005nn-8W for emacs-devel@gnu.org; Mon, 26 Dec 2022 10:10:48 -0500 Original-Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-14fe0e9ed11so2980179fac.2 for ; Mon, 26 Dec 2022 07:10:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CvDxqRk90i+qTUSLt5i/bhpIc4YlpndbPPYbF3DuYg4=; b=HDatAWJyi49q8gKnWG1Dc1r3vcSFkf4yqE0TbvuN9xBL4T4mK4hrh5lkajZgyZ4bZx YtkEZn9wd4tBbuZ6d809uM+PYtWJQJsxQ8MabXQShRJqfZ3BLtJOC+cB0QHIq8SQdzsL SSsV8aMFtqDT1aJWy6HRO2kzr7XswzWUnK3vi1iQndAYobVjiPQQltlGviTODHRpuuUE 9PMx09/BOW5pCBMVcgjyr2vP2l8snVHFforSWb6CkBkKfHq/xTluaXFAQSMGxwcHV0N+ 5WMpQViUxe30FophwNXqKxbiSim17EeIj5u4acvadW+u9UJvHVtvBaa0T+J/OM7a6yq6 r8MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CvDxqRk90i+qTUSLt5i/bhpIc4YlpndbPPYbF3DuYg4=; b=pjWzSxjoIVR0SZ/qWBWeHa3eAP+tVUSfedPxSiWufqzRaSJ83DTr4pl0lDWLCRuw6q qfsjT90HSRyv+8iTmugkUBSRYsnTsxPRcV+MvSOvnQJOKfa5A/cA6kEY3uOHvF9H6YFr e0YfcVlnnUx2ioCpWrealKcHmkcjCaGrp+k6SYOow4Pgl29SzCmw3AmyTSE90y7JmEWn G7a29cPxwFDsco0gWLjdxjN0kExN0+ui22pGuAEHygfhVZw+qp/miOCX188wXoXJNV/X 43RVHv96hnFyiQb//GHUsNHRqd3mcKm1xLXlPbKK+NKYftLpFrJRFaxvlGR7vL9mAYBj HZ5w== X-Gm-Message-State: AFqh2kptI00o1m8ZFB7ZtD2RCyMvUfYVtTaLcuhLbuXzqbqH6t7BotJA LleMxg/g4+m0J297IU3bWTAZ+fQ0azYGG5oezClMgWbvSv8= X-Google-Smtp-Source: AMrXdXs4AnVgNzRoH9c9pYPTBfim7RCZKgcj+blg58r0uFxfAN5hnormbRLmhpZ42d7CCkEJfBtOX/NrZwhZisZjnms= X-Received: by 2002:a05:6870:d99a:b0:143:7889:c525 with SMTP id gn26-20020a056870d99a00b001437889c525mr1011469oab.171.1672067445406; Mon, 26 Dec 2022 07:10:45 -0800 (PST) In-Reply-To: <20221226031314.lhwwazpjdq257k4j@Azure-Swing.local> Received-SPF: pass client-ip=2001:4860:4864:20::33; envelope-from=joaotavora@gmail.com; helo=mail-oa1-x33.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, HTML_MESSAGE=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:301934 Archived-At: --0000000000001fbec505f0bc8a0c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Dec 26, 2022 at 3:13 AM Milan Glacier wrote= : > use-package is a macro, so if someone uses use-package to configure the > package, when he needs to debug (for example minimal configuration), he > can always present the expanded form. (which basically just expands to > stuffs like setq, autoload, add-hook stuffs). > Yes, this was my initial hope too, that something like `pp-macroexpand-last-sexp` could help me. But it's got enough fluff to make it tiring to read. Here's what a simple '(use-package foo)' with no options expands to: (progn (defvar use-package--warning1 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" 'foo keyword (error-message-string err)))) (display-warning 'use-package msg :error)))) (condition-case-unless-debug err (if (not (require 'foo nil t)) (display-warning 'use-package (format "Cannot load %s" 'foo) :error)) (error (funcall use-package--warning1 :catch err)))) I'm afraid mode options will make this even more complicated. And what's with that defvar? --=20 Jo=C3=A3o --0000000000001fbec505f0bc8a0c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Dec 26, 2022 at 3:13 AM Milan Gla= cier <news@milanglacier.com= > wrote:
use-package is a macro, so if someone uses use-packa= ge to configure the
package, when he needs to debug (for example minimal configuration), he
can always present the expanded form. (which basically just expands to
stuffs like setq, autoload, add-hook stuffs).

Yes, this was my initial hope too, that something like=C2=A0
`pp-macroexpand-last-sexp` could help me.=C2=A0 But it's got=C2=A0
enough fluff to make=C2=A0it tiring to read.=C2=A0 Here's what= a simple=C2=A0
'(use-package foo)' with no options expan= ds to:

(progn
=C2=A0 (defvar use-package--warning1=C2=A0 =C2=A0 #'(lambda
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (keyword err)<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 ((msg
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (format &q= uot;%s/%s: %s" 'foo keyword
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (error-message-string err))))
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (display-warning 'use-package msg :e= rror))))
=C2=A0 (condition-case-unless-debug err
=C2=A0 =C2=A0 =C2=A0= (if
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (not
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(require 'foo nil t))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (display-warning 'use-package
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(format &= quot;Cannot load %s" 'foo)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:error))
= =C2=A0 =C2=A0 (error
=C2=A0 =C2=A0 =C2=A0(funcall use-package--warn= ing1 :catch err))))=C2=A0

I'm afraid mode opti= ons will make this even more=C2=A0
complicated.=C2=A0 And what= 9;s with that defvar?

--
Jo=C3=A3o
--0000000000001fbec505f0bc8a0c--