From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gustavo Tavares Cabral Newsgroups: gmane.emacs.bugs Subject: bug#42805: 27.1; cc-mode/syntax/font-lock bug Date: Mon, 10 Aug 2020 16:55:40 -0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000074252005ac8b57b1" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9956"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bug-cc-mode@gnu.org To: 42805@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 10 21:56:51 2020 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 1k5Dub-0002Sn-9A for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Aug 2020 21:56:49 +0200 Original-Received: from localhost ([::1]:35670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k5Dua-0005kG-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Aug 2020 15:56:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5Dtq-0004PU-U7 for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 15:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5Dtq-0005eF-Jf for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 15:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k5Dtq-0000xX-Ef for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 15:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gustavo Tavares Cabral Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Aug 2020 19:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42805 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.15970893613678 (code B ref -1); Mon, 10 Aug 2020 19:56:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Aug 2020 19:56:01 +0000 Original-Received: from localhost ([127.0.0.1]:37537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5Dto-0000xG-Dw for submit@debbugs.gnu.org; Mon, 10 Aug 2020 15:56:01 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k5Dtl-0000x7-Np for submit@debbugs.gnu.org; Mon, 10 Aug 2020 15:55:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k5Dtl-0004CU-Ay for bug-gnu-emacs@gnu.org; Mon, 10 Aug 2020 15:55:57 -0400 Original-Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:45540) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k5Dti-0005dW-Ub; Mon, 10 Aug 2020 15:55:57 -0400 Original-Received: by mail-ej1-x635.google.com with SMTP id c16so10614349ejx.12; Mon, 10 Aug 2020 12:55:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=Xfrrc3vCzEWyaAQsSD1PqmRsDmDZRmZqBi3PNHlW2Ik=; b=uM+tg6lQURf/DpF7OWZjOOT+Ly2GGk1ZXSQPhYt7heN+ykwlAbMZE3DmU4hzw7rxJI jYy2R0oSPlAVnSXJ2r2rtcIWPXUJDbWWRangtsgkdcClQK2vDS7CBnr08Wcr/yRhlblS 6CLofHGRTOgdyP6pXoqhUkerJKWz0Up8RE9MFYMDFL9lajs1z3xRaTRfO0b2kLp1aZmA ECfCYeS8GPyNadBdq5hiFJfdBtbcKsHXS2jsgmoLdizbwMBc8E1rDksObwCZ6NanCzZk wCg+/xDqkHtdood4xBo2CO+e4lkoZ/rb+iDcBONsUjlDWaw7bzjGHP+Dkp9Vadf6a94W 08uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Xfrrc3vCzEWyaAQsSD1PqmRsDmDZRmZqBi3PNHlW2Ik=; b=lBzlXdu9O7W1Aa2fHlJh9P4i+WHGRf5vCq+7jEEWlVpoAPXtyQq4emEbxzA9io62+0 +3al5xou5b1HdB9Kh2tuw7oLhI0x5+k/ETyzCPEMhw3c/r6fMIBfZQntqADxNxG23s4u KvGl1agdf1aQuneyfcwF/JkjGdh3DaO9RizUpNCtp1z7lfL9YkGROvZV186InSpq+/Cd 4WzG0BiyZ+aA/x89hNgr60ik9w8N351cU05O0Fro5wx46QbMspte71gRWjwQlA1LrjOo WvxSo9cXjaLrB7nCy26SvUK/Nrw8dSsX0YAyXgky0CXay5UUqIHgg7EMxt9hq001+YxB NfgA== X-Gm-Message-State: AOAM5336Y634L9qIouKuFBjnlba9XYcWdXOR/4i2svweYcvEyPXrIZSs 29pgzS5iv0bNJqP9a97OVzzS/dvliSbzZmWT/la8vpPA5Mo= X-Google-Smtp-Source: ABdhPJxfTuHz3Xmisj0aoRrh8w5KDvwux/YYn1behBkz+AQbap6OLK8aBh70sjF+rWNAHsdpCNHjvw6ErzbnHpzVOR0= X-Received: by 2002:a17:906:f191:: with SMTP id gs17mr23652190ejb.145.1597089351212; Mon, 10 Aug 2020 12:55:51 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=gustavotcabral@gmail.com; helo=mail-ej1-x635.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham 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:184578 Archived-At: --00000000000074252005ac8b57b1 Content-Type: text/plain; charset="UTF-8" Hi, I have found two related issues. Both are evident in csharp-mode, but can easily be reproduced in c-mode. Issue 1 (cc-mode.el): When c-multiline-string-start-char is set, font locking breaks after changes in string literals. The issue started after commit 2ca12bb3de: I believe that '(c-remove-string-fences (car end-limits))' should be '(c-remove-string-fences (1- (cdr end-limits)))' Steps to reproduce: 1. Open a .c file; 2. Eval '(setq c-multiline-string-start-char ?@)'; 3. Delete/insert double quotes. I think this issue is related: https://github.com/Fuco1/smartparens/issues/992 Issue 2 (maybe syntax.el): When syntax-propertize-function is set (to '(lambda (beg end) nil)', for example), a similar problem occurs if electric-pair-mode (or even smartparens) is enabled. The symptoms started after commit 585fb95739, but I don't know if it is related. Steps to reproduce: 1. Open a .c file; 2. Eval '(setq syntax-propertize-function (lambda (beg end) nil)'; 3. Enable electric-pair-mode; 4. Insert/delete empty strings. In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cairo version 1.16.0) of 2020-08-06 built on gustavo-Lenovo-ideapad-330-15IKB Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Ubuntu 18.04.5 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Configured using: 'configure --with-x-toolkit=gtk3 --with-modules --with-sound=yes --with-file-notification=yes --with-mailutils --with-cairo' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS PDUMPER LCMS2 GMP Important settings: value of $LANG: en value of $XMODIFIERS: locale-coding-system: iso-latin-1-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x 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 lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 44286 8232) (symbols 48 5980 1) (strings 32 15464 904) (string-bytes 1 505487) (vectors 16 9275) (vector-slots 8 124610 9084) (floats 8 20 48) (intervals 56 256 67) (buffers 1000 12)) --00000000000074252005ac8b57b1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I have found two related issues. Both are evident in csharp-mode, but
can easily be reproduced in c-mode.

