From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 1F6B73857C43 for ; Tue, 20 Oct 2020 10:36:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1F6B73857C43 Received: by mail-wm1-x332.google.com with SMTP id d3so1299101wma.4 for ; Tue, 20 Oct 2020 03:36:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zmz7ARG9qYk0/1wLXXWsO6q4BiLlUIegJmGZ4fU3k/U=; b=pgYWY8VmHzswEszaHpq4MfAHMFdiH7VrplJqUAOjQzKk5HZqeZ1vZxkDvA1Gz3ktRQ TUrQvJnffFBIFoZc30ckf0b+i/5abfwzmHLrHHSjeKrRsL1PgAENTfAy+Na5RZOF4IPa B9BOUbxGdbpNR6vDe6OuyWaxohb81Knjts2NDfuRN8OKLnHHlfICCD+9tEYaVvXsJQGb Ip8l7CDJVz7DUyfXZIUEA48a0xC8vq1/3gouEQZouiXnZLe2lOQS8/eMm3Qcuz9d2bW3 wFG3t8Dl2gky44QyzspiTzXwwGCBaOE8Hjpj/ZQ4Z2eK5g2e7wrCgKgYR4BnLNVdoN77 /Lvg== X-Gm-Message-State: AOAM530LHKW8KdD6fkj5M/WUEakF4yauhYvHMAH1n7JuOQ/rhp/wNKZM L9uGOcUMgQqVVI3aGlrv3bno2i/9ylM= X-Google-Smtp-Source: ABdhPJzwvSQKmrDun1lXdFs5tyhqc6n+bB54tQc00XCXHsKFb42NVXVASstTQCM2bC+8rBg1ICI0xw== X-Received: by 2002:a1c:e309:: with SMTP id a9mr2340869wmh.90.1603190181806; Tue, 20 Oct 2020 03:36:21 -0700 (PDT) Received: from [192.168.1.143] ([170.253.60.68]) by smtp.gmail.com with ESMTPSA id l3sm2494933wmg.32.2020.10.20.03.36.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Oct 2020 03:36:21 -0700 (PDT) Subject: Re: queue.3 overhaul To: mtk.manpages@gmail.com Cc: linux-man , "libc-alpha@sourceware.org" References: <33af3ca2-d6ea-5f75-6ad2-e2f43eefe4fa@gmail.com> From: Alejandro Colomar Message-ID: <907cf2f7-70de-42c3-a738-d7e6a14327de@gmail.com> Date: Tue, 20 Oct 2020 12:36:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2020 10:36:32 -0000 Hi Michael, On 2020-10-20 06:08, Michael Kerrisk (man-pages) wrote: > Hi Alex, > > On Mon, 19 Oct 2020 at 17:29, Alejandro Colomar wrote: >> >> Hi Michael, >> >> >> I'm working on moving and fixing code from queue.3 to different pages. >> >> I'd like to send you patches against a separate branch, >> if you would create one, to ask you some questions from time to time, >> and maybe get suggestions. >> >> Or maybe you could look at my branch on github >> (https://github.com/alejandro-colomar/man-pages/commits/queue >> (I may force push changes there sometimes)) > > I created a remote to remote to track your work. But you'll need to > ping me from time to tell me to take a look. Also, I think mail to > this list to discuss directions (as you are now doing) is great. > >> (BTW, if you have a look there, >> you can see how I'm moving&fixing the code from queue.3 >> to the other pages and maybe suggest a different way). > > This looks okay in principle. > >> Or maybe I can just show you small pieces of code (no patches), >> like in this email. >> >> Whatever works best for you. > > Both ;-) Fine :-) > > But, I find the indentation confusing actually. When I see pieces such as > > int LIST_EMPTY(LIST_HEAD *head); > LIST_ENTRY(TYPE); > > It visually looks to me as though the LIST_ENTRY piece is some > extension of the LIST_EMPTY pest. Agreed. > > I think it's best not to do horizontal indentation, but instead just > use of vertical separation (.PP). We can perhaps revisit this later, > to see if we can come up with something better. Okay, I changed it to use vertical separation (as the original one did). Now the output is the following (I think the SYNOPSIS already looks good, and I'll move to the DESCRIPTION): [[ LIST(3) Linux Programmer's Manual LIST(3) NAME LIST_EMPTY, LIST_ENTRY, LIST_FIRST, LIST_FOREACH, LIST_HEAD, LIST_HEAD_INITIALIZER, LIST_INIT, LIST_INSERT_AFTER, LIST_INSERT_BE- FORE, LIST_INSERT_HEAD, LIST_NEXT, LIST_PREV, LIST_REMOVE - implementa- tion of a doubly-linked list SYNOPSIS #include int LIST_EMPTY(LIST_HEAD *head); LIST_ENTRY(TYPE); LIST_ENTRY *LIST_FIRST(LIST_HEAD *head); LIST_FOREACH(TYPE *var, LIST_HEAD *head, LIST_ENTRY NAME); LIST_HEAD(HEADNAME, TYPE); LIST_HEAD LIST_HEAD_INITIALIZER(LIST_HEAD head); void LIST_INIT(LIST_HEAD *head); void LIST_INSERT_AFTER(TYPE *listelm, TYPE *elm, LIST_ENTRY NAME); void LIST_INSERT_BEFORE(TYPE *listelm, TYPE *elm, LIST_ENTRY NAME); void LIST_INSERT_HEAD(LIST_HEAD *head, TYPE *elm, LIST_ENTRY NAME); LIST_ENTRY *LIST_NEXT(TYPE *elm, LIST_ENTRY NAME); void LIST_REMOVE(TYPE *elm, LIST_ENTRY NAME); ]] The code for NAME and SYNOPSIS, which are the sections that are ready in list.3, is the following: [[ .TH LIST 3 2020-10-19 "GNU" "Linux Programmer's Manual" .SH NAME LIST_EMPTY, LIST_ENTRY, LIST_FIRST, LIST_FOREACH, .\"LIST_FOREACH_FROM, .\"LIST_FOREACH_SAFE, .\"LIST_FOREACH_FROM_SAFE, LIST_HEAD, LIST_HEAD_INITIALIZER, LIST_INIT, LIST_INSERT_AFTER, LIST_INSERT_BEFORE, LIST_INSERT_HEAD, LIST_NEXT, LIST_PREV, LIST_REMOVE .\"LIST_SWAP \- implementation of a doubly-linked list .SH SYNOPSIS .nf .B #include .PP .BI "int LIST_EMPTY(LIST_HEAD *" head ");" .PP .B "LIST_ENTRY(TYPE);" .PP .BI "LIST_ENTRY *LIST_FIRST(LIST_HEAD *" head ");" .PP .BI "LIST_FOREACH(TYPE *" var ", LIST_HEAD *" head ", LIST_ENTRY " NAME ");" .\".PP .\".BI "LIST_FOREACH_FROM(TYPE *" var ", LIST_HEAD *" head ", LIST_ENTRY " NAME ");" .\".PP .\".BI "LIST_FOREACH_SAFE(TYPE *" var ", LIST_HEAD *" head ", LIST_ENTRY " NAME ", TYPE *" temp_var ");" .\".PP .\".BI "LIST_FOREACH_FROM_SAFE(TYPE *" var ", LIST_HEAD *" head ", LIST_ENTRY " NAME ", TYPE *" temp_var ");" .PP .B "LIST_HEAD(HEADNAME, TYPE);" .PP .BI "LIST_HEAD LIST_HEAD_INITIALIZER(LIST_HEAD " head ");" .PP .BI "void LIST_INIT(LIST_HEAD *" head ");" .PP .BI "void LIST_INSERT_AFTER(TYPE *" listelm ", TYPE *" elm ", LIST_ENTRY " NAME ");" .PP .BI "void LIST_INSERT_BEFORE(TYPE *" listelm ", TYPE *" elm ", LIST_ENTRY " NAME ");" .PP .BI "void LIST_INSERT_HEAD(LIST_HEAD *" head ", TYPE *" elm ", LIST_ENTRY " NAME ");" .PP .BI "LIST_ENTRY *LIST_NEXT(TYPE *" elm ", LIST_ENTRY " NAME ");" .\".PP .\".BI "LIST_ENTRY LIST_PREV(TYPE *" elm ", LIST_HEAD *" head ", TYPE, LIST_ENTRY " NAME ");" .PP .BI "void LIST_REMOVE(TYPE *" elm ", LIST_ENTRY " NAME ");" .\".PP .\".BI "void LIST_SWAP(LIST_HEAD *" head1 ", LIST_HEAD *" head2 ", TYPE, LIST_ENTRY " NAME ");" .fi ]] I'll continue working on other sections; please tell me if you find anything that could be improved. I'll work on list.3 only, so that we then have a pattern for the rest. Also, this way they can be merged to master separately, resulting in shorter patchsets and times. Cheers, Alex