From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Adding use-package to ELPA Date: Mon, 07 Mar 2022 16:03:46 -0500 Message-ID: References: <87k0dbi7ol.fsf@posteo.net> <871qzgyfuo.fsf@posteo.net> <87ilsre5jf.fsf@posteo.net> <87zgm2bpez.fsf@posteo.net> <87ilsp4lc8.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16732"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: chad , EMACS development team To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 07 22:04:34 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 1nRKWw-00047s-3v for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Mar 2022 22:04:34 +0100 Original-Received: from localhost ([::1]:33462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRKWu-0003tZ-SO for ged-emacs-devel@m.gmane-mx.org; Mon, 07 Mar 2022 16:04:32 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRKWJ-0003EE-N6 for emacs-devel@gnu.org; Mon, 07 Mar 2022 16:03:55 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRKWG-0006r8-Ue for emacs-devel@gnu.org; Mon, 07 Mar 2022 16:03:54 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 5F4021001D2; Mon, 7 Mar 2022 16:03:50 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id EF6AB100163; Mon, 7 Mar 2022 16:03:48 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1646687028; bh=r//savFCuPFuDzHw5NhyC9BxquqHBKQOLiGfFHP/ivM=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=SBwsijv573gb7ZBRynC4/hVa6mYF/aa4gkaFGfUgafolPNI9oMuxImXdMiGFeIoAF v0Rb4LgBNavk/ux9YFCnUrUNNEquQj+nBlkH+oipbqNk7v4nRQQCKHD39AQtOBtGzu g+8MEz5VlqMitVu4Cmp8jkKrfJAbflD3NStrcK6l5zoCozdzsoOnYMzF3RqihJf2aq K8Q+C3pM3B0MsP9Mr4kN7az7wAQzlzTT+NU3heqPd//feMS+gsYyNaauu2vOU/Ivci eAnCojmQZzpESD3on6Cdw2AWh/+mtYKEv6Gm8KY3IaYlszYpoDft5kGbMIB4cdZqXK jkIYYGrOrRp/Q== Original-Received: from ceviche (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id A67BF1203B5; Mon, 7 Mar 2022 16:03:48 -0500 (EST) In-Reply-To: <87ilsp4lc8.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 07 Mar 2022 19:24:39 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:286903 Archived-At: > True, because the above examples just expands to > > (setq smtpmail-smtp-service 587) > > I'd usually recommend to use a local macro to avoid these issues, > because something like > > (setup smtpmail > (:option smtpmail-smtp-service 587)) > > would expand to a `customize-set-variable'-like code, where > `smtpmail-smtp-service' would appear as a quoted symbol. If it expands to `customize-set-variable`, then presumably you wouldn't get the warning, indeed (that's good) but you also wouldn't get a warning if you mistype the var (less good). I want both: absence of warnings when the var name is right, and presence of a warning when it isn't (and presence of a warning when the var is obsolete). >> So `setup.el` could maybe do something like: >> >> (defmacro setup (pkg &rest args) >> (when (we-are-byte-compiling-p) >> (require (byte-run-strip-symbol-positions pkg))) >> ...) > > What is the point of using byte-run-strip-symbol-positions here? Macros receive source code as input, which can/should come with source-position information. Before we can safely run that code we need to strip the position info. > I just tried something like this, but it doesn't seem to work. I'm glad to see that I'm still able to write incorrect code. Stefan