GNU bug report logs - #26049
25.2; Extra lines not added to comment

Previous Next

Package: emacs;

Reported by: Antonin Houska <ah <at> cybertec.at>

Date: Fri, 10 Mar 2017 16:05:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.2

Fixed in version 26.1

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: npostavs <at> users.sourceforge.net
To: Antonin Houska <ah <at> cybertec.at>
Cc: 26049 <at> debbugs.gnu.org
Subject: bug#26049: 25.2; Extra lines not added to comment
Date: Tue, 28 Mar 2017 22:25:23 -0400
Antonin Houska <ah <at> cybertec.at> writes:
>
>> >   	   (progn (goto-char end) (end-of-line) (skip-syntax-backward " ")
>> >   		  (<= (point) end))
>> >   	   (or block (not (string= "" comment-end)))
>> > ! 	   (or block (progn (goto-char beg) (search-forward
>> > !                                              "\n"
>> > !                                              (min (1+ end) (point-max)) t)))))
>
>> Maybe (re-search-forward "$" end t) is better?  It's a bit unclear to me
>> what exactly all those tests are looking for.  That code could use some
>> comments...
>
> I've just verified your approach - it does work too.

"$" also matches at the end of buffer even if it doesn't end in newline
(which is a very marginal corner case, I just happened to notice it
because I didn't hit RET in my test buffer).

> + 	    ;; Trim trailing whitespace from cs if there's some.
> +             (setq cs (string-trim cs))

This would trim leading whitespace too, do we want that?




This bug report was last modified 7 years and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.