Commit bb5b7758 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(makefile-fill-paragraph): Find comment boundaries before filling.

parent e6d4cddd
;;; make-mode.el --- makefile editing commands for Emacs
;; Copyright (C) 1992,94,99,2000,2001 Free Software Foundation, Inc.
;; Copyright (C) 1992,94,99,2000,2001, 2002 Free Software Foundation, Inc.
;; Author: Thomas Neumann <>
;; Eric S. Raymond <>
......@@ -1011,12 +1011,30 @@ definition and conveniently use this command."
((looking-at "^#+ ")
;; Found a comment. Set the fill prefix and then fill.
;; Found a comment. Set the fill prefix, and find the paragraph
;; boundaries by searching for lines that look like comment-only
;; lines.
(let ((fill-prefix (buffer-substring-no-properties (match-beginning 0)
(match-end 0)))
(fill-paragraph-function nil))
(fill-paragraph nil)
;; Search backwards.
(while (and (zerop (forward-line -1))
(looking-at "^#")))
;; We may have gone too far. Go forward again.
(or (looking-at "^#")
(forward-line 1))
;; Search forwards.
(while (looking-at "^#")
(fill-paragraph nil)
;; Must look for backslashed-region before looking for variable
;; assignment.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment