diff options
| author | Yuan Fu | 2025-04-17 16:17:12 -0700 |
|---|---|---|
| committer | Yuan Fu | 2025-04-17 16:18:19 -0700 |
| commit | b75c18f3c6c8d347d4f1a9cce746e673d91997a9 (patch) | |
| tree | d728b2ad109590097a002415df247b4026bf8d9e | |
| parent | 6702a448c1c2500abb4f393da29edc31acd5e058 (diff) | |
| download | emacs-b75c18f3c6c8d347d4f1a9cce746e673d91997a9.tar.gz emacs-b75c18f3c6c8d347d4f1a9cce746e673d91997a9.zip | |
Make sure prog-fill-reindent-defun work for strings too
My previous commit foolishly excluded strings from the
condition, now add them back.
* lisp/progmodes/prog-mode.el (prog-fill-reindent-defun):
Include strings.
| -rw-r--r-- | lisp/progmodes/prog-mode.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 4e9e228fa9c..62d22cb78c0 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el | |||
| @@ -154,7 +154,7 @@ or follows point." | |||
| 154 | ;; FIXME: For some reason, the comment-start syntax regexp doesn't | 154 | ;; FIXME: For some reason, the comment-start syntax regexp doesn't |
| 155 | ;; work for me. But I kept it around to be safe, and in the hope | 155 | ;; work for me. But I kept it around to be safe, and in the hope |
| 156 | ;; that if can cover cases where comment-start-skip is unset. | 156 | ;; that if can cover cases where comment-start-skip is unset. |
| 157 | (if (or (nth 4 (syntax-ppss)) | 157 | (if (or (nth 8 (syntax-ppss)) |
| 158 | ;; If point is at the beginning of a comment delimiter, | 158 | ;; If point is at the beginning of a comment delimiter, |
| 159 | ;; syntax-ppss doesn't consider point as being inside a | 159 | ;; syntax-ppss doesn't consider point as being inside a |
| 160 | ;; comment. | 160 | ;; comment. |
| @@ -168,11 +168,11 @@ or follows point." | |||
| 168 | ;; reached EOL or (nth 4 (syntax-ppss)) returns | 168 | ;; reached EOL or (nth 4 (syntax-ppss)) returns |
| 169 | ;; non-nil. | 169 | ;; non-nil. |
| 170 | (re-search-forward comment-start-skip (pos-eol) t) | 170 | (re-search-forward comment-start-skip (pos-eol) t) |
| 171 | (nth 4 (syntax-ppss)))) | 171 | (nth 8 (syntax-ppss)))) |
| 172 | (save-excursion | 172 | (save-excursion |
| 173 | (beginning-of-line) | 173 | (beginning-of-line) |
| 174 | (and (re-search-forward "\\s-*\\s<" (line-end-position) t) | 174 | (and (re-search-forward "\\s-*\\s<" (line-end-position) t) |
| 175 | (nth 4 (syntax-ppss))))) | 175 | (nth 8 (syntax-ppss))))) |
| 176 | (fill-paragraph argument (region-active-p)) | 176 | (fill-paragraph argument (region-active-p)) |
| 177 | (beginning-of-defun) | 177 | (beginning-of-defun) |
| 178 | (let ((start (point))) | 178 | (let ((start (point))) |