|
From: | Dmitry Gutov |
Subject: | bug#67462: 30.0.50; prog-fill-reindent-defun does not respect buffer-local fill-paragraph-function |
Date: | Sun, 26 Nov 2023 23:23:04 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 37c54a90f42..1bb2b678d94 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -163,7 +163,8 @@ prog-fill-reindent-defun (treesit-parser-list) (treesit-node-match-p (treesit-node-at (point)) 'text t)))) - (if (or treesit-text-node + (if (or (local-variable-p 'fill-paragraph-function) + treesit-text-node (nth 8 (syntax-ppss)) (re-search-forward "\\s-*\\s<" (line-end-position) t)) (fill-paragraph argument (region-active-p))
I'm not sure this is going to work well because c-mode (for example) also has a buffer-local value of fill-paragraph-function.
makefile-mode does look special in this regard. Perhaps it's one of those modes that don't really use indentation in the same way as an average "prog mode" does.
Maybe makefile-mode-map should simply rebind "M-q" back to 'fill-paragraph'.
[Prev in Thread] | Current Thread | [Next in Thread] |