1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

makefile-fill-paragraph tweak

* lisp/progmodes/make-mode.el (makefile-fill-paragraph): Add doc.
Handle paragraph starting at beginning of buffer.
This commit is contained in:
Glenn Morris 2013-01-03 00:23:10 -08:00
parent 0a8bf3afca
commit a6d6c20b92
2 changed files with 9 additions and 4 deletions

View file

@ -1273,9 +1273,9 @@ definition and conveniently use this command."
;; Filling
(defun makefile-fill-paragraph (_arg)
;; Fill comments, backslashed lines, and variable definitions
;; specially.
(defun makefile-fill-paragraph (_justify)
"Function used for `fill-paragraph-function' in Makefile mode.
Fill comments, backslashed lines, and variable definitions specially."
(save-excursion
(beginning-of-line)
(cond
@ -1295,7 +1295,9 @@ definition and conveniently use this command."
(end-of-line 0)
(while (= (preceding-char) ?\\)
(end-of-line 0))
(forward-char)
;; Maybe we hit bobp, in which case we are not at EOL.
(if (eq (point) (line-end-position))
(forward-char))
(point)))
(end
(save-excursion