[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] LaTeX-fill-region-as-paragraph: each sentence starts in a
[AUCTeX-devel] LaTeX-fill-region-as-paragraph: each sentence starts in a new line
Thu, 08 Sep 2016 08:13:26 +0000
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
One of the few things I miss in vanilla auctex, is a generalisation of
LaTeX-fill-region-as-paragraph: each sentence starts in a new line.
That is very helpful if one uses a version-control system for ones LaTeX
The issue has been discussed for example in
I tested all the proposed solutions and must say the best one is the one
It uses defadvice:
(defadvice LaTeX-fill-region-as-paragraph (around LaTeX-sentence-filling)
"Start each sentence on a new line."
(let ((from (ad-get-arg 0))
(to-marker (set-marker (make-marker) (ad-get-arg 1)))
(while (< from (marker-position to-marker))
;; might have gone beyond to-marker --- use whichever is smaller:
(ad-set-arg 1 (setq tmp-end (min (point) (marker-position to-marker))))
(ad-set-arg 0 (setq from (point)))
(looking-at "\\s *$"))
(set-marker to-marker nil)))
A couple of questions and suggestions:
- could anyone with knowledge of the original
LaTeX-fill-region-as-paragraph try to implement this feature
without using defadvice.
- if not, could that code be included, although it uses defadvice.
Of course if would then be necessary to ask for permission and to
convince the author to sign the relevant FSF papers , which I
could try to do, if the maintainer think the code should be
 which can take some time as I recently learnt.
- [AUCTeX-devel] LaTeX-fill-region-as-paragraph: each sentence starts in a new line,
Uwe Brauer <=