From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton via "Emacs development discussions." Newsgroups: gmane.emacs.devel Subject: Re: New for GNU ELPA: literate-scratch Date: Thu, 20 Jun 2024 13:37:29 +0800 Message-ID: <87msngi38m.fsf@melete.silentflame.com> References: <87ed96wtkr.fsf@melete.silentflame.com> <87sexemjsm.fsf@posteo.net> <87bk3xvej9.fsf@melete.silentflame.com> <87le31a3lj.fsf@posteo.net> Reply-To: Sean Whitton Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9297"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Sean Whitton via "Emacs development discussions." To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 20 07:38:27 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 1sKAV9-0002Ct-2h for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Jun 2024 07:38:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKAUN-000486-Q6; Thu, 20 Jun 2024 01:37:39 -0400 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 1sKAUM-00047y-IK for emacs-devel@gnu.org; Thu, 20 Jun 2024 01:37:38 -0400 Original-Received: from sendmail.purelymail.com ([34.202.193.197]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKAUL-0000lG-1V for emacs-devel@gnu.org; Thu, 20 Jun 2024 01:37:38 -0400 DKIM-Signature: a=rsa-sha256; b=kKltpY9ccnLcuNIiQTWctWS/b9B7nRk1xw1x5XKhKhsFXm+FAjsz1sf2eJ2vf4zsvjWYgkdPaAbhFnOFSbEuCsv0l6+oyjUB0WeTT9Fx7yYV5Zppqy6MrjytnRDvriqakkHRBgjaI5rwgXDoEmBE3oOL/4DWuLPzFQhoE2B7kCvUNKdkLL3HWz40pwj0D3yvs2XgK1QTGuIIYQ5MITFOh8ByzJ/kiglnkwPnfYe89Czac5AYRafcBW75pthf9UYHTmKhh1NbplRR1ubkICojuctDkzhVHxMIiI53mFQYeUMnJkplrKEj1IdvuR6iFW7XtIGtIesZVgED1eTbuOjPcQ==; s=purelymail2; d=spwhitton.name; v=1; bh=fCxa1/LndztDslt4KXNT9BZtlCCy6jU8jt0/dHKzLmw=; h=Received:Received:From:To:Subject:Date; DKIM-Signature: a=rsa-sha256; b=mH0oTMtVEH/ghaM13Z9f6MEjTc/IROQ+C7LPe+lz/8in7M6w0Yy/CotKeVuY5QD/N0S8Aw9HfzqtcJbp0zKpEbYuJ6hE2X9IY/PItXHuHofV72FokDSHzM7hhCs0GgIka9R06yA24DNmP1zlv1c5yKr5R2Lsz5OmJuLw6pIGgFfIDRgIGoizkXtcU8l9JBFhEDLpbWpnC0S36UCaJ7DQuO2rw11n0YIPrwxPBhK3TXt0f1+kd4NUw1xiDkRds0+Mk38XwPdZQXJTaWBNMSSLvB4UrKZKhFjJ0gAz9dS56Vej3I8qInSYvhzz7d8cleMOCkPgIRToFwpYN2qXVjvrgw==; s=purelymail2; d=purelymail.com; v=1; bh=fCxa1/LndztDslt4KXNT9BZtlCCy6jU8jt0/dHKzLmw=; h=Feedback-ID:Received:Received:From:To:Subject:Date; Feedback-ID: 20115:3760:null:purelymail X-Pm-Original-To: emacs-devel@gnu.org Original-Received: by smtp.purelymail.com (Purelymail SMTP) with ESMTPSA id 673817890; (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Thu, 20 Jun 2024 05:37:34 +0000 (UTC) Original-Received: by melete.silentflame.com (Postfix, from userid 1000) id AF6727EC296; Thu, 20 Jun 2024 13:37:29 +0800 (CST) In-Reply-To: <87le31a3lj.fsf@posteo.net> (Philip Kaludercic's message of "Wed, 19 Jun 2024 05:44:40 +0000") Received-SPF: pass client-ip=34.202.193.197; envelope-from=spwhitton@spwhitton.name; helo=sendmail.purelymail.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, SPF_HELO_PASS=-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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320307 Archived-At: Hello, On Wed 19 Jun 2024 at 05:44am GMT, Philip Kaludercic wrote: > Sean Whitton writes: > >> Hello, >> >> On Sat 15 Jun 2024 at 01:12pm GMT, Philip Kaludercic wrote: >> >>>> ;;; Code: >>>> >>>> (defun literate-scratch--extend (start end) >>>> (save-excursion >>>> (let ((res1 >>>> (and (goto-char start) >>>> (not (looking-at paragraph-separate)) >>>> (and-let* ((new (car (bounds-of-thing-at-point 'paragraph)))) >>>> (and (< new start) >>>> (setq start new))))) >>> >>> You should be able to merge the `and-let*' and `and' like >>> >>> --8<---------------cut here---------------start------------->8--- >>> (and-let* ((new (car (bounds-of-thing-at-point 'paragraph))) >>> ((< new start))) >>> (setq start new)) >>> --8<---------------cut here---------------end--------------->8--- >> >> Very interesting! >> This seems to be undocumented behaviour of the macro, though? >> I don't think I can see anything which implies it in the docstring. > > Apparently so? I thought it was documented under if-let* or when-let*, > but I couldn't find anything myself either. BTW., an alternative is to > bind the symbol `_', which will also discard the value/bind it to a > fresh variable. Thanks. Tbh I am not sure the * versions of the macros should support this, feels a bit too far away from ordinary 'let'. (Common Lisp's when-let and if-let don't have this feature, at least the most popular implementation, in Alexandria.) -- Sean Whitton