Issue 1 (cc-mode.el):

=C2=A0 When c-multiline-string-start-char is set, font locking breaks a= fter
=C2=A0 changes in str= ing literals. The issue started after commit 2ca12bb3de:
<= span style=3D"font-family:monospace">=C2=A0 I believe that '(c-remove-s= tring-fences (car end-limits))' should be
=C2=A0 '(c-remove-string-fences (1- (cd= r end-limits)))'

=C2=A0 Steps to reproduce:
=C2=A0=C2=A0=C2=A0 1. Open a .c file;
=C2=A0=C2=A0=C2=A0 2. Eval '(setq c-multiline-string-start-char ?@)= ';
=C2=A0=C2=A0=C2=A0 3. Delete/insert double quotes.

=C2=A0 I think this i= ssue is related:


Issue 2 (maybe syntax.el):

=C2=A0 When syntax-propertize-function is set (to '(lambda (beg end= ) nil)',
=C2=A0 for example), a similar problem occurs if electric-pair-mode (or= even
=C2=A0 smartparens) i= s enabled. The symptoms started after commit 585fb95739,
=C2=A0 but I don't know if it is related.=

=C2=A0 Steps to reproduce:
=C2=A0=C2=A0=C2=A0 1. Open a .c file;
=C2=A0=C2=A0=C2=A0 2. Eval '(setq syntax-propertize-function (lambd= a (beg end) nil)';
=C2=A0=C2=A0=C2=A0 3. Enable electric-pair-mode;
=C2=A0=C2=A0=C2=A0 4. Insert/delete empty strings.




In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30, cair= o version 1.16.0)
of 2020-08-06 built on gustavo-Lenovo-ideapad-330-15IKB
Windowing system distributor 'The X.Org Foundation', version 11.0.1= 2008000
System Description: Ubuntu 18.04.5 LTS

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Configured using:
'configure --with-x-toolkit=3Dgtk3 --with-modules --with-sound=3Dyes
--with-file-notification=3Dyes --with-mailutils --with-cairo'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS PDUMPER LCMS2
GMP

Important settings:
value of $LANG: en
value of $XMODIFIERS:=20
locale-coding-system: iso-latin-1-unix

Major mode: Lisp Interaction

Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search seq
byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date subr-x
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 lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 44286 8232)
(symbols 48 5980 1)
(strings 32 15464 904)
(string-bytes 1 505487)
(vectors 16 9275)
(vector-slots 8 124610 9084)
(floats 8 20 48)
(intervals 56 256 67)
(buffers 1000 12))

--00000000000074252005ac8b57b1--