* [PATCH] remove only empty lines
@ 2011-09-20 19:56 Łukasz Stelmach
2011-09-20 21:13 ` Julien Danjou
2011-09-21 17:40 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 5+ messages in thread
From: Łukasz Stelmach @ 2011-09-20 19:56 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 1214 bytes --]
Hi.
There is a very little problem with the current implementation of
message-indent-citation function. In a signature like mine, with an
empty line in the middle, the empty line gets removed. The following
patch fixes the problem.
The "(unless (eolp)..." expression is pointless right after (goto-char
(point-max)).
--8<---------------cut here---------------start------------->8---
diff --git a/lisp/message.el b/lisp/message.el
index 1fcd12f..cc8e73b 100644
--- a/lisp/message.el
+++ b/lisp/message.el
@@ -3723,10 +3723,9 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line."
(message-delete-line))
;; Delete blank lines at the end of the buffer.
(goto-char (point-max))
- (unless (eolp)
- (insert "\n"))
- (while (and (zerop (forward-line -1))
- (looking-at "$"))
+ (beginning-of-line)
+ (while (and (looking-at "$")
+ (zerop (forward-line -1)))
(message-delete-line)))
;; Do the indentation.
(if (null message-yank-prefix)
--8<---------------cut here---------------end--------------->8---
--
Miłego dnia,
Łukasz Stelmach
... Winogrona w popłochu tulą się do połówek cytryn. Jazda...
[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove only empty lines
2011-09-20 19:56 [PATCH] remove only empty lines Łukasz Stelmach
@ 2011-09-20 21:13 ` Julien Danjou
2011-09-21 17:40 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 5+ messages in thread
From: Julien Danjou @ 2011-09-20 21:13 UTC (permalink / raw)
To: Łukasz Stelmach; +Cc: ding
[-- Attachment #1: Type: text/plain, Size: 483 bytes --]
On Tue, Sep 20 2011, Łukasz Stelmach wrote:
> There is a very little problem with the current implementation of
> message-indent-citation function. In a signature like mine, with an
> empty line in the middle, the empty line gets removed. The following
> patch fixes the problem.
>
> The "(unless (eolp)..." expression is pointless right after (goto-char
> (point-max)).
Looks good, just push. If you can, include a ChangeLog entry next time.
:)
--
Julien Danjou
[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove only empty lines
2011-09-20 19:56 [PATCH] remove only empty lines Łukasz Stelmach
2011-09-20 21:13 ` Julien Danjou
@ 2011-09-21 17:40 ` Lars Magne Ingebrigtsen
2011-09-21 19:40 ` Andreas Schwab
1 sibling, 1 reply; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-21 17:40 UTC (permalink / raw)
To: Łukasz Stelmach; +Cc: ding
Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> writes:
> The "(unless (eolp)..." expression is pointless right after (goto-char
> (point-max)).
No, the last character may be something other than a newline.
Moreover, I'm not quite sure what this is supposed to fix. Signatures
are dropped when using `F', aren't they?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove only empty lines
2011-09-21 17:40 ` Lars Magne Ingebrigtsen
@ 2011-09-21 19:40 ` Andreas Schwab
2011-09-21 19:54 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2011-09-21 19:40 UTC (permalink / raw)
To: Lars Magne Ingebrigtsen; +Cc: Łukasz Stelmach, ding
Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Łukasz Stelmach <lukasz.stelmach@iem.pw.edu.pl> writes:
>
>> The "(unless (eolp)..." expression is pointless right after (goto-char
>> (point-max)).
>
> No, the last character may be something other than a newline.
(eolp) is always true at eob.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] remove only empty lines
2011-09-21 19:40 ` Andreas Schwab
@ 2011-09-21 19:54 ` Lars Magne Ingebrigtsen
0 siblings, 0 replies; 5+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-21 19:54 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Łukasz Stelmach, ding
Andreas Schwab <schwab@linux-m68k.org> writes:
> (eolp) is always true at eob.
Ah, right. I've now applied a fix.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-09-21 19:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-20 19:56 [PATCH] remove only empty lines Łukasz Stelmach
2011-09-20 21:13 ` Julien Danjou
2011-09-21 17:40 ` Lars Magne Ingebrigtsen
2011-09-21 19:40 ` Andreas Schwab
2011-09-21 19:54 ` Lars Magne Ingebrigtsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).