unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18826: 24.3.94; c++-mode bad indentation after programmatic insert with locally changed syntax table
@ 2014-10-25 14:25 Dmitry Gutov
       [not found] ` <mailman.12024.1414247237.1147.bug-gnu-emacs@gnu.org>
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Dmitry Gutov @ 2014-10-25 14:25 UTC (permalink / raw)
  To: 18826

I think the following should be harmless. Why does it result in broken
indentation?

1. Open in c++-mode buffer with following contents:

int main(int argc, char** argv) {
  fgets(0, 1, 2);
}

2. Add an empty line after the semicolon, move cursor there, and
evaluate this:

(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)"))

3. Press `;', see the indentation of the current line change, and
include (erroneously) two extra spaces:

int main(int argc, char** argv) {
  fgets(0, 1, 2);
    fgets(0, 1, 2);
}

Originally: https://github.com/company-mode/company-mode/issues/212

In GNU Emacs 24.3.94.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8)
 of 2014-10-06 on axl
Repository revision: 117555 sdl.web@gmail.com-20141005005838-oyl694hqhu2d3632
Windowing system distributor `The X.Org Foundation', version 11.0.11501000
System Description:	Ubuntu 14.04.1 LTS





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

end of thread, other threads:[~2014-10-27 10:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-25 14:25 bug#18826: 24.3.94; c++-mode bad indentation after programmatic insert with locally changed syntax table Dmitry Gutov
     [not found] ` <mailman.12024.1414247237.1147.bug-gnu-emacs@gnu.org>
2014-10-25 19:34   ` Alan Mackenzie
2014-10-25 22:45     ` Dmitry Gutov
     [not found] ` <mailman.12048.1414277182.1147.bug-gnu-emacs@gnu.org>
2014-10-25 23:24   ` Alan Mackenzie
2014-10-26 15:09     ` Dmitry Gutov
2014-10-26 17:07       ` Stefan Monnier
2014-10-25 23:25 ` Stefan Monnier
     [not found] ` <jwv61f7ohq0.fsf-monnier+emacsbugs@gnu.org>
2014-10-26 14:56   ` Dmitry Gutov
2014-10-26 14:56   ` Dmitry Gutov
2014-10-26 17:03     ` Stefan Monnier
     [not found] ` <mailman.12080.1414336227.1147.bug-gnu-emacs@gnu.org>
2014-10-26 17:38   ` Alan Mackenzie
2014-10-27  1:06     ` Dmitry Gutov
2014-10-27  8:53       ` Alan Mackenzie
2014-10-27 10:21         ` 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).