all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: John Hagerman <John.Hagerman@synopsys.com>,
	Lars Ingebrigtsen <larsi@gnus.org>
Cc: 54128@debbugs.gnu.org, acm@muc.de
Subject: bug#54128: 27.2; c-paragraph-* variables not sufficiently documented
Date: Sat, 26 Feb 2022 16:59:45 +0000	[thread overview]
Message-ID: <YhpcgYS6MadX3U1M@ACM> (raw)
In-Reply-To: <DM6PR12MB55504D5C2C67466B1351A0BAAC3C9@DM6PR12MB5550.namprd12.prod.outlook.com>

Hello, John and Lars.

On Wed, Feb 23, 2022 at 16:01:59 +0000, John Hagerman wrote:
> [Sent manually because sending from Emacs didn't work.]


> Save this as file "comment.c" (*.c as C-mode is important):
> ---8<---
> // \details
> // I want the previous line to be untouched by c-fill-paragraph.
> --->8---

> Dribble file:
> \x06comment.c<return><escape>q<escape>:(setq c-paragraph-separate "$\\|// \\\\[a-z]+$")<return><escape>:(c-setup-paragraph-variables)<return><escape>q

> Summary of actions:
> + Read comment.c; C-mode is entered.
> + Move down one line and do c-fill-paragraph: the two lines are merged
> + Undo to revert to original two lines
> + Set c-paragraph-separate and update the C-mode variables
> + Do c-fill-paragraph again; this time the two lines are not merged

> There is nothing wrong with these actions!  The bug is only about the
> c-paragraph-* variable documentation.

> The Bug:
> The documentation for c-paragraph-separate and c-paragraph-start should
> describe the fact that they must begin with "$\\|" to work properly.

Forgive me, it is nearly 20 years since I constructed these variables;
why is the "$\\|" necessary?  What happened when you tried to construct
a regular expression without it?

> Details:
> // Upon entering C-mode, the value of c-paragraph-separate is "$".
> //
> // \details
> // I want the previous line to be untouched by c-fill-paragraph.
> // With c-paragraph-separate being "$", that line will be included
> // in a paragraph fill.  So: I want lines matching "^// \\\\[a-z]+$"
> // to stand alone.  I will modify c-paragraph-separate to get this.
> //
> // As always, fill-paragraph regexps do not start with "^".  After a
> // fair amount of work I found that custom c-paragraph-separate (and
> // c-paragraph-start) must begin with "$\\|" to work properly.  So I
> // do this:
> // (setq c-paragraph-separate "$\\|// \\\\[a-z]+$")
> // (c-setup-paragraph-variables)
> //
> // This bug report is about the fact that c-paragraph-separate and
> // c-paragraph-start must begin with "$\\|".  Ideally that would be
> // fixed.  But at the least this fact should be described in the
> // variables' documentation.


> In GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.15.12)
>  of 2021-06-11 built on depbldcs73
> Windowing system distributor 'TigerVNC', version 11.0.11400000
> System Description: CentOS Linux 7 (Core)

-- 
Alan Mackenzie (Nuremberg, Germany).





      parent reply	other threads:[~2022-02-26 16:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 16:01 bug#54128: 27.2; c-paragraph-* variables not sufficiently documented John Hagerman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-23 20:04 ` Lars Ingebrigtsen
2022-02-26 16:59 ` Alan Mackenzie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YhpcgYS6MadX3U1M@ACM \
    --to=acm@muc.de \
    --cc=54128@debbugs.gnu.org \
    --cc=John.Hagerman@synopsys.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.