+2015-01-30 Fabián Ezequiel Gallina <fgallina@gnu.org>
+
+ python.el: Handle tabs in python-indent-dedent-line.
+
+ * progmodes/python.el (python-indent-dedent-line): Fixes for
+ indentation with tabs. Thanks to <dale@codefu.org> (Bug#19730).
+
2015-01-30 Fabián Ezequiel Gallina <fgallina@gnu.org>
* progmodes/python.el (python-indent-context): Respect user
+2015-01-30 Fabián Ezequiel Gallina <fgallina@gnu.org>
+
+ * automated/python-tests.el
+ (python-indent-dedent-line-backspace-2)
+ (python-indent-dedent-line-backspace-3): New tests.
+
2015-01-30 Fabián Ezequiel Gallina <fgallina@gnu.org>
* automated/python-tests.el (python-indent-pep8-1)
(call-interactively #'python-indent-dedent-line-backspace)
(should (zerop (current-indentation)))))
+(ert-deftest python-indent-dedent-line-backspace-2 ()
+ "Check de-indentation with tabs. Bug#19730."
+ (let ((tab-width 8))
+ (python-tests-with-temp-buffer
+ "
+if x:
+\tabcdefg
+"
+ (python-tests-look-at "abcdefg")
+ (goto-char (line-end-position))
+ (call-interactively #'python-indent-dedent-line-backspace)
+ (should
+ (string= (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position))
+ "\tabcdef")))))
+
+(ert-deftest python-indent-dedent-line-backspace-3 ()
+ "Paranoid check of de-indentation with tabs. Bug#19730."
+ (let ((tab-width 8))
+ (python-tests-with-temp-buffer
+ "
+if x:
+\tif y:
+\t abcdefg
+"
+ (python-tests-look-at "abcdefg")
+ (goto-char (line-end-position))
+ (call-interactively #'python-indent-dedent-line-backspace)
+ (should
+ (string= (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position))
+ "\t abcdef"))
+ (back-to-indentation)
+ (call-interactively #'python-indent-dedent-line-backspace)
+ (should
+ (string= (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position))
+ "\tabcdef"))
+ (call-interactively #'python-indent-dedent-line-backspace)
+ (should
+ (string= (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position))
+ " abcdef"))
+ (call-interactively #'python-indent-dedent-line-backspace)
+ (should
+ (string= (buffer-substring-no-properties
+ (line-beginning-position) (line-end-position))
+ "abcdef")))))
+
\f
;;; Shell integration