Path: utzoo!utgpu!watmath!uunet!tut.cis.ohio-state.edu!UUNET.UU.NET!talos!kjones From: talos!kjones@UUNET.UU.NET (Kyle Jones) Newsgroups: gnu.emacs.bug Subject: Re: (supposed) Trouble with auto-fill Summary: This is a bug. Message-ID: <8812211624.AA03910@uunet.UU.NET> Date: 21 Dec 88 14:32:22 GMT References: <3357@mipos3.intel.com> Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 75 woodstock (Nate Hess) writes: >What I'm curious about is why this behaviour was changed in the first >place [...] The RET/auto-fill bug was introduced by a change in the file src/cmds.c between versions 18.51 and 18.52 . Thanks go to Hal Peterson of Cray Research for posting a fix for this (well over a month ago); his article appears below. Hal mentions that the problem is exhibited on various Sun boxes, but the fix applies to all 18.52 installations. There is no question that the offending code is incorrect. The line that causes the bug: SelfInsert ('\n', XFASTINT (arg1) > 1); uses XFASTINT on a variable that could very well be a symbol, or a list. kyle jones ...!uunet!talos!kjones ------- Article 271 of gnu.emacs.bug: Path: talos!uunet!tut.cis.ohio-state.edu!earth.cray.com!hrp From: hrp@earth.cray.com (Hal Peterson) Newsgroups: gnu.emacs.bug Subject: auto fill and newline in 18.52 Message-ID: <8811141801.AA29069@earth.cray.com> Date: 14 Nov 88 18:01:39 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 43 newline no longer causes an auto-fill in GNU Emacs version 18.52 running on a Sun-3/50 or Sun-3/280 with SunOS 3.5. Repeat by: C-x b b u g RET ; get a new buffer M-x t e x t - m o d e RET ; put it into a known mode C-u M-x a u t o - f i l l RET ; turn on auto-fill M-x s e t - v a r RET f i l l - c RET 7 0 RET ; set the fill column M-4 M-0 x SPC M-4 M-0 x ; create text that should fill RET ; demonstrate the bug That last RET should cause the line to break after the first string of '?x characters, but it does not. The problem appears to be a misnamed variable reference in Fnewline in cmds.c. "arg1" is the raw prefix argument to newline, and arg is the numeric interpretation of that argument. The call to SelfInsert uses arg1 but should use arg. Following is a diff (which I have installed on our system and which appears to fix the problem). Hal -- Hal Peterson / Cray Research / 1440 Northland Dr. / Mendota Hts, MN 55120 hrp@cray.com bungia!cray!hrp (612) 681-3145 ============================================================ *** cmds.c-orig Tue Jul 19 18:43:25 1988 --- cmds.c Sun Nov 13 15:19:31 1988 *************** *** 237,243 **** if (flag) InsCStr (&c1, 1); else ! SelfInsert ('\n', XFASTINT (arg1) > 1); XFASTINT (arg)--; /* Ok since old and new vals both nonneg */ } --- 237,243 ---- if (flag) InsCStr (&c1, 1); else ! SelfInsert ('\n', XFASTINT (arg) > 1); XFASTINT (arg)--; /* Ok since old and new vals both nonneg */ }