(defun lisp-comment-indent ()
"Like `comment-indent-default', but don't put space after open paren."
- (let ((pt (point)))
- (skip-syntax-backward " ")
- (if (eq (preceding-char) ?\()
- (cons (current-column) (current-column))
- (goto-char pt)
- (comment-indent-default))))
+ (or (when (looking-at "\\s<\\s<")
+ (let ((pt (point)))
+ (skip-syntax-backward " ")
+ (if (eq (preceding-char) ?\()
+ (cons (current-column) (current-column))
+ (goto-char pt)
+ nil)))
+ (comment-indent-default)))
(define-obsolete-function-alias 'lisp-mode-auto-fill 'do-auto-fill "23.1")
(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