unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Brady Trainor <mail@bradyt.com>
To: 31972@debbugs.gnu.org
Subject: bug#31972: 27.0.50; syntax-ppss depth incorrect after font-lock syntax-alist
Date: Mon, 25 Jun 2018 16:26:34 -0700	[thread overview]
Message-ID: <20180625232635.3778010261@mailuser.nyi.internal> (raw)

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 ‘eval-buffer’ with M-x ev-b RET
You can run the command ‘dart-mode’ 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=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs/HEAD-57442b6/share/info/emacs
 --prefix=/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))





             reply	other threads:[~2018-06-25 23:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-25 23:26 Brady Trainor [this message]
2018-06-25 23:59 ` bug#31972: 27.0.50; syntax-ppss depth incorrect after font-lock syntax-alist Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180625232635.3778010261@mailuser.nyi.internal \
    --to=mail@bradyt.com \
    --cc=31972@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).