help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in simple.el?


From: Alan Mackenzie
Subject: Re: Bug in simple.el?
Date: Sat, 17 Jan 2015 15:00:38 +0000 (UTC)
User-agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/8.4-RELEASE (amd64))

Hello, Marcin.

Marcin Borkowski <mbork@wmi.amu.edu.pl> wrote:
> Hello there,

> either there is a bug in simple.el (the `newline' function), or I don't
> understand something.

> Here's an excerpt:

>  (let* ((was-page-start (and (bolp) (looking-at page-delimiter)))
>            ;; (some code cut from here)
>            ;; If the newline leaves the previous line blank, and we
>            ;; have a left margin, delete that from the blank line.
>            (save-excursion
>              (goto-char beforepos)
>              (beginning-of-line)
>              (and (looking-at "[ \t]$")
>                   (> (current-left-margin) 0)
>                   (delete-region (point)
>                                  (line-end-position))))

> (BTW: page-delimiter is by default "^^L", i.e. caret and C-l, so the
> (and (bolp) ...) seems to be spurious.)

> But my real problem with the above code is the (looking-at "[ \t]$")
> part.  Shouldn't the regex be "[ \t]+$"?

Yes, I think it should be, too.  Since nobody else has reacted, I suggest
you repost this in bug-gnu-emacs@gnu.org with a more specific title, say
"Bug in regexp in `newline'"; it could be that "Bug in simple.el?" was too
generic to attract people's attention.

> Best,

> -- 
> Marcin Borkowski
> http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
> Faculty of Mathematics and Computer Science
> Adam Mickiewicz University

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]