unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23443: 25.0.93; Temporary change to syntax-table is in effect during syntax-propertize
@ 2016-05-04 10:41 Noam Postavsky
  2016-05-08  0:58 ` Dmitry Gutov
  0 siblings, 1 reply; 16+ messages in thread
From: Noam Postavsky @ 2016-05-04 10:41 UTC (permalink / raw)
  To: 23443

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

On the emacs-25 and master branches, changing the syntax-table
temporarily affects the table used during syntax-propertize. This does
not happen in 24.5 (unless the difference is just a timing thing?).
This triggers an infinite loop when expanding certain snippets with
yasnippet in haskell-mode (see [1] and [2]).

Attached is a simplified reproducer, run as

    emacs -Q -l synprop-bug.el

In Emacs 25+, this results in the message

Error during redisplay: (internal--syntax-propertize 2) signaled
(error "syntax table is changed to standard-syntax-table during syntax
propertize")


In Emacs 24.5, it runs without a problem. It's not entirely clear to
me who should be reponsible for ensuring the right syntax-table during
syntax-propertize.

[1]: https://github.com/capitaomorte/yasnippet/issues/687
[2]: https://github.com/haskell/haskell-mode/issues/1315

[-- Attachment #2: synprop-bug.el --]
[-- Type: text/x-emacs-lisp, Size: 824 bytes --]

(defun test-check-syntax-table (begin end)
  (unless (eq (syntax-table) test-syntax-prop-mode-syntax-table)
    (error "syntax table is changed to %s during syntax propertize"
           (if (eq (syntax-table) (standard-syntax-table))
               'standard-syntax-table
             'other-syntax-table))))

(define-derived-mode test-syntax-prop-mode prog-mode "TestSyntaxProp"
  "A mode for testing syntax-propertize bug(?)."
  (setq-local syntax-propertize-function #'test-check-syntax-table)
  (setq-local font-lock-defaults
              '(nil nil nil nil nil
                (font-lock-syntactic-face-function . ignore)
                (parse-sexp-lookup-properties . t))))

(switch-to-buffer "tt")
(test-syntax-prop-mode)
(erase-buffer)
(insert "foo")
(with-syntax-table (standard-syntax-table)
  (scan-sexps 1 1))

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-05-16 18:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 10:41 bug#23443: 25.0.93; Temporary change to syntax-table is in effect during syntax-propertize Noam Postavsky
2016-05-08  0:58 ` Dmitry Gutov
2016-05-08 18:51   ` Noam Postavsky
2016-05-08 18:53     ` Dmitry Gutov
2016-05-08 18:58       ` Noam Postavsky
2016-05-08 19:12         ` Dmitry Gutov
2016-05-12 10:05           ` Noam Postavsky
2016-05-13  5:49             ` Andreas Röhler
2016-05-16 18:28               ` Dmitry Gutov
2016-05-13  5:55             ` Andreas Röhler
2016-05-10 17:34   ` Andreas Röhler
2016-05-10 20:42     ` Dmitry Gutov
2016-05-11  5:20       ` Andreas Röhler
2016-05-11  9:20         ` Dmitry Gutov
2016-05-11 12:13           ` Andreas Röhler
2016-05-11 12:31             ` Dmitry Gutov

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).