Ikumi Keita <[email protected]> writes: > Unfortunately `fill-region' (more precisely, `fill-region-as-paragraph' > called in `fill-region') doesn't pay attention to the variable > `fill-paragraph-function' and performs filling with Emacs standard > generic filling algorithm. That's the reason why the indentation you > are talking about was lost. > > I'm not sure whether this is an Emacs bug or not. Maybe LaTeX mode > should remap `fill-paragraph' to `LaTeX-fill-paragraph' directly. What > do other developers think?
Well, here is what the Emacs developers think (read the "Note" at the end): fill-paragraph-function is a variable defined in ‘fill.el’. Its value is nil Mode-specific function to fill a paragraph, or nil if there is none. If the function returns nil, then ‘fill-paragraph’ does its normal work. A value of t means explicitly "do nothing special". Note: This only affects ‘fill-paragraph’ and not ‘fill-region’ nor ‘auto-fill-mode’, so it is often better to use some other hook, such as ‘fill-forward-paragraph-function’. This variable may be risky if used as a file-local variable. Probably introduced at or before Emacs version 19.29. -- David Kastrup
