summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp
diff options
context:
space:
mode:
authorNoam Postavsky <npostavs@gmail.com>2017-07-06 08:52:24 -0400
committerNoam Postavsky <npostavs@gmail.com>2017-07-06 08:59:32 -0400
commit386918f0b807116051facbe51a2bee342de37841 (patch)
treed4cd72365995b96cba6af47b5d3720dcda668077 /test/lisp/emacs-lisp
parent20e9a00fb5d12ad408f9dd15adcfcd205783c1b0 (diff)
downloademacs-386918f0b807116051facbe51a2bee342de37841.tar.gz
emacs-386918f0b807116051facbe51a2bee342de37841.tar.bz2
emacs-386918f0b807116051facbe51a2bee342de37841.zip
Fix lisp-comment-indent for single-semicolon case
* lisp/emacs-lisp/lisp-mode.el (lisp-comment-indent): Only check for open paren if we're looking at multiple comment characters. * test/lisp/emacs-lisp/lisp-mode-tests.el (lisp-comment-indent-1) (lisp-comment-indent-2): New tests.
Diffstat (limited to 'test/lisp/emacs-lisp')
-rw-r--r--test/lisp/emacs-lisp/lisp-mode-tests.el26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el
index 582041cfc2d..cc196beea23 100644
--- a/test/lisp/emacs-lisp/lisp-mode-tests.el
+++ b/test/lisp/emacs-lisp/lisp-mode-tests.el
@@ -198,6 +198,32 @@ Expected initialization file: `%s'\"
(indent-region (point-min) (point-max))
(should (equal (buffer-string) correct)))))
+(ert-deftest lisp-comment-indent-1 ()
+ (with-temp-buffer
+ (insert "\
+\(let ( ;sf
+ (x 3))
+ 4)")
+ (let ((indent-tabs-mode nil)
+ (correct (buffer-string)))
+ (emacs-lisp-mode)
+ (goto-char (point-min))
+ (comment-indent)
+ (should (equal (buffer-string) correct)))))
+
+(ert-deftest lisp-comment-indent-2 ()
+ (with-temp-buffer
+ (insert "\
+\(let (;;sf
+ (x 3))
+ 4)")
+ (let ((indent-tabs-mode nil)
+ (correct (buffer-string)))
+ (emacs-lisp-mode)
+ (goto-char (point-min))
+ (comment-indent)
+ (should (equal (buffer-string) correct)))))
+
(provide 'lisp-mode-tests)
;;; lisp-mode-tests.el ends here