From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#31972: 27.0.50; syntax-ppss depth incorrect after font-lock syntax-alist Date: Mon, 25 Jun 2018 19:59:22 -0400 Message-ID: <87lgb2pgdh.fsf@gmail.com> References: <20180625232635.3778010261@mailuser.nyi.internal> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1529971092 13567 195.159.176.226 (25 Jun 2018 23:58:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 25 Jun 2018 23:58:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 31972@debbugs.gnu.org To: Brady Trainor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 26 01:58:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fXbN0-0003Py-A5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 26 Jun 2018 01:58:06 +0200 Original-Received: from localhost ([::1]:49794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXbP7-00047f-H0 for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jun 2018 20:00:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXbOy-000457-Aw for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 20:00:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXbOt-00015q-Bu for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 20:00:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55795) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXbOt-000151-7Y for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 20:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fXbOs-0005EC-SV for bug-gnu-emacs@gnu.org; Mon, 25 Jun 2018 20:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Jun 2018 00:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31972 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 31972-submit@debbugs.gnu.org id=B31972.152997117120025 (code B ref 31972); Tue, 26 Jun 2018 00:00:02 +0000 Original-Received: (at 31972) by debbugs.gnu.org; 25 Jun 2018 23:59:31 +0000 Original-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 Original-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 Original-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) Original-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) In-Reply-To: <20180625232635.3778010261@mailuser.nyi.internal> (Brady Trainor's message of "Mon, 25 Jun 2018 16:26:34 -0700") 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: 208.118.235.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:147824 Archived-At: 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 ">"))