]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't consider colons to be paragraphs starting chars in strings
authorLars Ingebrigtsen <larsi@gnus.org>
Thu, 28 Apr 2016 10:05:15 +0000 (12:05 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Thu, 28 Apr 2016 10:05:15 +0000 (12:05 +0200)
* 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

index 74aebc0a66ad92f9dee0306ae54f0347a28f19b9..4f3af2a7d7f6985cd2ab0c801205cc8a1f324643 100644 (file)
@@ -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)