|
From: | Dmitry Gutov |
Subject: | bug#18826: 24.3.94; c++-mode bad indentation after programmatic insert with locally changed syntax table |
Date: | Sun, 26 Oct 2014 21:56:30 +0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
On 10/26/2014 06:25 AM, Stefan Monnier wrote:
(with-syntax-table (make-char-table 'syntax-table nil) (modify-syntax-entry ?\( "(") (modify-syntax-entry ?\) ")") (modify-syntax-entry ?< "(") (modify-syntax-entry ?> ")") (insert "fgets(0, 1, 2)"))Why do that?
To include angle brackets in paren syntax class. Basically, we only need to consider these and the straight parens when converting a method definition into a method call with placeholders, so using an otherwise-empty syntax table seemed appropriate when I wrote the above code.
It seems that I should only change the current syntax table only around the `backward-sexp' and `parse-partial-sexp' calls there, but not when doing any text modification.
[Prev in Thread] | Current Thread | [Next in Thread] |