From 866e3c050fe64fee81f29a335a50a11b2562422e Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Thu, 28 Apr 2016 12:05:15 +0200 Subject: [PATCH] Don't consider colons to be paragraphs starting chars in strings * lisp/emacs-lisp/lisp-mode.el (lisp-fill-paragraph): Don't consider colons to start paragraphs in (doc) strings (bug#7751). --- lisp/emacs-lisp/lisp-mode.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 74aebc0a66a..4f3af2a7d7f 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -1216,8 +1216,15 @@ and initial semicolons." ;; ;; The `fill-column' is temporarily bound to ;; `emacs-lisp-docstring-fill-column' if that value is an integer. - (let ((paragraph-start (concat paragraph-start - "\\|\\s-*\\([(;:\"]\\|`(\\|#'(\\)")) + (let ((paragraph-start + (concat paragraph-start + (format "\\|\\s-*\\([(;%s\"]\\|`(\\|#'(\\)" + ;; If we're inside a string (like the doc + ;; string), don't consider a colon to be + ;; a paragraph-start character. + (if (nth 3 (syntax-ppss)) + "" + ":")))) (paragraph-separate (concat paragraph-separate "\\|\\s-*\".*[,\\.]$")) (fill-column (if (and (integerp emacs-lisp-docstring-fill-column) -- 2.39.2