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: Colorizing source code in Info manuals Date: Fri, 06 Dec 2024 09:38:08 +0200 Message-ID: <86zfl9l0rj.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28014"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Cecilio Pardo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 06 08:38:49 2024 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 1tJSvI-000780-Ue for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Dec 2024 08:38:48 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJSuo-0005UP-5I; Fri, 06 Dec 2024 02:38:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJSun-0005UG-Hn for emacs-devel@gnu.org; Fri, 06 Dec 2024 02:38:17 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJSum-00062r-9h; Fri, 06 Dec 2024 02:38:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=KbqQaZ18RLzIyrbDcvjUDyaAXSWk9F4B25UZAD4qkDo=; b=lEQ72RP4PCkZ BLQmev3FDXtY8L+E1q9eGWzuRzRLCOSDqSG1pEZoy4R/oXbucPRNdGlVu9qZfBZLlDBW/pY4J0BcM k5yn5nrdmVyEZAO+c/a/7C+YAGYRAglHuAjQ5krwFT94nbyLCArgJxt34nghDR9+yTuAAvo2xqUZc COYoHp3vEhsUbwdS5SaEDd54T0p4aGKPWmqsmN7lLe3d3sWqTjlx5me+Q8evFRnMja80ECSc5ZP0C 6JS9CgY80LJlnrTPNqAmSYpQ+scy7JinG/WWabsj5sxo8E5xnMgjrUUcc/SGbJTpGZFxYFjZPDp41 jmQo6cm0j3eOAOB1kxIWYg==; In-Reply-To: (message from Cecilio Pardo on Thu, 5 Dec 2024 23:06:37 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326118 Archived-At: > Date: Thu, 5 Dec 2024 23:06:37 +0100 > From: Cecilio Pardo > > As texinfo is not going to add features like color to the Info format, > I think maybe emacs could add some itself. I'm not sure "is not going to add features like color to the Info format" is correct. Texinfo does support syntax-highlighting of code snippets in HTML output (for now as an experimental feature), so it is not outlandish to assume something similar can be done for the Info format as well. > For example, the Emacs Lisp Intro uses @smallexample blocks for > presenting lisp code. I modified makeinfo more or less successfully to > generate a file with the line numbers where these blocks start. With > this kind of information, emacs could fontify the source code. > > Does this sound good? I think this should be discussed with the Texinfo developers, not here. I can think about at least two possible ways of implementing this in Texinfo: . makeinfo could mark the code blocks with special markers, similar to what it already does with image specs and indices . makeinfo could produce ANSI color escape sequences in the Info output, driven by the same syntax-highlighting machinery already used for HTML