emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] scratch/backports-25.2 f65b1a3 27/46: Don't consider colon


From: Noam Postavsky
Subject: [Emacs-diffs] scratch/backports-25.2 f65b1a3 27/46: Don't consider colons to be paragraphs starting chars in strings
Date: Sun, 2 Oct 2016 14:04:49 +0000 (UTC)

branch: scratch/backports-25.2
commit f65b1a33b90ac0d6c3283f779f8fa357c45d8564
Author: Lars Ingebrigtsen <address@hidden>
Commit: Noam Postavsky <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).
    
    (cherry picked from commit 866e3c050fe64fee81f29a335a50a11b2562422e)
---
 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 cfec05c..58b16d7 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1217,8 +1217,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]