From unknown Fri Jun 20 07:12:28 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#31972 <31972@debbugs.gnu.org> To: bug#31972 <31972@debbugs.gnu.org> Subject: Status: 27.0.50; syntax-ppss depth incorrect after font-lock syntax-alist Reply-To: bug#31972 <31972@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:12:28 +0000 retitle 31972 27.0.50; syntax-ppss depth incorrect after font-lock syntax-a= list reassign 31972 emacs submitter 31972 Brady Trainor severity 31972 normal tag 31972 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 25 19:31:37 2018 Received: (at submit) by debbugs.gnu.org; 25 Jun 2018 23:31:37 +0000 Received: from localhost ([127.0.0.1]:35429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXaxM-00048H-Q7 for submit@debbugs.gnu.org; Mon, 25 Jun 2018 19:31:37 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXasl-0002Rp-8u for submit@debbugs.gnu.org; Mon, 25 Jun 2018 19:26:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXase-0007nm-JY for submit@debbugs.gnu.org; Mon, 25 Jun 2018 19:26:46 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fXase-0007ng-FD for submit@debbugs.gnu.org; Mon, 25 Jun 2018 19:26:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXasc-0007qv-ML for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 19:26:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXasX-0007kn-LQ for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 19:26:42 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:39313) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fXasX-0007k0-Es for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 19:26:37 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B2C7621CA8; Mon, 25 Jun 2018 19:26:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 25 Jun 2018 19:26:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=DrDI8guJoaGt9ZuACMudpwP9Mot8a HUME/1LXW/h9aE=; b=KWIKZ/qSu9Cn71oBpTMn/HUSOigaXw0gA+DMueAx8A+kD hfxRj95YRuY3xDW69oqrOq9QoDLY7awaVzJKzRdDQ/Ug4Rs6UxSTb1Ly2fqHX6Q3 fbO91qEL/yyvgLuhQLvvOysAoAAfztB4b57JE3uqw6PrIN4MvVugWe28d6sWyw0j NjyR3UZHxDcQqwVKLXFllm1abd6l1hBrlatd3uJ05tu7Ii4+sLzp3XASVvmF82Kz iKw3drmDagbhwEOQ9p/uYfXlIyxF8jzmWAOHqzyUI9IxFMqtr+W2bdCmRsV2PNSB IRwiNcjcgeNV61cvdyihvDhuMSm88quH/CFXSXrdA== X-ME-Proxy: X-ME-Sender: From: Brady Trainor To: bug-gnu-emacs@gnu.org Subject: 27.0.50; syntax-ppss depth incorrect after font-lock syntax-alist Date: Mon, 25 Jun 2018 16:26:34 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-Id: <20180625232635.3778010261@mailuser.nyi.internal> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 25 Jun 2018 19:31:36 -0400 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: -5.1 (-----) After `emacs -Q`, I open a file with --8<---------------cut here---------------start------------->8--- (define-derived-mode dart-mode prog-mode "Dart" "" (setq comment-start "//") (setq comment-end "") (setq font-lock-defaults '(nil nil nil ((?/ . "_ 12") (?\n . ">")))) ;; (modify-syntax-entry ?/ "_ 12") ;; (modify-syntax-entry ?\n ">") ) (provide 'dart-mode) --8<---------------cut here---------------end--------------->8--- I open a file and `M-x dart-mode RET`, with contents say --8<---------------cut here---------------start------------->8--- // A comment (with a parenthesized // note). --8<---------------cut here---------------end--------------->8--- Then with point on beginning of second line, I try `M-: (car (syntax-ppss)) RET` and find that depth is reported as 1, rather than 0. If I comment out the `font-lock-defaults` expression and instead use `modify-syntax-entry` expressions, I get depth 0 throughout. I did not look much further for some clarification in `font-lock`, as it did not seem right to me. You may ask why do I need `syntax-ppss` to report no depth change in comments? I currently intend to use `syntax-ppss` for an `indent-line-function`. Thank you for considering this! -- Brady In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin17.4.0, NS appkit-1561.20= Version 10.13.3 (Build 17D102)) of 2018-04-11 built on iams-MacBook-Air.local Repository revision: 57442b6812e9ec565efc39f722e84079dd71d8c0 System Description: Mac OS X 10.13.3 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... [3 times] You can run the command =E2=80=98eval-buffer=E2=80=99 with M-x ev-b RET You can run the command =E2=80=98dart-mode=E2=80=99 with M-x dar RET (1 145 188 nil nil nil 0 nil nil (145) nil) Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=3D/usr/local/share/emacs/site-lisp --infodir=3D/usr/local/Cellar/emacs/HEAD-57442b6/share/info/emacs --prefix=3D/usr/local/Cellar/emacs/HEAD-57442b6 --without-x --with-xml2 --with-dbus --with-gnutls --with-imagemagick --with-modules --with-rsvg --without-pop --with-ns --disable-ns-self-contained' Configured features: RSVG IMAGEMAGICK DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Dart Minor modes in effect: diff-auto-refine-mode: t 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 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 seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils dart-mode derived vc-git diff-mode easymenu easy-mmode term/screen term/xterm xterm time-date elec-pair 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 menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame 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 minibuffer 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 dbusbind kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 212690 10486) (symbols 48 20527 1) (miscs 40 37 176) (strings 32 30827 1661) (string-bytes 1 811691) (vectors 16 33744) (vector-slots 8 683017 8048) (floats 8 53 623) (intervals 56 318 0) (buffers 992 14)) From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 25 19:59:31 2018 Received: (at 31972) by debbugs.gnu.org; 25 Jun 2018 23:59:31 +0000 Received: from localhost ([127.0.0.1]:35459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXbON-0005Co-5l for submit@debbugs.gnu.org; Mon, 25 Jun 2018 19:59:31 -0400 Received: from mail-qk0-f181.google.com ([209.85.220.181]:33149) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXbOL-0005CX-SS; Mon, 25 Jun 2018 19:59:30 -0400 Received: by mail-qk0-f181.google.com with SMTP id c131-v6so8581049qkb.0; Mon, 25 Jun 2018 16:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+LJPvWZ3as7QvcfsznTg05x8Pl0myQwnUdEWzQf9Uns=; b=rnMYKvnSEUeFO4F76vYIhjaHQJIY34mIAqYjlkE2uFkT3UMYyNmg7YF8yrQrylw5g/ IuUUcKTC7Y2HY3TB/ujpqNn4GFWTSwz8ddoLd3RRtrVbQNsaugDebVJGehurutUPuK8H 0NcVMl/Szfv0v/wJ0PLmMP6s3VjAhGPfMHOBlQPdaDqnvEj0e0ARF5y2NL8NMZbZFtv8 bauRQxxsLnav3nNeN1zwyuOCIRAQCsa2fnRNAcdf66zjd2iq3s8+0Jm4d8PqE8g3dRZr C9C3ZiNoYWJZqDuobEPgpQjaMIAnAGf45n8z48d/JqRNXFkp08qq17XKnO/dRqDA6F6k 1plA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+LJPvWZ3as7QvcfsznTg05x8Pl0myQwnUdEWzQf9Uns=; b=nGOlHJsrkIe5BwiBvTuhUKy+766Fu7kaua4QJQXBT5XnjqVHuoYgfodxVR4IznaWp1 yCD8mhcDoxAk0almrS1yGoeqwFFNVBVNXX6cAlhPJI2eLoiK1GEAJxghCaEhA5C30Hn6 X/IPwapwqYNJNRu5tYYiakp1t6sa3RH4H7EIuZnWqWkNqMloLwvmW1QYqFmhHzzQ9IRc dVI0GXKlHF37tippVF+jhJ0DtraHHClZcfWTTxYkz9ANPv4uH9++CgsFswE5x+Ru7Bn/ MbbvR+Te7hGfnwW2dZ0og6O+klOapAEc2pUlp95rcdY0vcntSFlU/rx6PZl0fgwtFxcS Z4cw== X-Gm-Message-State: APt69E1rft4/tpyG1DsiObTY+202eoKl7qBrThQLxJOcYRFMqZbwwUJ/ 7GJJkEVA3eCnBK4eBA8TFAEzsQ== X-Google-Smtp-Source: ADUXVKKyvGfKe9IaYlDa+/iG0jvSoLrvPtdooyJn74OUINOq1EjtlAiut0X842pQCjGuO5bDGJQubg== X-Received: by 2002:a37:670c:: with SMTP id b12-v6mr12205113qkc.108.1529971164034; Mon, 25 Jun 2018 16:59:24 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id b62-v6sm209615qkj.48.2018.06.25.16.59.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jun 2018 16:59:23 -0700 (PDT) From: Noam Postavsky To: Brady Trainor Subject: Re: bug#31972: 27.0.50; syntax-ppss depth incorrect after font-lock syntax-alist References: <20180625232635.3778010261@mailuser.nyi.internal> Date: Mon, 25 Jun 2018 19:59:22 -0400 In-Reply-To: <20180625232635.3778010261@mailuser.nyi.internal> (Brady Trainor's message of "Mon, 25 Jun 2018 16:26:34 -0700") Message-ID: <87lgb2pgdh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31972 Cc: 31972@debbugs.gnu.org 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 (-) tags 31972 + notabug quit Brady Trainor writes: > (define-derived-mode dart-mode prog-mode "Dart" > "" > (setq comment-start "//") > (setq comment-end "") > (setq font-lock-defaults '(nil nil nil ((?/ . "_ 12") > (?\n . ">")))) > ;; (modify-syntax-entry ?/ "_ 12") > ;; (modify-syntax-entry ?\n ">") > ) > I open a file and `M-x dart-mode RET`, with contents say > > // A comment (with a parenthesized > // note). > > Then with point on beginning of second line, I try `M-: (car > (syntax-ppss)) RET` and find that depth is reported as 1, rather than 0. > If I comment out the `font-lock-defaults` expression and instead use > `modify-syntax-entry` expressions, I get depth 0 throughout. That looks all correct to me. In the first case, the "//" doesn't start a comment, it's only fontified as if it starts a comment. So of course when you're inside a paren you'll see depth 1. In the second case, you set "//" as a comment start, so you see depth 0. I think you want (define-derived-mode dart-mode prog-mode "Dart" "" (setq comment-start "//") (setq comment-end "") (setq font-lock-defaults '(nil nil nil nil)) ; Same as '(nil). (modify-syntax-entry ?/ "_ 12") (modify-syntax-entry ?\n ">")) From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 09 20:51:27 2018 Received: (at control) by debbugs.gnu.org; 10 Jul 2018 00:51:27 +0000 Received: from localhost ([127.0.0.1]:52890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fcgsJ-00031k-1v for submit@debbugs.gnu.org; Mon, 09 Jul 2018 20:51:27 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:35411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fcgsI-00031Z-8p for control@debbugs.gnu.org; Mon, 09 Jul 2018 20:51:26 -0400 Received: by mail-it0-f50.google.com with SMTP id l16-v6so29023323ita.0 for ; Mon, 09 Jul 2018 17:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=auHqOnRVmB0e9cXZ3Hda+XlXz0qAy4qvU4BnVfmU/g0=; b=iGLZU1Yx7P+g0r/JhI0LJYskXcI/CWBGyXrViHdKMLGmCxs5WTVZja6uQC7r7JSiK2 CzmlG1ZBA4z7YQldwcVZF7CVgS81MxNlQqac7Y3C2K0k2bSdgWy0aQtzmp71gM1DIIYU wap2DBlBKHcAo+Dvk+XvHoHJWiiI6qG2rQzGwlMiMRBRHQAsxHXSC2FMRO6WVBQtdGv+ vIDu8WQRVPp/qWqfIqiulqXuTYTLKw9ukcthNsFoh5m92w9k40GMVEO2oXECLnmH0zP1 iyqfuLe9r8EWt2PsWlMB/+iWnSSHWYiJ/mrllDgDMs7EK9cVuPtN7AehmjcqN9bqitzm lH+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=auHqOnRVmB0e9cXZ3Hda+XlXz0qAy4qvU4BnVfmU/g0=; b=rLyUtSixBrBm+aC/DTIDPub9ZGiv70Ap56DBbTE8mdtS02kqgusnGRToxvc3oPscTj qbB5t34gDpcCVrNk+RB1m7NeC4pYioS//xhdp8jzpht/qveykldCRLHMQIxBSi/PcrxJ CGDTb3ATggyzRCFOo46nXWbdwSnJ+k3TKbcoRgoJBcet9AKDnMRgfOVAqwVrPaLwWMtp fGmjkORJLxE8aF+gk73LLCO5vj9K/D1lo1LRrPdJKEqGzzpg5fh2Zb+E0MO/0tSiPV2G hK6lgAO12dMEw4GkxF4tOaxfAjhFsR1WCd45qwhwrG3kBLmSJfn2k1gxcu27lYnXUocP Gbog== X-Gm-Message-State: APt69E06SHG+r19tBBwDJTMg9zF+LWlLv3JMtTnZe1vxmYxZgPWPhzk3 wvu/+QqusuMjeRfVke7mUxuG7Q== X-Google-Smtp-Source: AAOMgpdF3xKz0FQz5qwCuEu60ZtXnM+f+DGKC8+TU4HEH1y0jgzgb2osd1GHdy2DyEzukocX3iDWig== X-Received: by 2002:a02:fd6:: with SMTP id 83-v6mr19185196jao.35.1531183880596; Mon, 09 Jul 2018 17:51:20 -0700 (PDT) Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id x6-v6sm4754830ith.1.2018.07.09.17.51.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jul 2018 17:51:20 -0700 (PDT) From: Noam Postavsky To: control@debbugs.gnu.org Subject: control message for bug #31972 Date: Mon, 09 Jul 2018 20:51:19 -0400 Message-ID: <87fu0rdibc.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control 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 (-) close 31972 quit From unknown Fri Jun 20 07:12:28 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 Aug 2018 11:24:05 +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