]> git.eshelyaron.com Git - emacs.git/commitdiff
Make sure prog-fill-reindent-defun work for strings too
authorYuan Fu <casouri@gmail.com>
Thu, 17 Apr 2025 23:17:12 +0000 (16:17 -0700)
committerEshel Yaron <me@eshelyaron.com>
Fri, 18 Apr 2025 06:47:18 +0000 (08:47 +0200)
My previous commit foolishly excluded strings from the
condition, now add them back.

* lisp/progmodes/prog-mode.el (prog-fill-reindent-defun):
Include strings.

(cherry picked from commit b75c18f3c6c8d347d4f1a9cce746e673d91997a9)

lisp/progmodes/prog-mode.el

index 19a32080fb44151b1c4473b43b72c87943f0ced5..503644927c09fb3c7a1bc4552277b1836754811c 100644 (file)
@@ -156,7 +156,7 @@ or follows point."
     ;; FIXME: For some reason, the comment-start syntax regexp doesn't
     ;; work for me.  But I kept it around to be safe, and in the hope
     ;; that if can cover cases where comment-start-skip is unset.
-    (if (or (nth 4 (syntax-ppss))
+    (if (or (nth 8 (syntax-ppss))
             ;; If point is at the beginning of a comment delimiter,
             ;; syntax-ppss doesn't consider point as being inside a
             ;; comment.
@@ -170,11 +170,11 @@ or follows point."
                    ;; reached EOL or (nth 4 (syntax-ppss)) returns
                    ;; non-nil.
                    (re-search-forward comment-start-skip (pos-eol) t)
-                   (nth 4 (syntax-ppss))))
+                   (nth 8 (syntax-ppss))))
             (save-excursion
               (beginning-of-line)
               (and (re-search-forward "\\s-*\\s<" (line-end-position) t)
-                   (nth 4 (syntax-ppss)))))
+                   (nth 8 (syntax-ppss)))))
         (fill-paragraph argument (region-active-p))
       (beginning-of-defun)
       (let ((start (point)))