🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99912

Bug in fill.el in Gnu Emacs 18.52

#99912
From: Gary Oberbrunner
Date: Mon, 02 Apr 1990 16:47
58 lines
2949 bytes
Fill.el improperly fills the current indented paragraph in mail mode if it
contains a colon.

Here is a patched version (the difference is only one line, down where it
says 'here is the patch'); the regexp is anchored to the beginning of the
line.

The defun in this file should just be merged into fill.el.

				- Gary Oberbrunner
				Thinking Machines Corporation
				245 First St
				Cambridge, MA 02142
				garyo@think.com

;;; ======================================================================
;;; -*- Mode: Lisp; Package: USER ; Base: 10.; Syntax: Common-lisp -*-

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Created by Gary Oberbrunner on Fri Mar 30 1990
;;;
;;; ******************* CHANGE LOG *******************
;;; $Id: fill-patch.el,v 1.1 90/03/30 16:32:06 garyo Exp $
;;; $Source: /tmp_mnt/am/p7/utility/gmacs/f4/RCS/fill-patch.el,v $
;;; *************** END OF CHANGE LOG ***************

;;; This patch is for the 18.52 fill-individual-paragraphs from fill.el.
;;; That version has a slight bug in the mailp mode: the mail-header regexp
;;; isn't anchored to the beginning of the line, so any colon in the
;;; message will prevent that paragraph from being filled.
;;; Patch by Gary Oberbrunner (garyo@think.com); 3-30-90.

(defun fill-individual-paragraphs (min max &optional justifyp mailp)
  "Fill each paragraph in region according to its individual fill prefix.
Calling from a program, pass range to fill as first two arguments.
Optional third and fourth arguments JUSTIFY-FLAG and MAIL-FLAG:
JUSTIFY-FLAG to justify paragraphs (prefix arg),
MAIL-FLAG for a mail message, i. e. don't fill header lines."
  (interactive "r\nP")
  (let (fill-prefix)
    (save-restriction
      (save-excursion
	(narrow-to-region min max)
	(goto-char (point-min))
	(while (progn
		 (skip-chars-forward " \t\n")
		 (not (eobp)))
	  (setq fill-prefix (buffer-substring (point) (progn (beginning-of-line) (point))))
	  (let ((fin (save-excursion (forward-paragraph) (point)))
		(start (point)))
	    (if mailp
		;; Here is the patch - Gary O. 3-30-90
		(while (re-search-forward "^[ \t]*[^ \t\n]*:" fin t)
		  (forward-line 1)))
	    (cond ((= start (point))
		   (fill-region-as-paragraph (point) fin justifyp)
		   (goto-char fin)))))))))
Technical Details
Message-ID: <9004021647.AA20304@prometheus.think.com>
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!samsung!cs.utexas.edu!tut.cis.ohio-state.edu!THINK.COM!garyo

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,9ea6ef9bf9496059,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-04-02 21:01:51 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!samsung!cs.utexas.edu!tut.cis.ohio-state.edu!THINK.COM!garyo
From: garyo@THINK.COM (Gary Oberbrunner)
Newsgroups: gnu.emacs.bug
Subject: Bug in fill.el in Gnu Emacs 18.52
Message-ID: <9004021647.AA20304@prometheus.think.com>
Date: 2 Apr 90 16:47:37 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 58
Posted: Mon Apr  2 17:47:37 1990