From 5af9fbadd1956fc2c757588763b16031550010f8 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Wed, 12 Feb 2014 08:23:42 +0200 Subject: [PATCH] * lisp/progmodes/js.el (js-indent-line): Don't widen. http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00276.html --- lisp/ChangeLog | 5 +++++ lisp/progmodes/js.el | 12 +++++------- 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 @@ +2014-02-12 Dmitry Gutov + + * 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 * 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." (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 -- 2.39.2