From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Xiyue Deng Newsgroups: gmane.emacs.bugs Subject: bug#67817: Acknowledgement (29.1; The "let*" subsection in "forward-paragraph" has no code sample) Date: Wed, 13 Dec 2023 16:19:17 -0800 Message-ID: <87a5qdab5m.fsf@debian-hx90.lan> References: <87h6klabkd.fsf@debian-hx90.lan> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37413"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: 67817@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 14 01:19:59 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rDZSJ-0009cO-52 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Dec 2023 01:19:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDZS7-0001ym-7v; Wed, 13 Dec 2023 19:19:47 -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 1rDZS6-0001ya-8c for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 19:19:46 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDZS5-00044X-UH for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 19:19:45 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDZSM-0007QZ-4n for bug-gnu-emacs@gnu.org; Wed, 13 Dec 2023 19:20:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Xiyue Deng Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Dec 2023 00:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67817 X-GNU-PR-Package: emacs Original-Received: via spool by 67817-submit@debbugs.gnu.org id=B67817.170251318728525 (code B ref 67817); Thu, 14 Dec 2023 00:20:02 +0000 Original-Received: (at 67817) by debbugs.gnu.org; 14 Dec 2023 00:19:47 +0000 Original-Received: from localhost ([127.0.0.1]:59879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDZS7-0007Q1-1b for submit@debbugs.gnu.org; Wed, 13 Dec 2023 19:19:47 -0500 Original-Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:42061) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDZS1-0007Pk-6y for 67817@debbugs.gnu.org; Wed, 13 Dec 2023 19:19:45 -0500 Original-Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6ceb93fb381so82668b3a.0 for <67817@debbugs.gnu.org>; Wed, 13 Dec 2023 16:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702513159; x=1703117959; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=QDoIM7OuxYgXRM3X1nI+3aATcvctCn0QRl19bSkd7hs=; b=KYYxco9EJs2VLdSsy8hiQDedjqaKqGbmJRO3yKAfa5Ld5MKTPI2uwG+Y+62glTWmdI S3wjJk3Ir+jx9CsGOd8UoTDBiK37esmC+1uq3HqE/IjtBYP17XSHXPVTz4Cn0+IQteGb dq9+dBZy/ZEUb47N6bLsKWcE9lEPaYw6VoI4ft98PaAVAsfK98McqseTcIJ4ms94ifxg jnaeS1L0y/CRwvN+cuSIjC8VOxen4XbW0kYrYXh/qzf4CxU9O6OLVOh4yX9zWsRzq7Ei wAEHUUgE9/RhffDUxDc09dyoL0B1dwzYleIEFDWez1NSKqdScJY+uw7bjzGXmrDz5TUe vFBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702513159; x=1703117959; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=QDoIM7OuxYgXRM3X1nI+3aATcvctCn0QRl19bSkd7hs=; b=Ts24r16sZts31dEO/YBYYQHyeY6av4/v9C5kmIss99pgnoa0iOo6fOxenxEPAR+n/8 TSYvuw19LTqo193lo/0bfAJxd/Os60NDNRTqE57ryeNtdMQ46FS7H8GIJloq2zk/eLIp iPOH9FZEFyORnISjwRJQfOCZ9vtiKdhRdWigAxy/45DlLUymN2/WLsxPH1U5M94ih+aQ 3gds/hPHzjvEb3UB6eE4xpmCdkScQ852F5GZbJXdlkpdJBvIXZfsazHwS47RXWSc2Ks6 QyTX6EgJBt9ho5IG3wtTTSlkRVEv2OXnzDBNN3jaECDD7m8/PkJXs0XutrxpyAWyPN8/ wImw== X-Gm-Message-State: AOJu0YwF0K2rhep7iDFUfmVhR7guY2MOQbgpGy8A/mz0Bs+EOw+gmNZS UndRP8xYC4pwh6FRlF4BwBXy1Z6OzSs= X-Google-Smtp-Source: AGHT+IG6yWcF1O6GeE7D/2GiHIq/6sFFq0UD6yRmapgVqcDbqtD77MO1B/OgW4C8h7f/ktWe0lR6wA== X-Received: by 2002:a05:6a00:464b:b0:68f:a92a:8509 with SMTP id kp11-20020a056a00464b00b0068fa92a8509mr13228697pfb.7.1702513158522; Wed, 13 Dec 2023 16:19:18 -0800 (PST) Original-Received: from debian-hx90 (2603-8000-a400-0cdc-a140-91c8-a663-be4a.res6.spectrum.com. [2603:8000:a400:cdc:a140:91c8:a663:be4a]) by smtp.gmail.com with ESMTPSA id v10-20020a65568a000000b005bd3f34b10dsm9028983pgs.24.2023.12.13.16.19.17 for <67817@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 16:19:18 -0800 (PST) In-Reply-To: (GNU bug Tracking System's message of "Thu, 14 Dec 2023 00:12:02 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276161 Archived-At: --=-=-= Content-Type: text/plain Tentative patch to add sample code attached. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Add-sample-code-to-the-let-section-in-forward-paragr.patch >From 11f6cc8d1caac44cdda9588617cbd302d2ab35b5 Mon Sep 17 00:00:00 2001 From: Xiyue Deng Date: Wed, 13 Dec 2023 13:38:55 -0800 Subject: [PATCH] Add sample code to the "let*" section in "forward-paragraph" (bug#67817) * doc/lispintro/emacs-lisp-intro.texi (fwd-para let): add code sample. --- doc/lispintro/emacs-lisp-intro.texi | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index eb8ff413b79..29309502c90 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -12882,7 +12882,40 @@ The next line of the @code{forward-paragraph} function begins a introduced}), in which Emacs binds a total of seven variables: @code{opoint}, @code{fill-prefix-regexp}, @code{parstart}, @code{parsep}, @code{sp-parstart}, @code{start}, and -@code{found-start}. +@code{found-start}. The first part of the @code{let*} expression +looks like below: + +@smallexample +@group +(let* ((opoint (point)) + (fill-prefix-regexp + (and fill-prefix (not (equal fill-prefix "")) + (not paragraph-ignore-fill-prefix) + (regexp-quote fill-prefix))) + ;; Remove ^ from paragraph-start and paragraph-sep if they are there. + ;; These regexps shouldn't be anchored, because we look for them + ;; starting at the left-margin. This allows paragraph commands to + ;; work normally with indented text. + ;; This hack will not find problem cases like "whatever\\|^something". + (parstart (if (and (not (equal "" paragraph-start)) + (equal ?^ (aref paragraph-start 0))) + (substring paragraph-start 1) + paragraph-start)) + (parsep (if (and (not (equal "" paragraph-separate)) + (equal ?^ (aref paragraph-separate 0))) + (substring paragraph-separate 1) + paragraph-separate)) + (parsep + (if fill-prefix-regexp + (concat parsep "\\|" + fill-prefix-regexp "[ \t]*$") + parsep)) + ;; This is used for searching. + (sp-parstart (concat "^[ \t]*\\(?:" parstart "\\|" parsep "\\)")) + start found-start) + ...) +@end group +@end smallexample The variable @code{parsep} appears twice, first, to remove instances of @samp{^}, and second, to handle fill prefixes. -- 2.39.2 --=-=-= Content-Type: text/plain -- Xiyue Deng --=-=-=--