all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug in simple.el?
@ 2015-01-15 23:02 Marcin Borkowski
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Borkowski @ 2015-01-15 23:02 UTC (permalink / raw
  To: Help Gnu Emacs mailing list

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]+$"?

Best,

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in simple.el?
       [not found] <mailman.17980.1421363075.1147.help-gnu-emacs@gnu.org>
@ 2015-01-17 15:00 ` Alan Mackenzie
  2015-01-17 18:10   ` Marcin Borkowski
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Mackenzie @ 2015-01-17 15:00 UTC (permalink / raw
  To: help-gnu-emacs

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).



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug in simple.el?
  2015-01-17 15:00 ` Bug in simple.el? Alan Mackenzie
@ 2015-01-17 18:10   ` Marcin Borkowski
  0 siblings, 0 replies; 3+ messages in thread
From: Marcin Borkowski @ 2015-01-17 18:10 UTC (permalink / raw
  To: help-gnu-emacs


On 2015-01-17, at 16:00, Alan Mackenzie <acm@muc.de> wrote:

> Hello, Marcin.
>
>> 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,

Thanks!  I'll file a report later today.

Regards,

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-17 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.17980.1421363075.1147.help-gnu-emacs@gnu.org>
2015-01-17 15:00 ` Bug in simple.el? Alan Mackenzie
2015-01-17 18:10   ` Marcin Borkowski
2015-01-15 23:02 Marcin Borkowski

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.