From unknown Fri Jun 20 07:14:03 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#7322 <7322@debbugs.gnu.org> To: bug#7322 <7322@debbugs.gnu.org> Subject: Status: Something about python font-lock Reply-To: bug#7322 <7322@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:14:03 +0000 retitle 7322 Something about python font-lock reassign 7322 emacs submitter 7322 Andreas R=C3=B6hler severity 7322 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 03 07:43:23 2010 Received: (at submit) by debbugs.gnu.org; 3 Nov 2010 11:43:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PDbkR-0000O9-A9 for submit@debbugs.gnu.org; Wed, 03 Nov 2010 07:43:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PDbkO-0000O4-J8 for submit@debbugs.gnu.org; Wed, 03 Nov 2010 07:43:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDboe-000715-FM for submit@debbugs.gnu.org; Wed, 03 Nov 2010 07:47:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, WEIRD_QUOTING autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:33005) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDbod-00070w-Gp for submit@debbugs.gnu.org; Wed, 03 Nov 2010 07:47:44 -0400 Received: from [140.186.70.92] (port=59264 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PDboa-0006ro-1a for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2010 07:47:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PDboW-000706-9z for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2010 07:47:38 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:55912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PDboV-0006zZ-Th for bug-gnu-emacs@gnu.org; Wed, 03 Nov 2010 07:47:36 -0400 Received: from noname.home (brln-4dbc46e8.pool.mediaWays.net [77.188.70.232]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MaG7g-1Oy8GT0Gvw-00KH82; Wed, 03 Nov 2010 12:47:33 +0100 Message-ID: <4CD14BC0.80709@easy-emacs.de> Date: Wed, 03 Nov 2010 12:47:12 +0100 From: =?ISO-8859-15?Q?Andreas_R=F6hler?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 23.1; tqs-escape-syntax-error Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:Di24o6IOBPeGYgS2l7AOL4bj7Z3PpD0ToKKuquC7iEl 2+rKGqAPn1WVfoMRwfcKnpDialIP9cVR1ConAuJJVPeor0qG/H d5PDJOPiqjRhPUB3TUGFlC1RkJAmIXKAV2H8HqvrOaAr+rjOcy ynaR5ZoA5zYb6XapZM+tS34PbJCn1UhhQ+y8Nn1f4XfVbeqVRL aC5xJc1MYVHatRnd3VZpBxMOVj/ucow4qNDKbOL5Ks= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -4.7 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) Hi, editing python code, the following code concatenates strings with variables: """(beginning-of-form-base \"""" + string1 + """\" \"""" + string2 + """\" nil nil nil nil t))))""" while " + string1 +" is highlighted correctly, " + string2 + " has string face wrongly. Also `ppss' falsely indicates being inside a string. BTW everything is fine with an alternative coding using singlequotes: """(beginning-of-form-base \"""" + string1 + '\" \"' + string2 + """\" nil nil nil nil t))))""" The bug however exists. Thanks all Andreas -- https://code.launchpad.net/~a-roehler/python-mode/python-mode-components https://code.launchpad.net/s-x-emacs-werkstatt/ In GNU Emacs 23.1.1 (i586-suse-linux-gnu, GTK+ Version 2.20.1) of 2010-07-05 Windowing system distributor `The X.Org Foundation', version 11.0.10800000 configured using `configure '--with-pop' '--without-hesiod' '--with-kerberos' '--with-kerberos5' '--with-xim' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--with-x' '--with-sound' '--with-sync-input' '--with-xpm' '--with-jpeg' '--with-tiff' '--with-gif' '--with-png' '--with-rsvg' '--with-dbus' '--without-gpm' '--with-x-toolkit=gtk' '--x-includes=/usr/include' '--x-libraries=/usr/lib:/usr/share/X11' '--with-xft' '--with-libotf' '--with-m17n-flt' '--build=i586-suse-linux' 'build_alias=i586-suse-linux' 'CC=gcc-4.3' 'CFLAGS=-fomit-frame-pointer -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -D_GNU_SOURCE -std=gnu89 -pipe -Wno-pointer-sign -Wno-unused-variable -Wno-unused-label -Wno-unprototyped-calls -fno-optimize-sibling-calls -DSYSTEM_PURESIZE_EXTRA=55000 -DSITELOAD_PURESIZE_EXTRA=10000 ' 'LDFLAGS=-Wl,-O2 -Wl,--hash-size=65521'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: de_DE.UTF-8 value of $XMODIFIERS: @im=local locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Python Minor modes in effect: tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-j ; ; SPC C-x C-e C-x C-f p r o g a r p o y y t t h l i s t a C-h f p y t h o n m - m o d e C-x 1 M-x r e p o r t - e m a c s - b u Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Mark saved where search started Mark set From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 08 13:55:56 2010 Received: (at 7322-done) by debbugs.gnu.org; 8 Nov 2010 18:55:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFWsm-0007Q7-6C for submit@debbugs.gnu.org; Mon, 08 Nov 2010 13:55:56 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PFWps-0007OV-4v for 7322-done@debbugs.gnu.org; Mon, 08 Nov 2010 13:52:56 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtEKAEPX10xMCpqE/2dsb2JhbAChCIEDcr1EhUgEhFiNWg X-IronPort-AV: E=Sophos;i="4.59,169,1288584000"; d="scan'208";a="81948544" Received: from 76-10-154-132.dsl.teksavvy.com (HELO pastel.home) ([76.10.154.132]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 08 Nov 2010 13:57:34 -0500 Received: by pastel.home (Postfix, from userid 20848) id 55F95A86D8; Mon, 8 Nov 2010 13:57:34 -0500 (EST) From: Stefan Monnier To: Andreas =?iso-8859-1?Q?R=F6hler?= Subject: Re: bug#7322: 23.1; tqs-escape-syntax-error Message-ID: References: <4CD14BC0.80709@easy-emacs.de> Date: Mon, 08 Nov 2010 13:57:34 -0500 In-Reply-To: <4CD14BC0.80709@easy-emacs.de> ("Andreas =?iso-8859-1?Q?R=F6h?= =?iso-8859-1?Q?ler=22's?= message of "Wed, 03 Nov 2010 12:47:12 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: 7322-done X-Mailman-Approved-At: Mon, 08 Nov 2010 13:55:50 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.4 (-) >>>>> "Andreas" =3D=3D Andreas R=F6hler wri= tes: > Hi, > editing python code, the following code concatenates strings with variabl= es: > """(beginning-of-form-base \"""" + string1 + """\" \"""" + string2 + """\" > nil nil nil nil t))))""" > while " + string1 +" is highlighted correctly, " + string2 + " has string > face wrongly. Thanks. Indeed backslashes weren't recognized properly in this case. I've installed the patch below in the emacs-23 branch, which seems to fix this problem. Stefan =3D=3D=3D modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2010-08-23 00:44:55 +0000 +++ lisp/progmodes/python.el 2010-11-08 18:53:30 +0000 @@ -170,18 +170,9 @@ ;; Make outer chars of matching triple-quote sequences into generic ;; string delimiters. Fixme: Is there a better way? ;; First avoid a sequence preceded by an odd number of backslashes. - `((,(rx (not (any ?\\)) - ?\\ (* (and ?\\ ?\\)) - (group (syntax string-quote)) - (backref 1) - (group (backref 1))) - (2 ,(string-to-syntax "\""))) ; dummy - (,(rx (group (optional (any "uUrR"))) ; prefix gets syntax property - (optional (any "rR")) ; possible second prefix - (group (syntax string-quote)) ; maybe gets property - (backref 2) ; per first quote - (group (backref 2))) ; maybe gets property - (1 (python-quote-syntax 1)) + `((,(concat "\\(?:\\([RUru]\\)[Rr]?\\|^\\|[^\\]\\(?:\\\\.\\)*\\)" ;Prefi= x. + "\\(?:\\('\\)'\\('\\)\\|\\(?2:\"\\)\"\\(?3:\"\\)\\)") + (1 (python-quote-syntax 1) nil lax) (2 (python-quote-syntax 2)) (3 (python-quote-syntax 3))) ;; This doesn't really help. @@ -219,9 +210,9 @@ (eval-when-compile (string-to-syntax "|")))))) ;; Consider property for initial char, accounting for prefixes. ((or (and (=3D n 2) ; leading quote (not prefix) - (=3D (match-beginning 1) (match-end 1))) ; prefix is null + (not (match-end 1))) ; prefix is null (and (=3D n 1) ; prefix - (/=3D (match-beginning 1) (match-end 1)))) ; non-empty + (match-end 1))) ; non-empty (let ((font-lock-syntactic-keywords nil)) (unless (eq 'string (syntax-ppss-context (syntax-ppss))) (eval-when-compile (string-to-syntax "|"))))) From unknown Fri Jun 20 07:14:03 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 07 Dec 2010 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator