From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +oerBcobol8ibgAA0tVLHw (envelope-from ) for ; Wed, 04 Nov 2020 03:11:06 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 2ND7AMobol+/aAAA1q6Kng (envelope-from ) for ; Wed, 04 Nov 2020 03:11:06 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8DFCE9407E5 for ; Wed, 4 Nov 2020 03:11:04 +0000 (UTC) Received: from localhost ([::1]:34274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ka9CQ-0004hU-HE for larch@yhetil.org; Tue, 03 Nov 2020 22:11:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ka9Ba-0004gH-Qf for emacs-orgmode@gnu.org; Tue, 03 Nov 2020 22:10:10 -0500 Received: from pb-smtp2.pobox.com ([64.147.108.71]:59068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ka9BY-0006ma-8h for emacs-orgmode@gnu.org; Tue, 03 Nov 2020 22:10:10 -0500 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 747149D61B; Tue, 3 Nov 2020 22:10:05 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=/nKY5TLNTEYp/0VYeRCXwmeQ/Jk=; b=P9CAm4 e/zb2SOF6fwyDOUagBVqJYPKN3I0ZgMrCjcmX46W1OVt0I9z9R126mUzgI86P3nv THqrJpL3dOVUY4u+mvegmZl/8M4HD+qDeu2ecSjc/47/Hkf/WESHYypO9fDzrraR cKbuc8LZtffTByGCkcdnjYgKGWHJk/XHpiQvI= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 5EAF59D619; Tue, 3 Nov 2020 22:10:05 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=QurKNTiKO+qzXHb9n5g4X1FDrTIBWd7BPHPTihff8y4=; b=jhBfxzTqvdCAY1B18duyS9QzSvHcSXhEmSn2cddq929jBP+sCs3vOzfZ8MLNJSHfOEus7FheEnUs7IOtegGeD5x07NW0c089nYbi70HRpBracKtZaGx7n57M9XcIn3c3QmidUXFM1aeactDEwPrGdQGJH3U1NOMxx+SVtt1foFQ= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id 2694A9D616; Tue, 3 Nov 2020 22:10:04 -0500 (EST) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: John Kitchin Subject: Re: Org mode fontification error in # in python and ipython source blocks In-Reply-To: References: Date: Tue, 03 Nov 2020 22:10:03 -0500 Message-ID: <87sg9pom0k.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 3BEE0EDA-1E4B-11EB-ABE7-74DE23BA3BAF-24757444!pb-smtp2.pobox.com Received-SPF: pass client-ip=64.147.108.71; envelope-from=kyle@kyleam.com; helo=pb-smtp2.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/03 22:10:05 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sebastian Gimeno , Org-mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=P9CAm4 e; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=jhBfxzTq; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: y02ANUuU0zhg John Kitchin writes: >> (setq python-font-lock-keywords >> (append python-font-lock-keywords >> '(;; this is the full string. >> ;; group 1 is the quote type and a closing quote is matched >> ;; group 2 is the string part >> ( >> ;; "f\\(['\"]\\{1,3\\}\\)\\([^\\1]+?\\)\\1" >> "f\\(['\"]\\{1,3\\}\\)\\(.+?\\)\\1" >> ;; these are the {keywords} >> ("{[^}]*?}" >> ;; Pre-match form >> (progn (goto-char (match-beginning 0)) (match-end 0)) >> ;; Post-match form >> (goto-char (match-end 0)) >> ;; face for this match >> (0 font-lock-variable-name-face t)))))) > Does anyone see anything wrong with that snippet? All it should do is > improve font-lock on Python f-strings, and it used to work fine, but now it > doesn't. It isn't real critical for me, so I don't mind commenting it out, > but I neither understand why it stopped working! I haven't tested to confirm, but I'd guess that is due to the restructuring of python-font-lock-keywords in 36b64e087e (Add 'font-lock-maximum-decoration' levels for Python, 2018-07-19), which was included in Emacs 27. In case it's helpful, here's the compatibility kludge I used in snakemake-mode: https://git.kyleam.com/snakemake-mode/commit/snakemake-mode.el?id=5d5bb0109f6a84c0c191559ab71670fae4650e6a