From a6d6c20b920542ec04f2a2616596f61430187132 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Thu, 3 Jan 2013 00:23:10 -0800 Subject: [PATCH] makefile-fill-paragraph tweak * lisp/progmodes/make-mode.el (makefile-fill-paragraph): Add doc. Handle paragraph starting at beginning of buffer. --- lisp/ChangeLog | 3 +++ lisp/progmodes/make-mode.el | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0d34da2c049..2b7cb55da89 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-01-03 Glenn Morris + * progmodes/make-mode.el (makefile-fill-paragraph): Add doc. + Handle paragraph starting at beginning of buffer. + * subr.el (eval-after-load): Don't purecopy the form, so that it can be nconc'd later on; reverts 2009-11-11 change. (Bug#13331) diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 793c3bbbf37..8ab4c6f95b6 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -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 -- 2.39.5