emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 866e3c0: Don't consider colons to be paragraphs sta


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 866e3c0: Don't consider colons to be paragraphs starting chars in strings
Date: Thu, 28 Apr 2016 10:06:08 +0000

branch: master
commit 866e3c050fe64fee81f29a335a50a11b2562422e
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    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 74aebc0..4f3af2a 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]