Commit 5af9fbad authored by Dmitry Gutov's avatar Dmitry Gutov

* lisp/progmodes/js.el (js-indent-line): Don't widen.

http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00276.html
parent 6227467f
2014-02-12 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/js.el (js-indent-line): Don't widen.
http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00276.html
2014-02-12 Glenn Morris <rgm@gnu.org>
* emacs-lisp/package.el (package-menu-mode-map): Tweak menu.
......
......@@ -1905,13 +1905,11 @@ In particular, return the buffer position of the first `for' kwd."
(defun js-indent-line ()
"Indent the current line as JavaScript."
(interactive)
(save-restriction
(widen)
(let* ((parse-status
(save-excursion (syntax-ppss (point-at-bol))))
(offset (- (current-column) (current-indentation))))
(indent-line-to (js--proper-indentation parse-status))
(when (> offset 0) (forward-char offset)))))
(let* ((parse-status
(save-excursion (syntax-ppss (point-at-bol))))
(offset (- (current-column) (current-indentation))))
(indent-line-to (js--proper-indentation parse-status))
(when (> offset 0) (forward-char offset))))
;;; Filling
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment