unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>
Cc: lisa-asket@perso.be, 49558@debbugs.gnu.org
Subject: bug#49558: fill paragraph in texinfo-mode fails with @
Date: Wed, 14 Jul 2021 15:01:18 +0300	[thread overview]
Message-ID: <83im1d85pt.fsf@gnu.org> (raw)
In-Reply-To: <87h7gxmj5s.fsf@gnus.org> (message from Lars Ingebrigtsen on Wed,  14 Jul 2021 09:47:11 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Wed, 14 Jul 2021 09:47:11 +0200
> Cc: 49558@debbugs.gnu.org
> 
> lisa-asket@perso.be writes:
> 
> > I am using `M-q` to fill my paragraphs.  I have noticed that in texinfo-mode,
> > doing `M-q` on a paragraph starting with `@` does not refill the paragraph.
> >
> > This occurs in instances such as
> >
> > @noindent Everyone is permitted to copy and distribute verbatim
> > copies of this license document, but changing it is not allowed.
> 
> This is because texinfo-mode regards almost any line that starts with a
> @ as a paragraph separator, so forward-paragraph etc doesn't work
> properly on those lines.

I actually think this is a "feature" in Texinfo mode.  In Texinfo, we
have constructs that start with @ at BOL which we don't _want_ to
refill, and we _do_ want them to be treated as a separate paragraph.
A few examples:

@node Foo Bar Baz Quux Very Long Node Name

@subsection This is a very long subsection name

@cindex a very long index entry that could wrap

@defun my-func with many different arguments that could wrap

@end multitable

And I could probably come up with a few more.  So @noindent is more an
exception that the rule, and there actually is no reason to have any
text after it on the same line, you could leave it on a line by itself
without losing anything.

> The following patch fixes the problem, but I'm not sure this is the
> correct thing, but the manual says:
> 
> --
> Lines that start a new paragraph and are
> contained in it must match only ‘paragraph-start’, not
> ‘paragraph-separate’. 
> --

I never took this seriously.  E.g., even our default values of these
variables don't seem to heed this rule.

Stefan, any comments?

> So I think it is?  But this code has been basically like this for
> decades...  anybody got any comments about why it is like it is today?

See above.  I'd prefer not to change these variables in Texinfo, as it
could cause more trouble than it fixes.  If we want the likes of
@noindent to be exempt from this treatment of lines that begin with @,
we could perhaps introduce a fill-paragraph-function specific for
Texinfo, and in that function treat ^@noindent (and perhaps a few
more directives) specially.





  reply	other threads:[~2021-07-14 12:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-14  3:57 bug#49558: fill paragraph in texinfo-mode fails with @ lisa-asket
2021-07-14  7:47 ` Lars Ingebrigtsen
2021-07-14 12:01   ` Eli Zaretskii [this message]
2021-07-14 12:59     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-14 13:11       ` Eli Zaretskii
2021-07-14 13:49         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-07-14 14:03           ` Eli Zaretskii
2021-07-14 13:00     ` Lars Ingebrigtsen
2021-07-14 13:13       ` Eli Zaretskii
2021-07-14 13:15         ` Lars Ingebrigtsen
2021-07-14 13:22           ` Eli Zaretskii
2021-07-14 13:53             ` Lars Ingebrigtsen
2021-07-14 14:07               ` Eli Zaretskii
2021-07-14 14:29                 ` Lars Ingebrigtsen
2021-11-07 22:58                 ` Lars Ingebrigtsen
2021-07-14 13:55       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83im1d85pt.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=49558@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=lisa-asket@perso.be \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).