From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Rewriting make-docfile.c in Lisp? Date: Thu, 06 May 2021 11:45:53 +0300 Message-ID: <83sg30dzcu.fsf@gnu.org> References: <87zgx9rx7w.fsf@catern.com> <83bl9p2m6s.fsf@gnu.org> <87v97xrurb.fsf@catern.com> <87r1ilrpnt.fsf@catern.com> <87mtt8sx77.fsf@catern.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14205"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Spencer Baugh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 06 10:47:45 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1leZfd-0003aQ-AL for ged-emacs-devel@m.gmane-mx.org; Thu, 06 May 2021 10:47:45 +0200 Original-Received: from localhost ([::1]:47032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leZfc-00056a-CY for ged-emacs-devel@m.gmane-mx.org; Thu, 06 May 2021 04:47:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leZe2-0004Rt-Ut for emacs-devel@gnu.org; Thu, 06 May 2021 04:46:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50472) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leZe2-0006NB-4D; Thu, 06 May 2021 04:46:06 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1270 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.86_2) (envelope-from ) id 1leZe1-0005KT-OL; Thu, 06 May 2021 04:46:06 -0400 In-Reply-To: <87mtt8sx77.fsf@catern.com> (message from Spencer Baugh on Wed, 05 May 2021 17:11:08 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:268953 Archived-At: > From: Spencer Baugh > Cc: Alan Mackenzie , Eli Zaretskii , > emacs-devel@gnu.org > Date: Wed, 05 May 2021 17:11:08 -0400 > > Perhaps foolishly, I (experimentally) switched some existing uses of > DEFVAR_PER_BUFFER to a new variant with a new name, and then noticed > some test failures. I tried to grep for "DEFVAR_PER_BUFFER" (and other > variations) to find what might be depending on the name of the macro but > didn't find anything, since make-docfile.c parses DEFVAR_PER_BUFFER one > character at a time with getc and so doesn't actually include the string > "DEFVAR_PER_BUFFER" anywhere. We could improve discoverability of this by adding appropriate comments to the source code there. > Eventually I figured out that it was make-docfile that wasn't > picking up the new name for the DEFVAR_PER_BUFFER macro. So then I > dug through scan_c_stream in make-docfile.c to see what would be > required to add support for the DEFVAR_PER_BUFFER variant, but > eventually gave up on understanding the best way to inject my new > macro name into the manually-unrolled tree of getc-based parsing. It's just a series of if/else if tests that examine the characters one by one, so adding a new macro would mean some more tests like that. Or am I missing something?