From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#24749: Making sure syntax-propertize is called Date: Mon, 03 Jun 2019 13:47:29 -0400 Message-ID: References: <87ef4awyb6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="116923"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 24749@debbugs.gnu.org To: Vitalie Spinu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 03 19:48:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hXr4A-000UI6-HV for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jun 2019 19:48:14 +0200 Original-Received: from localhost ([127.0.0.1]:38763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXr49-0006Kd-CM for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Jun 2019 13:48:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXr3z-0006KE-Qj for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2019 13:48:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXr3y-00065q-NB for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2019 13:48:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57707) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hXr3y-00065H-HW for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2019 13:48:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hXr3y-0000tA-1f for bug-gnu-emacs@gnu.org; Mon, 03 Jun 2019 13:48:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Jun 2019 17:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24749 X-GNU-PR-Package: emacs Original-Received: via spool by 24749-submit@debbugs.gnu.org id=B24749.15595840593382 (code B ref 24749); Mon, 03 Jun 2019 17:48:01 +0000 Original-Received: (at 24749) by debbugs.gnu.org; 3 Jun 2019 17:47:39 +0000 Original-Received: from localhost ([127.0.0.1]:43018 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXr3a-0000sT-Ts for submit@debbugs.gnu.org; Mon, 03 Jun 2019 13:47:39 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hXr3Z-0000pg-6B for 24749@debbugs.gnu.org; Mon, 03 Jun 2019 13:47:37 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9C9E0443127; Mon, 3 Jun 2019 13:47:31 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 55522443107; Mon, 3 Jun 2019 13:47:30 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1559584050; bh=uGOwa8tWNoT+hmlym0UwC3QRfpBVA8wsPFsZUA2CFBs=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=FYjGclrE1EcxeRlYbMbrslvE2JkrcV9rml0BWCYUDtMxxsqQxA5+B9ku5bOnuM4+/ tI313jtgihJb9Frkr6qV2/aQlELZ/zrT6W/54H7vcPdapmgiHqFNMNFMRNoZE7YhWz u2nwowXFZ8WXPc0TFVOBaWuX2RQF1it/oF9HSVJ9FROBp1fd6XniNhMqAW/VS47ScA ow6GyfcRqnUvB8wfmhIe4Ok4r2wOtmZxGmRwew5j7fLxzpdnJ1UcxsIIL27uG1qMN8 u9XqsOSllTBOpn1Pv0unRWaAo4Q26hSGy32wJDBvMIkxrIhU/H/UfhFizmnnYqa3q/ 0zZpX7XJGf2jw== Original-Received: from ceviche (unknown [45.72.167.35]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 21A7A120B98; Mon, 3 Jun 2019 13:47:30 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Mon, 03 Jun 2019 13:33:34 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:160072 Archived-At: [ Resending after unarchiving the bug. ] > Shouldn't this be pushed (or even backported) to emacs 26? While I clearly think it's an improvement, I don't think it fixes a regression: it's more like it fixes bugs that have been with us for "ever". So, I don't see any urgency. It should be pretty safe, tho, so it's probably OK to add it to emacs-26. It's Eli's call (and given the situation, I think in his shoes I probably would say "I'd rather not"). > Some modes (e.g pascal, perl) don't set parse-sexp-lookup-properties > but have the syntax-propertize-function. This leads to > really-hard-to-debug behavior in batch mode. For some reason in > interactive session parse-sexp-lookup-properties is set to > t (font-lock I guess, and maybe something else). Indeed, font-lock is the most common caller of syntax-propertize, so that explains why interactive use typically is not affected. Note: you can also set parse-sexp-lookup-properties's default value to t and forget about the problem ;-) > Also, it's a bit confusing that many modes do still set > parse-sexp-lookup-properties explicitly: > > lisp/emacs-lisp/syntax.el:293: (set (make-local-variable 'parse-sexp-lookup-properties) t) > lisp/ChangeLog.9:10944: Don't switch the syntax-table. Don't set parse-sexp-lookup-properties. > lisp/ChangeLog.15:7269: Set parse-sexp-lookup-properties buffer-locally here. > lisp/progmodes/cc-defs.el:1996: (setq parse-sexp-lookup-properties t > lisp/progmodes/cc-mode.el:580: (set (make-local-variable 'parse-sexp-lookup-properties) t)) > lisp/progmodes/ruby-mode.el:754: (setq-local parse-sexp-lookup-properties t) > lisp/progmodes/ada-mode.el:1149: (set (make-local-variable 'parse-sexp-lookup-properties) t)) > lisp/progmodes/python.el:5352: (set (make-local-variable 'parse-sexp-lookup-properties) t) > lisp/progmodes/cperl-mode.el:1759: (set (make-local-variable 'parse-sexp-lookup-properties) t) > lisp/progmodes/cperl-mode.el:6762: (set (make-local-variable 'parse-sexp-lookup-properties) t)))) > lisp/font-lock.el:1545: (set (make-local-variable 'parse-sexp-lookup-properties) t)) > lisp/subr.el:1982: ;; `syntax-propertize' sets `parse-sexp-lookup-properties' for us, but > lisp/subr.el:1986: (setq-local parse-sexp-lookup-properties t)) > test/lisp/gnus/message-tests.el:47: (setq-local parse-sexp-lookup-properties t) While this is likely unneeded in several of those matches, it's also harmless. Feel free to remove them in those cases where you can determine it's indeed not needed (typically because you know the code won't be used in Emacs<27). Stefan