aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2014-02-12 08:23:42 +0200
committerDmitry Gutov2014-02-12 08:23:42 +0200
commit5af9fbadd1956fc2c757588763b16031550010f8 (patch)
treef9873fd2866ad1191e6284ad394678155509570c
parent6227467f0b9ca559b711c7a0e744cf97519ac30f (diff)
downloademacs-5af9fbadd1956fc2c757588763b16031550010f8.tar.gz
emacs-5af9fbadd1956fc2c757588763b16031550010f8.zip
* lisp/progmodes/js.el (js-indent-line): Don't widen.
http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00276.html
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/js.el12
2 files changed, 10 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5a7bd6bceb5..fe51d85d1a8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-02-12 Dmitry Gutov <dgutov@yandex.ru>
2
3 * progmodes/js.el (js-indent-line): Don't widen.
4 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00276.html
5
12014-02-12 Glenn Morris <rgm@gnu.org> 62014-02-12 Glenn Morris <rgm@gnu.org>
2 7
3 * emacs-lisp/package.el (package-menu-mode-map): Tweak menu. 8 * emacs-lisp/package.el (package-menu-mode-map): Tweak menu.
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 9ef482e218b..cc9ee8fe67b 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -1905,13 +1905,11 @@ In particular, return the buffer position of the first `for' kwd."
1905(defun js-indent-line () 1905(defun js-indent-line ()
1906 "Indent the current line as JavaScript." 1906 "Indent the current line as JavaScript."
1907 (interactive) 1907 (interactive)
1908 (save-restriction 1908 (let* ((parse-status
1909 (widen) 1909 (save-excursion (syntax-ppss (point-at-bol))))
1910 (let* ((parse-status 1910 (offset (- (current-column) (current-indentation))))
1911 (save-excursion (syntax-ppss (point-at-bol)))) 1911 (indent-line-to (js--proper-indentation parse-status))
1912 (offset (- (current-column) (current-indentation)))) 1912 (when (> offset 0) (forward-char offset))))
1913 (indent-line-to (js--proper-indentation parse-status))
1914 (when (> offset 0) (forward-char offset)))))
1915 1913
1916;;; Filling 1914;;; Filling
1917 1915