summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/lisp-tests.el
diff options
context:
space:
mode:
authorAlexander Gramiak <agrambot@gmail.com>2017-10-22 01:46:05 -0600
committerAlexander Gramiak <agrambot@gmail.com>2017-10-22 12:46:55 -0600
commita012ec766c9d9bac0a56e814589a4b3b93311c28 (patch)
tree3d2ec1629df0fb6e2374dd832e3dc15b12c254cd /test/lisp/emacs-lisp/lisp-tests.el
parentb7c4aa951c8b12629742df9d20d6374c3d2a8ba8 (diff)
downloademacs-a012ec766c9d9bac0a56e814589a4b3b93311c28.tar.gz
Don't fill keywords after Emacs Lisp docstring
This approach does mean that keywords that have spaces before them inside of docstrings aren't filled, but I think this is should be fine until Bug#28937 is fixed. * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Add a colon to paragraph-start unconditionally, but require that it follows at least one space. (Bug#24622) * test/lisp/emacs-lisp/lisp-tests.el: New tests for Bug#24622 and Bug#7751.
Diffstat (limited to 'test/lisp/emacs-lisp/lisp-tests.el')
-rw-r--r--test/lisp/emacs-lisp/lisp-tests.el31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/lisp-tests.el b/test/lisp/emacs-lisp/lisp-tests.el
index ae1302bdce4..654d949d388 100644
--- a/test/lisp/emacs-lisp/lisp-tests.el
+++ b/test/lisp/emacs-lisp/lisp-tests.el
@@ -589,5 +589,36 @@ region."
(should (= (point) before))
(should (= (mark) after))))
+(ert-deftest lisp-fill-paragraph-colon ()
+ "Keywords below Emacs Lisp docstrings should not be filled (Bug#24622).
+Keywords inside docstrings should be filled (Bug#7751)."
+ (elisp-tests-with-temp-buffer
+ "
+\(defcustom custom value
+ \"First\n
+Second\n
+=!inside=Third line\"
+ =!keywords=:type 'sexp
+ :version \"26.1\"
+ :group 'lisp-tests)"
+ (goto-char inside)
+ (fill-paragraph)
+ (goto-char keywords)
+ (beginning-of-line)
+ (should (looking-at " :type 'sexp\n :version \"26.1\"\n :")))
+ (elisp-tests-with-temp-buffer
+ "
+\(defun foo ()
+ \"Summary.
+=!inside=Testing keywords: :one :two :three\"
+ (body))" ; FIXME: Remove parens around body to test Bug#28937 once it's fixed
+ (goto-char inside)
+ (let ((emacs-lisp-docstring-fill-column 30))
+ (fill-paragraph))
+ (forward-line)
+ (should (looking-at ":three"))
+ (end-of-line)
+ (should-not (eq (preceding-char) ?\)))))
+
(provide 'lisp-tests)
;;; lisp-tests.el ends here