From 6392bc37ab3b7eb83465d9b2248d21173373ae73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Sun, 29 Aug 2021 20:27:56 +0200 Subject: [PATCH] Tweak sh-script-mode indentation further * lisp/progmodes/sh-script.el (sh-smie--default-backward-token): Allow more parentheses in a token (bug#44592). --- lisp/progmodes/sh-script.el | 2 +- test/lisp/progmodes/sh-script-tests.el | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 201d1fd1647..7507579d16d 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1775,7 +1775,7 @@ Does not preserve point." (goto-char p) nil)))) (while - (progn (skip-syntax-backward ".w_'") + (progn (skip-syntax-backward ".w_'()") (or (not (zerop (skip-syntax-backward "\\"))) (when (eq ?\\ (char-before (1- (point)))) (let ((p (point))) diff --git a/test/lisp/progmodes/sh-script-tests.el b/test/lisp/progmodes/sh-script-tests.el index 5bdce6260ae..82c2d5168ce 100644 --- a/test/lisp/progmodes/sh-script-tests.el +++ b/test/lisp/progmodes/sh-script-tests.el @@ -35,6 +35,17 @@ (should (equal (buffer-substring-no-properties (point-min) (point-max)) "relative-path/to/configure --prefix=$prefix\\ - --with-x")))) + --with-x"))) + (with-temp-buffer + (insert "${path_to_root}/configure --prefix=$prefix\\ + --with-x") + (shell-script-mode) + (goto-char (point-min)) + (forward-line 1) + (indent-for-tab-command) + (should (equal + (buffer-substring-no-properties (point-min) (point-max)) + "${path_to_root}/configure --prefix=$prefix\\ + --with-x")))) ;;; sh-script-tests.el ends here -- 2.39.2