From unknown Mon Aug 11 21:13:48 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#44653 <44653@debbugs.gnu.org> To: bug#44653 <44653@debbugs.gnu.org> Subject: Status: 28.0.50; sql-mode gets confused about string literals Reply-To: bug#44653 <44653@debbugs.gnu.org> Date: Tue, 12 Aug 2025 04:13:48 +0000 retitle 44653 28.0.50; sql-mode gets confused about string literals reassign 44653 emacs submitter 44653 Dale Sedivec severity 44653 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 15 01:37:35 2020 Received: (at submit) by debbugs.gnu.org; 15 Nov 2020 06:37:35 +0000 Received: from localhost ([127.0.0.1]:52437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keBfL-0007I3-0X for submit@debbugs.gnu.org; Sun, 15 Nov 2020 01:37:35 -0500 Received: from lists.gnu.org ([209.51.188.17]:58614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1keBfJ-0007Hv-VU for submit@debbugs.gnu.org; Sun, 15 Nov 2020 01:37:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:44964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1keBfJ-0006G7-Ou for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 01:37:33 -0500 Received: from mail-il1-x132.google.com ([2607:f8b0:4864:20::132]:42188) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1keBfH-0005oU-59 for bug-gnu-emacs@gnu.org; Sun, 15 Nov 2020 01:37:33 -0500 Received: by mail-il1-x132.google.com with SMTP id g15so12211294ilc.9 for ; Sat, 14 Nov 2020 22:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codefu-org.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=/CD/5BeelcHK3d3t049p2uyFEH2dwlLu+B6gHZfwI+4=; b=fFjcTE3kXQFuU0crG8+rFgN7BV2ZtifOwfRwC94BwCcIsM3oxFIjb0yBS1PZlCErZw fLtYNTj5Wfa1nxMlFksCFuBPHxPutDKY3kJeCebnuYHdcOWN67lvXNtFUNaDivkLophd lNp3UjfrNjuOInVIaSuX3XCvsEGswnJQc6m2N86prjtiZCk6cFYn29KQzOVLjUcCrRq8 jX5UQVNbzOzSSAGFoDfcYuHiisk8Zq/b3+5MoXc9LO7t4ithpZdWk/rjd9bZhqi2BzEt PmxIdZm/Hsg0mIRaQuXj1DjQ8mbf5Js+WIeUujgXqu2fbHuhWhuuBkBgyJm1/DHf+e6h fN0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=/CD/5BeelcHK3d3t049p2uyFEH2dwlLu+B6gHZfwI+4=; b=DuiDBGrlm/GIlK2jP1RPivUOjx0jtReHyk+UuIJNPUqX6q9nkLtcAd/DjFlCd1l2Br Xd7CCtdm66MHNwhB9GDUzZs35aQoSTj+ipvDZrYQJofU8i9jgxIsZqJHKPfaimRNUBEH Bv4Z4PisoABRFaGLkHuiXKUmg9dhoKjvuTPW9LZ5AVqEhTyTtySynabrW7p9EtdVRt1f Sld3Kdpwfx/5aiyRxloe2VRAX/zgDlM9OUc4XZbkNIV3pgRwN+i2hwwc6UpfzdcxinMS cgS0E5G9/uvCxI5JT0NT6FWy5/4+5Kdl/U6cso/52duEKshIbHDiY1I5IzsHxA6L/ZP3 PcvQ== X-Gm-Message-State: AOAM533NRj9kf7gXTqR6yXapbP7Rb2hn63eiX2H6Royls8UPdc478ioC vQADZ2sCS8avE5SwQSbthcg8mI9L4AcLFNvf X-Google-Smtp-Source: ABdhPJxb4+XGvq0xrBZzWn/2N7rMfagPF3pQGSiszblGvHiX4f68NmB7bZ8U2JCBVobPkv7iruRUUg== X-Received: by 2002:a92:5b8c:: with SMTP id c12mr5083991ilg.293.1605422229678; Sat, 14 Nov 2020 22:37:09 -0800 (PST) Received: from dale.caliginous.net (152.160.30.136.in-addr.arpa. [136.30.160.152]) by smtp.gmail.com with ESMTPSA id n4sm7483622iox.6.2020.11.14.22.37.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 14 Nov 2020 22:37:09 -0800 (PST) From: Dale Sedivec Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: 28.0.50; sql-mode gets confused about string literals Message-Id: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> Date: Sun, 15 Nov 2020 00:37:08 -0600 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3445.104.17) Received-SPF: none client-ip=2607:f8b0:4864:20::132; envelope-from=dale@codefu.org; helo=mail-il1-x132.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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) I think `syntax-ppss' has started returning incorrect information about apostrophe-delimited strings in sql-mode in master. I am actually on native-comp with this afternoon's master merged in myself, but I am fairly confident you can reproduce this on master, nothing to do with native-comp. Steps to reproduce: 1. emacs -Q 2. Evaluate the following in *scratch*: (let ((buf (generate-new-buffer "sql"))) (switch-to-buffer buf) (sql-mode) (insert "select '''") (goto-char 1) (delete-region 1 8) (goto-char (point-max))) Point should now be at the end of an `sql-mode' buffer containing "'''" (three apostrophes). 4. Press backspace to erase the third apostrophe. 5. M-: (nth 3 (syntax-ppss)) RET Expected result: fourth element of syntax-ppss, the delimiter character for the current string, is nil, since we are no longer in a string Observed result: fourth element is ?' (39), indicating that point is still inside a string My first guess is that this is related to commit 289d6b2265e and #40231. I came across this while trying to get back something resembling the behavior of `electric-pair-mode', and in particular `electric-pair-skip-self', as it was prior to 289d6b2265e. I'm almost there, but I ran into the above bug and got stuck. Kind regards, Dale In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.6.0, NS = appkit-1894.60 Version 10.15.7 (Build 19H15)) of 2020-11-14 built on dale Repository revision: 99cbb313a3fd037b55ad3700635f607f56b0fa3e Repository branch: feature/native-comp Windowing system distributor 'Apple', version 10.3.1894 System Description: Mac OS X 10.15.7 Configured using: 'configure --without-x --with-modules --with-threads --with-xwidgets --with-zlib --with-xml2 --with-json --with-cairo --with-gnutls --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-rsvg --with-nativecomp --with-ns --enable-ns-self-contained 'CFLAGS=3D-O2 -I/opt/local/include/gcc10' LDFLAGS=3D-L/opt/local/lib/gcc10' Configured features: PNG RSVG GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS XIM NS MODULES NATIVE_COMP THREADS XWIDGETS JSON PDUMPER LCMS2 Important settings: value of $LC_COLLATE: C value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: SQL[ANSI] Minor modes in effect: tooltip-mode: t global-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 rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils sql auth-source eieio eieio-core eieio-loaddefs password-cache json map view thingatpt comint ansi-color ring comp warnings subr-x rx cl-seq cl-macs cl-extra help-mode easymenu seq byte-opt gv cl-loaddefs cl-lib bytecomp byte-compile cconv tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win 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 button loaddefs faces cus-face pcase macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads xwidget-internal kqueue cocoa ns lcms2 multi-tty make-network-process nativecomp emacs) Memory information: ((conses 16 83359 5743) (symbols 48 8493 1) (strings 32 23422 3672) (string-bytes 1 888517) (vectors 16 16669) (vector-slots 8 316241 15044) (floats 8 29 23) (intervals 56 234 0) (buffers 992 13)) From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 16 17:43:19 2020 Received: (at 44653) by debbugs.gnu.org; 16 Nov 2020 22:43:19 +0000 Received: from localhost ([127.0.0.1]:57639 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kenDT-00048t-5b for submit@debbugs.gnu.org; Mon, 16 Nov 2020 17:43:19 -0500 Received: from quimby.gnus.org ([95.216.78.240]:39924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kenDR-00048e-7I for 44653@debbugs.gnu.org; Mon, 16 Nov 2020 17:43:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jmdtSeFJllKxUJM+5dvIREgqQomjhJlByI6xq3UZ3H0=; b=jlgoyTi4qOeWR4IvZh8gqbdaM6 A8BNrHBUfg6wI4Ws8Ic1joN0nGzwe+NBpSuaqh/gSsqFt7Zp9BcdlCn2lncqKPDm8Jg08ODQEDkWu IgYEFIocXtaCN6QpwkFpYd26/rUECH4kFETV1Wa2eNCZ0wWA7QuXzNX8L9Zpf1rqt8zU=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kenD8-0006er-5J; Mon, 16 Nov 2020 23:43:10 +0100 From: Lars Ingebrigtsen To: Florian v. Savigny Subject: Re: bug#44653: 28.0.50; sql-mode gets confused about string literals References: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> X-Now-Playing: Various's _Amchitka (2)_: "Joni Mitchell - A Case Of You" Date: Mon, 16 Nov 2020 23:42:56 +0100 In-Reply-To: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> (Dale Sedivec's message of "Sun, 15 Nov 2020 00:37:08 -0600") Message-ID: <874klovs7j.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Dale Sedivec writes: > 2. Evaluate the following in *scratch*: > > (let ((buf (generate-new-buffer "sql"))) > (switch-to-buffer buf) > (sql-mode) > (insert "select '''") > (goto-char 1) > (delete-region 1 8) > (goto-char [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44653 Cc: 44653@debbugs.gnu.org, Dale Sedivec X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dale Sedivec writes: > 2. Evaluate the following in *scratch*: > > (let ((buf (generate-new-buffer "sql"))) > (switch-to-buffer buf) > (sql-mode) > (insert "select '''") > (goto-char 1) > (delete-region 1 8) > (goto-char (point-max))) > > Point should now be at the end of an `sql-mode' buffer containing > "'''" (three apostrophes). > > 4. Press backspace to erase the third apostrophe. > > 5. M-: (nth 3 (syntax-ppss)) RET > > Expected result: fourth element of syntax-ppss, the delimiter character > for the current string, is nil, since we are no longer in a string > > Observed result: fourth element is ?' (39), indicating that point is > still inside a string > > My first guess is that this is related to commit 289d6b2265e and #40231. Yes, sounds likely. I've added Florian to the Cc's -- perhaps he has some comments here. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 26 22:57:52 2021 Received: (at 44653) by debbugs.gnu.org; 27 Jan 2021 03:57:52 +0000 Received: from localhost ([127.0.0.1]:43259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4bxo-0006e9-I6 for submit@debbugs.gnu.org; Tue, 26 Jan 2021 22:57:52 -0500 Received: from quimby.gnus.org ([95.216.78.240]:35700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4bxm-0006ds-6L for 44653@debbugs.gnu.org; Tue, 26 Jan 2021 22:57:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=wWXNxksvvWJ0v4IP4QfYTQ9mxppQkGvWgmmzEMraDpg=; b=Zkd9ivjdFnYTn4+1JgusN6aMNA JxVhryAkbUakLR2u8QOIuqNU79DnW90nKdt5V1+fSb8zwWEPMboPyRGFI/HrVXj5zdY+mfky/l7sZ D4DQ/cFByeFBUdAQgweE9Wgzf+XRL8ZPQutC3c0H7BMTkdw9w3qeTELC63uE8OfcOhO8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4bxS-0000tz-HU; Wed, 27 Jan 2021 04:57:42 +0100 From: Lars Ingebrigtsen To: Dale Sedivec Subject: Re: bug#44653: 28.0.50; sql-mode gets confused about string literals References: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> X-Now-Playing: Purr's _Whales Lead to the Deep Sea_: "Schoolyard" Date: Wed, 27 Jan 2021 04:57:29 +0100 In-Reply-To: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> (Dale Sedivec's message of "Sun, 15 Nov 2020 00:37:08 -0600") Message-ID: <87o8hbc9qu.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Dale Sedivec writes: > I think `syntax-ppss' has started returning incorrect information about > apostrophe-delimited strings in sql-mode in master. I am actually on > native-comp with this afternoon's master merged in my [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44653 Cc: 44653@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dale Sedivec writes: > I think `syntax-ppss' has started returning incorrect information about > apostrophe-delimited strings in sql-mode in master. I am actually on > native-comp with this afternoon's master merged in myself, but I am > fairly confident you can reproduce this on master, nothing to do with > native-comp. > > Steps to reproduce: > > 1. emacs -Q > > 2. Evaluate the following in *scratch*: > > (let ((buf (generate-new-buffer "sql"))) > (switch-to-buffer buf) > (sql-mode) > (insert "select '''") > (goto-char 1) > (delete-region 1 8) > (goto-char (point-max))) > > Point should now be at the end of an `sql-mode' buffer containing > "'''" (three apostrophes). > > 4. Press backspace to erase the third apostrophe. > > 5. M-: (nth 3 (syntax-ppss)) RET > > Expected result: fourth element of syntax-ppss, the delimiter character > for the current string, is nil, since we are no longer in a string > > Observed result: fourth element is ?' (39), indicating that point is > still inside a string I can reproduce this behaviour... but if I then type, say, "a DEL", then (nth 3 (syntax-ppss)) returns nil. So it seems like syntax-ppss doesn't recompute the status until a new character is inserted... which I think makes sense? Until you've typed something more, Emacs doesn't really know whether we've entered a new syntax state or not here. (I'm also wondering what the actual bug you're experiencing is, since I', guessing you don't go typing M-: (nth 3 (syntax-ppss)) RET at random just for fun. :-)) I've added Stefan M to the CCs; perhaps he has some comments. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 27 13:10:06 2021 Received: (at 44653) by debbugs.gnu.org; 27 Jan 2021 18:10:06 +0000 Received: from localhost ([127.0.0.1]:46063 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4pGY-0005IN-9V for submit@debbugs.gnu.org; Wed, 27 Jan 2021 13:10:06 -0500 Received: from mail-io1-f51.google.com ([209.85.166.51]:34392) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4pGS-0005Hj-Eh for 44653@debbugs.gnu.org; Wed, 27 Jan 2021 13:10:05 -0500 Received: by mail-io1-f51.google.com with SMTP id u17so2827870iow.1 for <44653@debbugs.gnu.org>; Wed, 27 Jan 2021 10:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codefu-org.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=I3blo+BhhIQNm0jvVPQ3yDXiDaTSFFZI1CM6YF5qlAM=; b=rP8WxR9dM1z9ipDoY3w5i5y+QExLPIbLbL6eeGyeEAEsQUpOkEJBKWSRfa9ktq7/7J d9LB4z4zMnUILPGyBnNgl+asppZUHb81cI/GDDF0O/RhnRRVFznxTjN1FbcsjHbHPG0m Ox2zM5wijjKqtSgDdrsNMndCKIhqn8wP83DGvvqc/TPikNNaUwlEd5sysSFoStBCwIwk R/9cM/GDuvX5taYFxIeads5WXRT7Gg2Xj4UboFBxBnGGwb4DhALRSH4dMJfXpvHUJg+M i8aZg/UkaWcvb1ZFkXJMShnL6ewIkhB98HfgTXTM1YzjSei3TgnuxZGaQzfFHsLpLge0 Ab5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=I3blo+BhhIQNm0jvVPQ3yDXiDaTSFFZI1CM6YF5qlAM=; b=cNsOZBVA0LHzgLeT9GXmKteaiDSGwMzLFXCNvtT2exOXs/HbW2IH6SYKUtYV5zixzK ORW8sU2Q6Z3u+DDxfA8Q3nXZhFkhWVpyE1o39eDMbutKxt5ia+UmvNvbElQKvL6kwvgJ zhQPwN1u7w8OZo3tBNwGK33EC26PRWi6sTmtaqLYt4LL+dVE8gI2678VWfvidVbU75sW sHUnQ9f4elBY4SxdELUunp2bMD/h5fUip9wwRcSbzvuW+Jzhxs+xFVZMZ3pxJ+EoEV3p jBoIIEEC2YsxE8+oDaCQCoXHnaq/eMkk4iR4rAlpuvajmXza3fJcsLl9bMe62mjM5umf ydhw== X-Gm-Message-State: AOAM5321RqiJsNvKcrf/0LOhQJZHT92jTlhPKLfQdgXAZGSsL1JDx8Ft UtI8sdZnSy4qGp2hSRtxASOLpQ== X-Google-Smtp-Source: ABdhPJxUjDO58JKdUaNpFw1Pbe/5brXkOij3/yriXB2WvcarlwhSY/h7ieJlw8kt3Zr6zmgcOBz68Q== X-Received: by 2002:a6b:681a:: with SMTP id d26mr8356485ioc.144.1611770994590; Wed, 27 Jan 2021 10:09:54 -0800 (PST) Received: from dale.caliginous.net (152.160.30.136.in-addr.arpa. [136.30.160.152]) by smtp.gmail.com with ESMTPSA id l7sm1355790iln.74.2021.01.27.10.09.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jan 2021 10:09:54 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: bug#44653: 28.0.50; sql-mode gets confused about string literals From: Dale Sedivec In-Reply-To: <87o8hbc9qu.fsf@gnus.org> Date: Wed, 27 Jan 2021 12:09:52 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <46E97503-64A9-4B54-ADA7-C71F7F39FB5B@codefu.org> References: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> <87o8hbc9qu.fsf@gnus.org> To: Lars Ingebrigtsen X-Mailer: Apple Mail (2.3445.104.17) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44653 Cc: 44653@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Jan 26, 2021, at 21:57, Lars Ingebrigtsen wrote: > Dale Sedivec writes: >=20 >> I think `syntax-ppss' has started returning incorrect information = about >> apostrophe-delimited strings in sql-mode in master. [...] >>=20 >> Steps to reproduce: >>=20 >> 1. emacs -Q >>=20 >> 2. Evaluate the following in *scratch*: >>=20 >> (let ((buf (generate-new-buffer "sql"))) >> (switch-to-buffer buf) >> (sql-mode) >> (insert "select '''") >> (goto-char 1) >> (delete-region 1 8) >> (goto-char (point-max))) >>=20 >> Point should now be at the end of an `sql-mode' buffer containing >> "'''" (three apostrophes). >>=20 >> 4. Press backspace to erase the third apostrophe. >>=20 >> 5. M-: (nth 3 (syntax-ppss)) RET >>=20 >> Expected result: fourth element of syntax-ppss, the delimiter = character >> for the current string, is nil, since we are no longer in a string >>=20 >> Observed result: fourth element is ?' (39), indicating that point is >> still inside a string >=20 > I can reproduce this behaviour... but if I then type, say, "a DEL", > then (nth 3 (syntax-ppss)) returns nil. >=20 > So it seems like syntax-ppss doesn't recompute the status until a new > character is inserted... which I think makes sense? Until you've = typed > something more, Emacs doesn't really know whether we've entered a new > syntax state or not here. Thanks for looking at this. Do I correctly understand your statement to mean that parse state is = only updated when characters are added to a buffer, not when characters = are deleted? If so, that would indeed seem to mean that this is not a = bug. I tested something similar in a python-mode buffer, and indeed = syntax-ppss still thinks it's in a string when I delete an apostrophe, = just as in the above example. It's possible I just missed that = explanation in the manual. If things are working as expected, please feel free to close this. It's = probably inconvenient that syntax parsing can't be relied upon after = deleting characters, but I can imagine that changing this is not simple. > (I'm also wondering what the actual bug you're experiencing is, since > I', guessing you don't go typing M-: (nth 3 (syntax-ppss)) RET at = random > just for fun. :-)) [...] While acknowledging that I sometimes forget the names of my family = members: I *think* I was trying to change how apostrophe (') behaves in = sql-mode buffers with electric-pair-mode turned on. In case it helps, = or you're just curious, specifics follow. #40231 (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D40231) made a = change to the syntax of apostrophe in an SQL string, which made = electric-pair-mode behave in a way I did not appreciate. While writing = code to make ' behave in the way I expected, I ran into difficulties due = to the behavior of syntax-ppss I described in my original message. To demonstrate what I was trying to change: 1. Create an sql-mode buffer with electric-pair-mode turned on 2. Type ', which results in '|' with point at | 3. Type ' again Desired behavior, and pre-40231's patch behavior (IIRC): ''| with point = at | Post-40231 behavior: ''|' I wanted the pre-40231 behavior. Here's what I'm currently using to achieve the pre-40231 behavior (it = ain't pretty and I'm struggling to remember why the third cond clause is = there): ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D40231 ;; ;; In addition to test case in comment below, also try '''''' at BOB ;; and try inserting ' at BOB with '' in front of point. Also make ;; sure apostrophes don't pair in comments. (defun my:sql-mode-electric-apostrophe (arg) (interactive "P") (cond ((or (not electric-pair-mode) arg) (call-interactively #'self-insert-command)) ((and (eq (char-after) ?') (eq (nth 3 (syntax-ppss)) ?')) ;; We were already at a string, and the character after point is ;; an apostrophe. Just move beyond it. (Behavior changed after ;; changes from Emacs bug #40231.) (forward-char 1)) ;; XXX I have no idea if any of this makes sense if/when ;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D44653 gets fixed. ;; Check back then. I think `self-insert-command' should be ;; sufficient, but ISTR I had to avoid using it in this case ;; because elec-pair was confounding me? I don't quite remember. ((and (eq (char-before) ?') (not (nth 3 (progn ;; (syntax-ppss-flush-cache (- (point) 2)) (syntax-ppss))))) ;; (self-insert-command 1) (insert "'") (save-excursion (electric-pair--insert ?'))) (t (self-insert-command 1)))) (with-eval-after-load 'sql (define-key sql-mode-map "'" #'my:sql-mode-electric-apostrophe)) Dale= From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 27 23:36:13 2021 Received: (at 44653) by debbugs.gnu.org; 28 Jan 2021 04:36:13 +0000 Received: from localhost ([127.0.0.1]:46738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4z2T-0001hR-9Y for submit@debbugs.gnu.org; Wed, 27 Jan 2021 23:36:13 -0500 Received: from quimby.gnus.org ([95.216.78.240]:57426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4z2Q-0001hA-6q for 44653@debbugs.gnu.org; Wed, 27 Jan 2021 23:36:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=aXD0gu7rOxQz5IfH0QGMNdcvcZkzqQQL7FSGbBvEXsI=; b=WJgsuy0SVItTpsX5ozF1/u2xPJ wkl6WlJcUcweEf96xgV2YFPLM94EDQB3XjY0Rq4BeHfmCH7BH2nv46zaeXyYELVWCr8WGyuq714CA MNiWTSW25ED5Tgoqx7xPxy2fDcSImSACG9TzNJVDE4zoeKYglAEiuDY19ZY92hUYmfZc=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4z2B-00043u-Js; Thu, 28 Jan 2021 05:36:02 +0100 From: Lars Ingebrigtsen To: Dale Sedivec Subject: Re: bug#44653: 28.0.50; sql-mode gets confused about string literals References: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> <87o8hbc9qu.fsf@gnus.org> <46E97503-64A9-4B54-ADA7-C71F7F39FB5B@codefu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUGAwcrFBlTJyRN OkqyZlv///9+FC8BAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UBHAQbL6gcvxkAAAGpSURBVDjLtZRr coMwDIQtcgGv6AGw4ADBzgUCvv+ZugJSDO3fesaTiT9LWutBCP+wIFFSCHI7FomA5vjHfQAJ6UL8 D4hSglnyk2drwmU5mbnfuQURmrKZ0b5vFQhEl9Hg4HGJbmmqtSa9AVEzB0sDpAXVhh/QuWKxAyTq feyv6fgzdMd5nRvgFh9PdUEMj+cZYwNL5ZbhA7ZlTMe0OEQKD5xAo0AX0DCmIE0qmanYvUVhYbjU hCHRLVo0tdd3C+urveq7TYdvPvBVFwaPrM9htYHpeMc6sPKU/AHQsW5kfTo4HyKYlum0iE3wcdb3 q9YccZWV1ASexIBw1avQl6f9BsSwg/gbsBlKXe8gKPBVyzRL+Am+p6yP8lVXY6puqljOvmbaQe8A /WqKkfIuo9A9hS1t6NmpF2dsZI4BHzOzyq2wmU3LmvD+DWBbFglyOz+CKGwHWsyasY/PAbA1l8co sBJPT8bJoXtajOjLEUUi+wY+gdw6lpw/wHUmjBm+CewGioPU1+Ku4L22r7GYbaCufO5Mofu5GqeW AnoWrPhlavAPA8USYJodrN+56kiEiSK81QAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wMS0yOFQw NDoyNzo0NyswMDowMFCddbgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDEtMjhUMDQ6Mjc6NDcr MDA6MDAhwM0EAAAAAElFTkSuQmCC X-Now-Playing: Holly Herndon's _PROTO_: "Crawler" Date: Thu, 28 Jan 2021 05:35:54 +0100 In-Reply-To: <46E97503-64A9-4B54-ADA7-C71F7F39FB5B@codefu.org> (Dale Sedivec's message of "Wed, 27 Jan 2021 12:09:52 -0600") Message-ID: <87ft2l65lh.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Dale Sedivec writes: > 1. Create an sql-mode buffer with electric-pair-mode turned on > > 2. Type ', which results in '|' with point at | > > 3. Type ' again > > Desired behavior, and pre-40231's patch behavior (IIRC): '' [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44653 Cc: 44653@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dale Sedivec writes: > 1. Create an sql-mode buffer with electric-pair-mode turned on > > 2. Type ', which results in '|' with point at | > > 3. Type ' again > > Desired behavior, and pre-40231's patch behavior (IIRC): ''| with point at | > > Post-40231 behavior: ''|' Ah, yes, that's definitely a bug. Poking away at this, it seems like the base issue here is that (electric-pair-syntax-info ?') inside 'foo'|' in sql-mode now returns nil instead of (34 39 nil nil), as it did in Emacs 27. (electric-pair-mode works by having the ' inserted first, and then it starts asking for syntax info.) At this point, the new syntax rule in sql mode has decided that 'foo'' we're still in the string, so there's nothing for electric-pair-mode to do. I'm not sure how this should be fixed... Hm... At 'foo''| we're in a string, but 'foo'|' we're probably not? (| marks point.) Perhaps that can be used... somehow... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 27 23:48:18 2021 Received: (at 44653) by debbugs.gnu.org; 28 Jan 2021 04:48:18 +0000 Received: from localhost ([127.0.0.1]:46750 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4zEA-0001yq-73 for submit@debbugs.gnu.org; Wed, 27 Jan 2021 23:48:18 -0500 Received: from quimby.gnus.org ([95.216.78.240]:57526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4zE8-0001yb-DU for 44653@debbugs.gnu.org; Wed, 27 Jan 2021 23:48:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/kxDMoXUPOp+oYm4F31VyzDtR77BRHvkkTj7JH98QMM=; b=kNY3EQUhRbXO4jphEe/kQOrJIX zVbBHlxy6OolPjz+i0hK1bzMUAsyA+g8NdIubSniXOgsVeGfasS+sky/sOlO64mUYBe45lEMBbt4S qrCfYlyb+u9DNYXCUHlzZd+Z831srfluX9798hzNybw/J8AlWhnusKVO9pJbKteu6iw8=; Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4zDv-0004Au-Q1; Thu, 28 Jan 2021 05:48:08 +0100 From: Lars Ingebrigtsen To: Dale Sedivec Subject: Re: bug#44653: 28.0.50; sql-mode gets confused about string literals References: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> <87o8hbc9qu.fsf@gnus.org> <46E97503-64A9-4B54-ADA7-C71F7F39FB5B@codefu.org> <87ft2l65lh.fsf@gnus.org> X-Now-Playing: Holly Herndon's _PROTO_: "SWIM" Date: Thu, 28 Jan 2021 05:48:02 +0100 In-Reply-To: <87ft2l65lh.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 28 Jan 2021 05:35:54 +0100") Message-ID: <87bld96519.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Lars Ingebrigtsen writes: > I'm not sure how this should be fixed... Hm... At > > 'foo''| > > we're in a string, but > > 'foo'|' > > we're probably not? (| marks point.) Perhaps that can be used... > somehow... Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44653 Cc: 44653@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > I'm not sure how this should be fixed... Hm... At > > 'foo''| > > we're in a string, but > > 'foo'|' > > we're probably not? (| marks point.) Perhaps that can be used... > somehow... But we don't have access to that information in the rules, apparently -- syntax-propertize moves point around. Anybody got any ideas here? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 28 04:41:46 2021 Received: (at 44653) by debbugs.gnu.org; 28 Jan 2021 09:41:46 +0000 Received: from localhost ([127.0.0.1]:47291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l53oA-0005L0-Gs for submit@debbugs.gnu.org; Thu, 28 Jan 2021 04:41:46 -0500 Received: from mout.gmx.net ([212.227.15.15]:53383) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l53o8-0005Kj-Tt for 44653@debbugs.gnu.org; Thu, 28 Jan 2021 04:41:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1611826897; bh=LCDOeX4X2cvkh4ECImuQCWqcPVMjcroSXEkJRjCdUEk=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=BtoZYfequ/ItvrGL7+2qBpdgHz24xSoHoU0YvJOJqnTYryPXDai3mcMzmYDPrgW2n R1nSuRNcGW9fXGVQJPC4/uMYYV8yBkGb3VrDl319vkbQwOyw2bvtIUDpAhtCrv2KqQ y6bndHRIqkFqlkm9mSMjVrTOCevK/MuArbrLCcm8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.1.100] ([46.125.249.125]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N7QxL-1m3oq53Iib-017lH1; Thu, 28 Jan 2021 10:41:36 +0100 Subject: Re: bug#44653: 28.0.50; sql-mode gets confused about string literals To: Dale Sedivec , Lars Ingebrigtsen References: <04127C97-3437-4A95-9640-92347FB62FE4@codefu.org> <87o8hbc9qu.fsf@gnus.org> <46E97503-64A9-4B54-ADA7-C71F7F39FB5B@codefu.org> From: martin rudalics Message-ID: Date: Thu, 28 Jan 2021 10:41:35 +0100 MIME-Version: 1.0 In-Reply-To: <46E97503-64A9-4B54-ADA7-C71F7F39FB5B@codefu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:mHzBjdVdYDUwbIvUWcPGWwbjKgyNTkCH3N+u5CcH4lTVR3oLNnW ux6wX1BAUCEhhM43ubXkTZV8WOsvL2rFARKcX1eqcmElnU7UpRrKb23EaltilWIlK8TPVur fq7tieExhtOTNEEF+heJ0E3o3iaZ75wr8qbmVlL82Zra3kZ88DoSDMu5N/O8oZmKRr2j82d LGPAKjHruwSIZ4MiNy/AA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:yMZ5CoGQeMY=:TT+CdEs7cOri2qwhFk4rWo Shf7V3R3SY1ixpSC7E8fg5OtjHGVlkDht8WQs3TbG3yOf0V5RCDGliZJa2e7KYstzSc6YOBvq 8EPupidvQ5zuaw7TbRm/lt485+a+cRD9EyuZ1zglgREqLi6PW/fnCegHe6fErk7c9VNH638ft jq6tsJm0alUgbnZWguSrRdO/2LZCfxu5BuBooNc06i8++aOBJkgaeZiQE3MskOixhZRq9U/an 24zorBtCEYa75OMc+Nb39qIe0T97RKAAfG16KPWFbkl9Ti5Q2CrcMQhP87uBhI9qqAL6RRJS8 2NjhH6D8pz5rM+hOgps17nGhYU3Y4dKakdS1vtb6olTVLtEHTGGEFdPcO77ji3pqMPJsr6NBH DtgGa0gP06H5uTzefgcc0D2thVWaaIukyw+noFmTtrC7lg6hSMYfypKsw1K2wZV6+M03R1M/Z AFmAmZXpwqQodOfAqxMRQdQq8VBsVeYbPzcx2+Lp0tA9sLp6r6Bq2aYmjjppz8P1Jn0UaxXcM G5mSASaJCWwxeCrDBNUiHBVptjArhJivQvXj/wP1NPK6+STTJbgnS9Y/1SdqYYD/vk7GD/nb6 vZAaOAL9+ZA3li1wGTz47OLyJKzUEFzLepJ/MDIhS7K9Hyxm/oZJC9/YGMQfyz/LbGWTHUXOM jUzyEuXkXV1r4aKvl0NshNX0dArEcW7GnLVK8iUIPfJVKCKToAkynKmO9qol5PXoO+l7VWnCg tYEzmZQLolbJMJKz7scQCsAKmLMgpXAnpJqA32/AlTt3Agl6C7XqiSzU2zKo7JUBBrTslcxCA JcYWUG4zlwBAgpp2D2epcgdTd4WuWvRcpaB+jHrOHCWjwD7eZdegQDXfSt4F8YCnZqu1naCso wo7+xaJ5dvw4HKiYgIKA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 44653 Cc: 44653@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > Do I correctly understand your statement to mean that parse state is > only updated when characters are added to a buffer, not when > characters are deleted? The parse state is always updated after any buffer modification that happened in the part before the position for which the state shall be calculated. The problem is, that syntax properties may override the parse state. And combined delimiters are always a pain (IIRC there were discussions here whether in the middle of the C comment delimiters "/*" and "*/" we are already or still in the corresponding comment. martin