From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: listen Date: Mon, 26 Feb 2024 02:50:22 -0600 Message-ID: <3127f014-898b-4d26-9b42-74054906fbf2@alphapapa.net> References: <51bcca65-2690-4f23-98bd-d929e63d7f94@alphapapa.net> <87il2cdb17.fsf@posteo.net> <6e496679-63f0-4a30-aa6a-8402ff96a6a1@alphapapa.net> <87zfvoac8r.fsf@posteo.net> <49be5d31-043d-4776-8284-b8c4a611ec5f@alphapapa.net> <87wmqr7ikk.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7862"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: emacs-devel To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 26 09:51:29 2024 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 1reWhs-0001og-Hp for ged-emacs-devel@m.gmane-mx.org; Mon, 26 Feb 2024 09:51:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1reWgy-0005Gh-LS; Mon, 26 Feb 2024 03:50:32 -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 1reWgw-0005GI-HQ for emacs-devel@gnu.org; Mon, 26 Feb 2024 03:50:30 -0500 Original-Received: from dog.elm.relay.mailchannels.net ([23.83.212.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1reWgu-00018n-Nq for emacs-devel@gnu.org; Mon, 26 Feb 2024 03:50:30 -0500 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A1C76803830; Mon, 26 Feb 2024 08:50:25 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a236.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 350B6802F11; Mon, 26 Feb 2024 08:50:25 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1708937425; a=rsa-sha256; cv=none; b=AYo6/mt9rjarsFlngKhF4V50PCE9+0hWgbfqXnjTAulkivuAfh+m6pb45qTM42NnL9QLbs 91+4Uk74pqpFJBWADmOEQBcYpB0l34dpVCGafFG5XlsIHR3Pip6isQ81zu2x9/glpYfHfZ /1KBJpJDmXgvJ3PCVM/QHlEwe0m8e4ETZEgZWe+RjjXrZe5fQlBwNn7WuvsFt2QmNwi193 /INvASgdtkAKMj92gO5ikahVSlGmswtGJNMTiFwWy000J5Mbadn63YsvPT2qxXCYfyM+Fj 4SqsWdvk33zspcNeBq/0Md4mRQjUvcwdT7R6E30vvaXujuutoL5ewYgyr58AUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1708937425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RYf+EBraIeeMw1vJ9TyFPyMFwrUjyaOsWADv0N995hw=; b=1028aVvxq1ciij/IxW5wjKREsU78kRk7xKLsVmFch1Ozl/KpTyAq+47iAGhz3e4Gt+nELf R3UquFPDyL603EXL2GZT64IenwxPAnLpl/Qpqllg+Yvyew6V+SUVf1PZcSEAtK9ejY+lJ4 eOtQLLo0RcdihTsaRAj+Qnobr7+nfERCuFd6u/u+WiWT7/KSzljhKTcperF4NhTSUQUuk5 S/U9sPYUmtVjZuSCj1HD8KsDzXAn6iLsOuxmBeHTvi9iiVwKhwunKzQKgJLfxdNTFg2IXP tMz9dp3Scc3N+9cPDNGBG4nSblhxSIf+cjSr4670qyJCUdOwBZGzWdZPkGuayg== ARC-Authentication-Results: i=1; rspamd-55b4bfd7cb-plblw; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Stretch-Glossy: 67373c507a5e9866_1708937425449_3478876735 X-MC-Loop-Signature: 1708937425449:1179223423 X-MC-Ingress-Time: 1708937425449 Original-Received: from pdx1-sub0-mail-a236.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.116.14.46 (trex/6.9.2); Mon, 26 Feb 2024 08:50:25 +0000 Original-Received: from [10.179.6.34] (unknown [45.130.83.1]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a236.dreamhost.com (Postfix) with ESMTPSA id 4TjvTD4hWBz55; Mon, 26 Feb 2024 00:50:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1708937425; bh=RYf+EBraIeeMw1vJ9TyFPyMFwrUjyaOsWADv0N995hw=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=eEjwATRJAE58fGUIwkbaSgIRyBRZogeiE4YiPb5uEYrNUmboJxu/kRVx1+b2tCzVd FF/K4Nw53BNNthiwd+oVuzEn1RGgdIaqEEFu+QRPkjyobc+MtU8BVLP+e9SE/ru9SA IPTwL5OEvHY8Xwc2qQdEo5flTHfRKj1dh7Fd6SN763SB55svIm4oEqm6Rwf8W6zkl4 +JUfRUbOB0CXYGDll1BT+kvJIt92wd/j0CofBvN6sz0CcJy/0ge4g93syLtn13xVNn mmUZtpbnYkx5F9eW6653zuKjAJb3HXoG7RMyaVHNsk1dI1fTDSc8PWt8GzyMRs79sQ kWFAkwEsBUDqA== Content-Language: en-US In-Reply-To: <87wmqr7ikk.fsf@posteo.net> Received-SPF: neutral client-ip=23.83.212.48; envelope-from=adam@alphapapa.net; helo=dog.elm.relay.mailchannels.net X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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:316549 Archived-At: On 2/26/24 02:09, Philip Kaludercic wrote: > The pattern I usually use is something like this: > > (mapcan > (lambda (n) > (if (> n 0) (list n) nil)) > '(1 -2 5 0 -10 10)) > ;;=> (1 5 10) > > The idea is that when using `mapcan', you provide the cons-cells of the > resulting list, instead of having `mapcar' generate them for you and > then immediately discard them via `delq'. > > There should be a seq method for this pattern imo. Interesting, thanks. It looks like the performance of that technique is slightly better than (delq nil (mapcar ...)), but if performance is a concern, then it looks like one should use a loop: (benchmark-run-compiled 1000000 (mapcan (lambda (n) (if (> n 0) (list n) nil)) '(1 -2 5 0 -10 10))) ;; (0.21211651699999998 0 0.0) (benchmark-run-compiled 1000000 (delq nil (mapcar (lambda (n) (when (> n 0) n)) '(1 -2 5 0 -10 10)))) ;; (0.21806460800000002 0 0.0) (benchmark-run-compiled 1000000 (cl-loop for n in '(1 -2 5 0 -10 10) when (> n 0) collect n)) ;; (0.052528039 0 0.0) >>> Ah, the `t did confuse me momentarily, but in that case you can replace >>> the (guard ...) with (and 't (guard ...)). >> >> As much as I advocate using pcase and its powerful expressions, I >> think that would make this example harder to follow. The pcase >> pattern is used to test an argument, and the string test is a separate >> concern. > > But consider the saved indentation! Ok, I will. :) > My point is that there shouldn't be an overlap. I think a README > shouldn't contain too much detail, but serve as a signpost (suitable > both for online and offline (!) reading): "This is brief summary of what > you have found, the source code is hosted here, you can find the > documentation there, my contact information somewhere else, etc.", while > the package description gives a high level overview that doesn't have to > updated unless the entire idea of the package changes, while the > documentation goes into the nitty-gritty details. I understand what you're saying, but I think there is often value in having all of those categories of information in a single file, especially for smaller packages. It's similar to the experience of being able to quickly scan through a man page compared to having to page through an Info manual. >>>>> Also, your README includes this line >>>>> :vc (:fetcher github :repo "alphapapa/listen.el") >>>>> which is malformed. >>>> >>>> I just tested that, and it works for me. >>> On Emacs 30? That is not the code we merged... >> >> No, I'm using Emacs 29 with `vc-use-package'. Its documentation seems >> to suggest that it uses the same format as that merged into Emacs 30, >> since it says that its features were merged into Emacs 30. >> >> Maybe `vc-use-package's documentation should be updated to reflect this? > > Do you mean this: https://github.com/slotThe/vc-use-package? I have no > involvement with that project, but I don't see where they mention the > "fetcher" notation you mention. I see it in its readme under "Usage". >>>>> What you want is >>>>> :vc (:url "https://github.com/alphapapa/listen.el") >> >> Ok, so no ".git" on the end (i.e. relying on the GitHub redirect)? > > That doesn't matter (FWIW I didn't know either of the two was a redirect). > >> And does this mean that none of the host-specific "fetchers" are >> available in Emacs 30? (Which FTR is fine with me, as the URL should >> be enough, I'm just curious.) > > No, the package-vc extension for use-package uses the same package > specifications as package-vc? Sorry, I don't understand: "No, it doesn't mean that," or, "No, the fetchers are not available in Emacs 30"?