emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 a760364f5f 1/2: Fix c-ts-mode--fill-paragraph


From: Yuan Fu
Subject: emacs-29 a760364f5f 1/2: Fix c-ts-mode--fill-paragraph
Date: Fri, 13 Jan 2023 03:55:43 -0500 (EST)

branch: emacs-29
commit a760364f5f36ad4ded67b0fd5ca4ef59c9b2d705
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Fix c-ts-mode--fill-paragraph
    
    Example:
    
           doc: /* Return non-nil if NODE1 and NODE2 are the same node.
    If any one of NODE1 and NODE2 is nil, return nil.
    This function uses the same equivalence metric as `equal'.  */
    
    * lisp/progmodes/c-ts-mode.el (c-ts-mode--fill-paragraph): Fix the
    case where there are words before the /*, like the example above.
---
 lisp/progmodes/c-ts-mode.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index e53ed390ba..ef5a9c2195 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -726,7 +726,10 @@ ARG is passed to `fill-paragraph'."
           ;; Let `fill-paragraph' do its thing.
           (goto-char orig-point)
           (narrow-to-region start end)
-          (funcall #'fill-paragraph arg)
+          ;; We don't want to fill the region between START and
+          ;; START-MARKER, otherwise the filling function might delete
+          ;; some spaces there.
+          (fill-region start-marker end arg)
           ;; Unmask.
           (when start-marker
             (goto-char start-marker)



reply via email to

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