diff options
author | Noam Postavsky <npostavs@gmail.com> | 2017-07-06 08:52:24 -0400 |
---|---|---|
committer | Noam Postavsky <npostavs@gmail.com> | 2017-07-06 08:59:32 -0400 |
commit | 386918f0b807116051facbe51a2bee342de37841 (patch) | |
tree | d4cd72365995b96cba6af47b5d3720dcda668077 /lisp/emacs-lisp/lisp-mode.el | |
parent | 20e9a00fb5d12ad408f9dd15adcfcd205783c1b0 (diff) | |
download | emacs-386918f0b807116051facbe51a2bee342de37841.tar.gz |
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 'lisp/emacs-lisp/lisp-mode.el')
-rw-r--r-- | lisp/emacs-lisp/lisp-mode.el | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 985b7513a3b..fa25a0c3975 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -738,12 +738,14 @@ or to switch back to an existing one." (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") |