public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 3/7] **/*.texi: Reorder index entries
Date: Thu, 23 Feb 2023 09:44:57 +0100	[thread overview]
Message-ID: <86pma0kbn1.fsf@aarsen.me> (raw)
In-Reply-To: <874jrc94yg.fsf@euler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 3957 bytes --]

Hi Thomas,

Thomas Schwinge <thomas@codesourcery.com> writes:

> Hi!
>
> On 2023-01-27T01:18:31+0100, Arsen Arsenović via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
>> Much like the previous commit, this change is mostly mechanical
>
> I find it helpful to see in the Git commit log some kind of rationale,
> instead of just the almost-useless GNU ChangeLog snippets.  ;-)

Yes, fair enough.  I forget that many will lack the lots of out-of-band
context that went into this change.  I'll push relevant amendments to my
repository.

>> with a
>> simple script.  I have, however, gone over the patch myself also, to see
>> if there's anything that ought to be kept as-is.
>
> Assuming that the script is safe to run automatically (no manual
> intervention necessary), I wonder: should that go into the GCC test suite
> (say, like 'gcc.src/maintainers.exp') or GCC build process (say, like
> 'gcc/Makefile.in:s-tm-texi'), to make sure that we're not regressing this
> again?

The script I wrote is a bit too dumb (there are, for instance, a few
hunks which I manually revert after running the script, because they
relate to comments, for instance), which is also why I skipped the Ada
manuals (the script would reformat a lot of code that is semantically
correct in terms of the problem this patchset is meant to be
addressing).  I was considering adding a warning to makeinfo to detect
when indices are placed in "odd" positions, such as on the ends of
paragraphs, in order to detect these errors; I haven't had the
opportunity to do that yet, though.

I do agree that it'd be nice to automatically detect this.

>> Formatter:
>>
>>   # GPL3+
>>   use v5.35;
>>   use strict;
>>   use warnings;
>>
>>   my @lineq = ();
>>   my @itemq = ();
>>   my @indxq = ();
>>   my $lstin = 0;
>>
>>   while (<>)
>>     {
>>       push (@lineq, $_);
>>       if (/^\@[a-zA-Z0-9]{1,2}index\W/)
>>         {
>>           $lstin = @lineq;
>>           push (@indxq, $_);
>>           next;
>>         }
>>       if (/^\@itemx?\W/)
>>         {
>>           $lstin = @lineq;
>>           push (@itemq, $_);
>>           next;
>>         }
>>       next if $lstin && /^\s*(\@c(omment)?\W.*)?$/;
>>
>>       if (@indxq and @itemq)
>>         {
>>           print @indxq;
>>           print @itemq;
>>           print @lineq[$lstin..@lineq-1];
>>         }
>>       else
>>         {
>>           print @lineq;
>>         }
>>       @lineq = ();
>>       @itemq = ();
>>       @indxq = ();
>>       $lstin = 0;
>>     }
>>
>>   if (@indxq and @itemq)
>>     {
>>       print @indxq;
>>       print @itemq;
>>       print @lineq[$lstin..@lineq-1];
>>     }
>>   else
>>     {
>>       print @lineq;
>>     }
>>
>>   # Local Variables:
>>   # indent-tabs-mode: nil
>>   # End:
>
>
> Grüße
>  Thomas
>
>
>> gcc/d/ChangeLog:
>>
>>       * implement-d.texi: Reorder index entries around @items.
>> [...]
>
>> --- a/gcc/d/implement-d.texi
>> +++ b/gcc/d/implement-d.texi
>> @@ -126,11 +126,11 @@ The following attributes are supported on most targets.
>>
>>  @table @code
>>
>> +@cindex @code{alloc_size} function attribute
>> +@cindex @code{alloc_size} variable attribute
>>  @item @@(gcc.attributes.alloc_size (@var{sizeArgIdx}))
>>  @itemx @@(gcc.attributes.alloc_size (@var{sizeArgIdx}, @var{numArgIdx}))
>>  @itemx @@(gcc.attributes.alloc_size (@var{sizeArgIdx}, @var{numArgIdx}, @var{zeroBasedNumbering}))
>> -@cindex @code{alloc_size} function attribute
>> -@cindex @code{alloc_size} variable attribute
>>
>>[...]
> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634
> München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas
> Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht
> München, HRB 106955

Thanks, have a lovely day.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

  reply	other threads:[~2023-02-23  8:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27  0:18 [PATCH+wwwdocs 0/8] A small Texinfo refinement Arsen Arsenović
2023-01-27  0:18 ` [PATCH 1/7] docs: Create Indices appendix Arsen Arsenović
2023-01-27  0:18 ` [PATCH 2/7] docs: Reorder @opindex to be before corresponding options Arsen Arsenović
2023-01-27  0:18 ` [PATCH 3/7] **/*.texi: Reorder index entries Arsen Arsenović
2023-01-27 10:41   ` Iain Buclaw
2023-02-23  0:58   ` Gerald Pfeifer
2023-02-23  9:25     ` (rebased patchset) " Arsen Arsenović
2023-02-23  8:11   ` Thomas Schwinge
2023-02-23  8:44     ` Arsen Arsenović [this message]
2023-01-27  0:18 ` [PATCH 4/7] docs: Mechanically reorder item/index combos in extend.texi Arsen Arsenović
2023-01-27  0:18 ` [PATCH 5/7] doc: Add @defbuiltin family of helpers, set documentlanguage Arsen Arsenović
2023-01-27  0:18 ` [PATCH 6/7] Update texinfo.tex, remove the @gol macro/alias Arsen Arsenović
2023-01-27  0:18 ` [PATCH 7/7] update_web_docs_git: Update CSS reference to new manual CSS Arsen Arsenović
2023-01-27  0:18 ` [wwwdocs] Add revised Texinfo " Arsen Arsenović
2023-02-24  0:26   ` Gerald Pfeifer
2023-02-24  6:41     ` Arsen Arsenović
2023-01-27 12:02 ` [PATCH+wwwdocs 0/8] A small Texinfo refinement Arsen Arsenović
2023-02-23  1:13   ` Gerald Pfeifer
2023-02-13 18:51 ` Ping: " Arsen Arsenović
2023-02-21 14:59   ` Ping^2: " Arsen Arsenović
2023-02-23  1:26     ` Gerald Pfeifer
2023-02-23 17:59       ` Sandra Loosemore

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=86pma0kbn1.fsf@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=thomas@codesourcery.com \
    /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.
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).