]> git.eshelyaron.com Git - emacs.git/commit
Add new `lisp-indent-region' that doesn't reparse the code.
authorNoam Postavsky <npostavs@gmail.com>
Thu, 16 Mar 2017 02:27:27 +0000 (22:27 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 22 Apr 2017 18:09:58 +0000 (14:09 -0400)
commit4713dd425beac5cb459704e67dcb8f6faf714375
tree5f3ba3603a4bc724180d9b872b50c183c39a664b
parent2f6769f9cdb799e880fdcc09057353a0a2349bfc
Add new `lisp-indent-region' that doesn't reparse the code.

Both `lisp-indent-region' and `lisp-indent-line' now use `syntax-ppss'
to get initial state, so they will no longer indent string literal
contents.

* lisp/emacs-lisp/lisp-mode.el (lisp-ppss): New function, like
`syntax-ppss', but with a more dependable item 2.
(lisp-indent-region): New function, like `indent-region-line-by-line'
but additionally keep a running parse state to avoid reparsing the
code repeatedly.  Use `lisp-ppss' to get initial state.
(lisp-indent-line): Take optional PARSE-STATE argument, pass it to
`calculate-lisp-indent', use `lisp-ppss' if not given.
(lisp-mode-variables): Set `indent-region-function' to
`lisp-indent-region'.
lisp/emacs-lisp/lisp-mode.el