From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 4EFAD3858D32 for ; Sun, 22 Jan 2023 14:30:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4EFAD3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org 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 1pJbMU-00063B-Rl for gdb@sourceware.org; Sun, 22 Jan 2023 09:30:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:From:To:MIME-Version:Date:in-reply-to: references; bh=Oj+ffINOvFnsBoZymu1Y3TcoQ7zI6TP8pCqM6MwH8mg=; b=URo8lq/+YtaXwH tXO70RIqkz//mhxENhwV3NYUf9SGAhhKtpeOuXfx5nkpw+0qwwVkz5XnJaWOcsCmLjz6iwweeFhj2 0QWNmG1o92UoXJhGkRF+j5MWgvGjkublJbJVtbyq4Zp9qPkuPOfRdXJeQ4V56JkajrinQoor18y9h IcgLj87J0lHl02BPyzZv1942uys/L0MIcsp5l6tyY+CZ6vSBi+7tno5E666fFDJiPSC7zat4o7XWF 7UbPlvhyhgc2agM7R7r0K4KcMQHygHWljpirasWES0FKvW3zmUVP51vl29Ucorj2ymTcTod/0zl2i 6gRS1B3oy69KuDp9K3yA==; Received: from ip5f5a8893.dynamic.kabel-deutschland.de ([95.90.136.147] helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJbMU-0001Fi-2l for gdb@sourceware.org; Sun, 22 Jan 2023 09:30:22 -0500 Message-ID: <9aa7a6cf-93f8-3a96-c99f-3f9a71e41333@gnu.org> Date: Sun, 22 Jan 2023 15:30:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Content-Language: en-US To: GDB User Mailing List From: Simon Sobisch Subject: How to adjust the lexer used by pygments highlighting Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The highlighting via pygments actually works quite fine in general, but in some cases it uses the wrong lexer and then has bad results. It _seems_ that pygments' "filename (extension) based" language lookup is not used, because tested files using `pygmentize` are always well colored, the ones in GDB sometimes use the wrong lexer. Question: How can we adjust the lexer used by pygments syntax higlighting in GDB for a given file? Is it possible to setup a filename extension-based selection when GDB does not know of the language ("set language " _seems_ to have no effect on highlighting, but that would only work if the language is known to GDB)? If not can the "normal" extension list [1] be added to GDB or the decision which lexer to be used passed on to pygments? Thank you for any insights, Simon [1]: https://pygments.org/languages/