Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp867280pxu; Wed, 7 Oct 2020 19:17:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYunwr8ZDF3Wz+eALJH6lIAU6Zv0ztqhP9W9EwxBfdplu1aKnVqzSuJuRogTu8EEUy4uhs X-Received: by 2002:a17:906:2850:: with SMTP id s16mr5712774ejc.276.1602123468912; Wed, 07 Oct 2020 19:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602123468; cv=none; d=google.com; s=arc-20160816; b=Pt7H1NYAGOpwtLDfl3V/dJ8hhIBuAfvnC89sKGYbidFApPatRhI6kXFdoq4FKVMncz YC5JqAAOD7pbS2keAk2r1cxZ53MHyTWCKpJZL2KecVKM84cRad4LjE11os0yDFTUZp/t K263ci3vhhMfh9R9IQap/wD9kCDo2M6NEQ09EMd9rFAcZyWVu1zJ25vVmJt3B/dQ7fA1 u7QFfSK+hh+tTHLmnXIqDWkjqiCBXl3yYfWsq/Th9KMMBteN0E1sREm11h9fA0g2o89Y u3yX5vLIMjCmw8hTZ9tlICFAyULKbhq2xNu0jqj3Hj9SoRm/zOniK4Qi+OeWgpaXnU2j GZMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=B1wAESJVuS+GsSF9/mSAS6lCbLjALb6I1zRkvEvPt2o=; b=Qrt+CDFw4+ZIIjVWAQvMOWzIhI9FOZ5nkFvxKinDzOSaqDJx4Ri72+1DUE8daxpM/D IWaBBKHGalKE2FaJLd0p3D+nkevAVYb3z9trQVElUqspgDQFIK7nJpAGiHAqA5TFcSXa mZzEEj4ea+hKb2cB9pdvdYaKLOyS+294xH2NQQ3QAjGpLH4Q7R2tBhwX9D1dSHyhBSbf y4rFTmQWxdqziQh3Gjtr0E28muxJ5yBZycqleKOHAtBWppzsbeSPVNCziJiZ6a4a4r7M D2WmOsXBzyPXmcKiPCpbojQ7DiHkBrdNVraY1i5nF5bwbA8TjWo4k3F3NFzdp68KW9zg 26gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=FzTwjWcD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si2666858edr.141.2020.10.07.19.17.25; Wed, 07 Oct 2020 19:17:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=FzTwjWcD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727605AbgJHCPf (ORCPT + 99 others); Wed, 7 Oct 2020 22:15:35 -0400 Received: from mail1.protonmail.ch ([185.70.40.18]:37828 "EHLO mail1.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727345AbgJHCPf (ORCPT ); Wed, 7 Oct 2020 22:15:35 -0400 Date: Thu, 08 Oct 2020 02:15:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1602123332; bh=B1wAESJVuS+GsSF9/mSAS6lCbLjALb6I1zRkvEvPt2o=; h=Date:To:From:Cc:Reply-To:Subject:From; b=FzTwjWcDKbLTkEyoxW0ckGM3jACHqyEfAW/3pyqXtqgeIc86XlUFSzyMF6qk/Y2SU m7/CkHVgILUYKEDQwFFltk0vDnnaUDB5UIigYgntTlRi5OWs42caV1eTrIjt1uYl4D XKrP+qM6FifHAVUtJFDZ7fzNTLT0+mfyrOfHi47M= To: Matthew Wilcox From: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Cc: Jonathan Corbet , Mauro Carvalho Chehab , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, lkcamp@lists.libreplanetbr.org, andrealmeid@collabora.com Reply-To: =?utf-8?Q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Subject: Re: [PATCH] docs: Make automarkup ready for Sphinx 3.1+ Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed Oct 7, 2020 at 8:40 PM -03, Matthew Wilcox wrote: > > On Wed, Oct 07, 2020 at 11:12:25PM +0000, N=C3=ADcolas F. R. A. Prado wro= te: > > While Sphinx 2 used a single c:type role for struct, union, enum and > > typedef, Sphinx 3 uses a specific role for each one. > > To keep backward compatibility, detect the Sphinx version and use the > > correct roles for that version. > > > > Also, Sphinx 3 is more strict with its C domain and generated warnings, > > exposing issues in the parsing. > > To fix the warnings, make the C regexes use ASCII, ensure the > > expressions only match the beginning of words and skip trying to > > cross-reference C reserved words. > > Thank you for doing this! > > I have a feature request ... could you automarkup NULL as being > :c:macro? > Or maybe just anything matching \<[[:upper:]_[:digit:]]*\> > (i may have my regex syntax confused ... a word composed of any > arrangement of upper-case, digits and underscores.) I think what you are suggesting are two separate things. For NULL, what you're interested in is that it appears in a monospaced font= , as if written ``NULL``, right? As I don't think a cross-reference to "the NULL macro definition" would make much sense. While "anything containing only upper-case, digits and underscores" would actually be for cross-referencing to the definition of the macro symbol in question, right? At the moment, this automarkup script is being used only for cross-referenc= ing, but it is indeed a generic automarkup script, and could be used for the formatting of NULL. But we also can't just make every upper-case word writ= ten in monospaced font, as that doesn't always makes sense. So if I understood your two requests correctly, I think we could: 1. Always automatically format NULL using a literal ``. 2. Try to cross-reference every upper-case word with the macro definition u= sing :c:macro, but if the cross-reference doesn't exist, format it normally, sin= ce it's just normal text (this is what we're doing for C references at the mom= ent). What do you think? Thanks, N=C3=ADcolas