From: Glenn Morris Date: Thu, 3 Jan 2013 08:23:10 +0000 (-0800) Subject: makefile-fill-paragraph tweak X-Git-Tag: emacs-24.3.90~173^2~7^2~413 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a6d6c20b920542ec04f2a2616596f61430187132;p=emacs.git makefile-fill-paragraph tweak * lisp/progmodes/make-mode.el (makefile-fill-paragraph): Add doc. Handle paragraph starting at beginning of buffer. --- 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