From cff301beed3776a18def846d99753ef53ecfe277 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 4 Feb 2004 22:55:17 +0000 Subject: [PATCH] (cperl-fill-paragraph): Call fill-paragraph with point inside rather than after the paragraph. --- lisp/progmodes/cperl-mode.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 7202a083d79..155648fadb1 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -4313,11 +4313,12 @@ indentation and initial hashes. Behaves usually outside of comment." (looking-at "^[ \t]*#+[ \t]*[^ \t\n#]"))) (point))) ;; Remove existing hashes - (goto-char (point-min)) - (while (progn (forward-line 1) (< (point) (point-max))) - (skip-chars-forward " \t") - (and (looking-at "#+") - (delete-char (- (match-end 0) (match-beginning 0))))) + (save-excursion + (goto-char (point-min)) + (while (progn (forward-line 1) (< (point) (point-max))) + (skip-chars-forward " \t") + (and (looking-at "#+") + (delete-char (- (match-end 0) (match-beginning 0)))))) ;; Lines with only hashes on them can be paragraph boundaries. (let ((paragraph-start (concat paragraph-start "\\|^[ \t#]*$")) -- 2.39.2