From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.bugs Subject: bug#45897: 27.1; python mode font-lock confused by string concatenation Date: Fri, 15 Jan 2021 11:03:52 -0700 Message-ID: <875z3ydqlz.fsf@tromey.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36923"; mail-complaints-to="usenet@ciao.gmane.io" To: 45897@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 15 19:05:46 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1l0TTl-0009Sp-OQ for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Jan 2021 19:05:46 +0100 Original-Received: from localhost ([::1]:59598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l0TTk-00079O-N0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Jan 2021 13:05:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0TT4-000793-Li for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 13:05:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58363) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l0TT4-0000sS-D2 for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 13:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l0TT4-000259-8D for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 13:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tom Tromey Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Jan 2021 18:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45897 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16107338577948 (code B ref -1); Fri, 15 Jan 2021 18:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Jan 2021 18:04:17 +0000 Original-Received: from localhost ([127.0.0.1]:41676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0TSK-000247-EL for submit@debbugs.gnu.org; Fri, 15 Jan 2021 13:04:16 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:52190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l0TSI-00023z-AU for submit@debbugs.gnu.org; Fri, 15 Jan 2021 13:04:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0TSI-0006TH-5n for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 13:04:14 -0500 Original-Received: from gateway22.websitewelcome.com ([192.185.47.129]:14029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l0TSE-0000W8-0Y for bug-gnu-emacs@gnu.org; Fri, 15 Jan 2021 13:04:13 -0500 Original-Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway22.websitewelcome.com (Postfix) with ESMTP id AB97F9931 for ; Fri, 15 Jan 2021 12:03:53 -0600 (CST) Original-Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 0TRxlHTwVHPnU0TRxl0alq; Fri, 15 Jan 2021 12:03:53 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ukIB08clO2qvBdxaVXNauOdjC/RL53xIUXIAVmN+DOw=; b=Zk42hxfT8jednTQ/IzFTVOG/PD hTZY0a039ZtHt8vX7/aQd22DeckO3P0uFN0ILlX5zo/DcJOpl0o66zZV4g/x0V+MS5f6uaY1TITp+ fPmCfs48DnGSW/3zT008QOMH/; Original-Received: from 97-122-65-38.hlrn.qwest.net ([97.122.65.38]:60260 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1l0TRx-000RGY-Dk; Fri, 15 Jan 2021 11:03:53 -0700 X-Attribution: Tom X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.65.38 X-Source-L: No X-Exim-ID: 1l0TRx-000RGY-Dk X-Source-Sender: 97-122-65-38.hlrn.qwest.net (murgatroyd) [97.122.65.38]:60260 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes Received-SPF: permerror client-ip=192.185.47.129; envelope-from=tom@tromey.com; helo=gateway22.websitewelcome.com X-Spam_score_int: 15 X-Spam_score: 1.5 X-Spam_bar: + X-Spam_report: (1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_BL_SPAMCOP_NET=1.347, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_RP_RNBL=1.31, SPF_HELO_PASS=-0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197995 Archived-At: Consider this 2-line Python file: x =3D "hello""" y =3D "confused" If you put this into a .py file, Emacs will font-lock the second line incorrectly. It appears that Emacs thinks the `"""' on the first line is an opening triple quote. However, it is actually string concatenation, with the second string being empty. I tripped over a case like this in some real code. In GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.21, = cairo version 1.16.0) of 2020-08-20 built on buildvm-x86-24.iad2.fedoraproject.org Windowing system distributor 'Fedora Project', version 11.0.12010000 System Description: Fedora 32 (Workstation Edition) Recent messages: Wrote /home/tromey/.newsrc.eld Saving /home/tromey/.newsrc.eld...done (No changes need to be saved) (New file) Can=E2=80=99t guess python-indent-offset, using defaults: 4 EOL while scanning string literal [3 times] Saving file /tmp/q.py... Wrote /tmp/q.py Quit Undo Configured using: 'configure --build=3Dx86_64-redhat-linux-gnu --host=3Dx86_64-redhat-linux-gnu --program-prefix=3D --disable-dependency-tracking --prefix=3D/usr --exec-prefix=3D/usr --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=3D/etc --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64 --libexecdir=3D/usr/libexec --localstatedir=3D/var --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=3Dgtk3 --with-gpm=3Dno --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-gnu 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' LDFLAGS=3D-Wl,-z,relro PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER GMP Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Python Minor modes in effect: erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-pcomplete-mode: t erc-netsplit-mode: t erc-spelling-mode: t erc-truncate-mode: t display-fill-column-indicator-mode: t flyspell-mode: t shell-dirtrack-mode: t which-function-mode: t erc-track-mode: t erc-track-minor-mode: t erc-notify-mode: t erc-notifications-mode: t erc-match-mode: t erc-services-mode: t erc-networks-mode: t erc-hl-nicks-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t flycheck-mode: t savehist-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t auto-fill-function: python-do-auto-fill transient-mark-mode: t Load-path shadows: None found. Features: (shadow emacsbug tramp-cmds yaml-mode gnus-draft vc-annotate tramp-cache thai-util thai-word goto-addr log-edit sh-script smie executable cc-mode cc-fonts cc-guess cc-menus cc-cmds tabify man find-dired rst ffap grep webjump log-view pcvs-util dabbrev mule-util ggtags etags fileloop generator bug-reference tcl jka-compr gnus-html url-queue help-fns radix-tree url-cache mm-url flow-fill misearch multi-isearch shr-color supercite regi smerge-mode diff python tramp-sh ada-mode ada-imenu align ada-skel wisi-skel skeleton ada-process wisi-process-parse ada-indent-user-options ada-core wisi-prj wisi xref wisi-fringe wisi-parse-common semantic/lex semantic/fw mode-local uniquify-files project find-file compile erc-list erc-menu erc-join erc-ring erc-pcomplete erc-netsplit erc-spelling erc-truncate cl-extra smiley mm-archive gnus-bcklg qp gnus-async gnus-ml disp-table sort gnus-cite vc-mtn vc-hg mailalias mail-hist nnir gnus-topic nndraft nnmh nnfolder utf-7 bbdb-gnus bbdb-mua bbdb-com crm gnutls network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-sum url url-proxy url-privacy url-expand url-methods url-history mailcap shr url-cookie url-domsuf svg dom gnus-group gnus-undo smtpmail gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range gnus-win gnus nnheader bbdb-message sendmail mail-extr message rmc puny rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader rfc2368 copyright add-log make-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc-git diff-mode easy-mmode term/xterm xterm display-fill-column-indicator flyspell ispell diminish appt diary-lib diary-loaddefs cal-menu calendar cal-loaddefs tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp which-func imenu autorevert filenotify desktop frameset cus-start cus-load git-link url-util erc-track erc-notify erc-desktop-notifications erc-match erc-services erc-networks notifications dbus erc-hl-nicks color erc-button erc-fill erc-stamp wid-edit erc-goodies erc erc-backend erc-compat format-spec thingatpt pp erc-loaddefs dired-aux dired-x dired dired-loaddefs warnings advice vc-dir ewoc vc vc-dispatcher flycheck find-func help-mode rx dash cc-styles cc-align cc-engine cc-vars cc-defs bbdb bbdb-site timezone ange-ftp comint ansi-color ring server savehist finder-inf clang-rename clang-include-fixer let-alist clang-format xml info package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 1294698 143374) (symbols 48 40600 90) (strings 32 416876 28749) (string-bytes 1 9986293) (vectors 16 135630) (vector-slots 8 2470110 287678) (floats 8 541 727) (intervals 56 112191 2695) (buffers 1000 395))