GNU bug report logs - #67203
[PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) skip leading whitespace in diary entries

Previous Next

Package: emacs;

Reported by: "Paul W. Rankin" <hello <at> paulwrankin.com>

Date: Wed, 15 Nov 2023 17:29:03 UTC

Severity: normal

Tags: patch

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 67203 in the body.
You can then email your comments to 67203 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#67203; Package emacs. (Wed, 15 Nov 2023 17:29:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Paul W. Rankin" <hello <at> paulwrankin.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 15 Nov 2023 17:29:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: bug-gnu-emacs <at> gnu.org
Cc: "Paul W. Rankin" <hello <at> paulwrankin.com>
Subject: [PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) skip
 leading whitespace in diary entries
Date: Wed, 15 Nov 2023 21:13:31 +1000
---
When diary entries have more than a single space between date and entry
this is displayed in diary display. This skips the leading whitespace.


 lisp/calendar/diary-lib.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 0d894f1..6806039 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -697,6 +697,8 @@ any entries were found."
                 (setq date-start (line-end-position 0))
                 ;; Actual entry starts on the next-line?
                 (if (looking-at "[ \t]*\n[ \t]") (forward-line 1))
+                ;; We don't want leading whitespace
+                (skip-chars-forward " \t")
                 (setq entry-found t
                       entry-start (point))
                 (forward-line 1)
-- 
2.42.0





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67203; Package emacs. (Fri, 15 Dec 2023 01:12:02 GMT) Full text and rfc822 format available.

Message #8 received at 67203 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: 67203 <at> debbugs.gnu.org
Cc: "Paul W. Rankin" <hello <at> paulwrankin.com>
Subject: Re: bug#67203: [PATCH] * lisp/calendar/diary-lib.el
 (diary-list-entries-2) skip leading whitespace in diary entries
Date: Thu, 14 Dec 2023 17:11:34 -0800
"Paul W. Rankin" via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs <at> gnu.org> writes:

> ---
> When diary entries have more than a single space between date and entry
> this is displayed in diary display. This skips the leading whitespace.

Thanks.  Could you give examples of a file with and without this
whitespace, and instructions for how to test your change?  I don't use
diary much myself.

Please also always send patches as attachments, formatted by

    git format-patch -1

Bonus points if you could also provide unit tests for this stuff, but
that's optional since this library currently lacks any.

>  lisp/calendar/diary-lib.el | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
> index 0d894f1..6806039 100644
> --- a/lisp/calendar/diary-lib.el
> +++ b/lisp/calendar/diary-lib.el
> @@ -697,6 +697,8 @@ any entries were found."
>                  (setq date-start (line-end-position 0))
>                  ;; Actual entry starts on the next-line?
>                  (if (looking-at "[ \t]*\n[ \t]") (forward-line 1))
> +                ;; We don't want leading whitespace
> +                (skip-chars-forward " \t")
>                  (setq entry-found t
>                        entry-start (point))
>                  (forward-line 1)
> --
> 2.42.0




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#67203; Package emacs. (Fri, 29 Dec 2023 02:52:01 GMT) Full text and rfc822 format available.

Message #11 received at 67203 <at> debbugs.gnu.org (full text, mbox):

From: "Paul W. Rankin" <hello <at> paulwrankin.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 67203 <at> debbugs.gnu.org
Subject: Re: bug#67203: [PATCH] * lisp/calendar/diary-lib.el
 (diary-list-entries-2) skip leading whitespace in diary entries
Date: Fri, 29 Dec 2023 12:50:48 +1000
Sorry for the late reply. I actually stopped using calendar. Twas but a 
brief interlude. I think there's a problem with my patch anyway.

On 2023-12-15 11:11, Stefan Kangas wrote:
> "Paul W. Rankin" via "Bug reports for GNU Emacs, the Swiss army knife 
> of
> text editors" <bug-gnu-emacs <at> gnu.org> writes:
> 
>> ---
>> When diary entries have more than a single space between date and 
>> entry
>> this is displayed in diary display. This skips the leading whitespace.
> 
> Thanks.  Could you give examples of a file with and without this
> whitespace, and instructions for how to test your change?  I don't use
> diary much myself.
> 
> Please also always send patches as attachments, formatted by
> 
>     git format-patch -1
> 
> Bonus points if you could also provide unit tests for this stuff, but
> that's optional since this library currently lacks any.
> 
>>  lisp/calendar/diary-lib.el | 2 ++
>>  1 file changed, 2 insertions(+)
>> 
>> diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
>> index 0d894f1..6806039 100644
>> --- a/lisp/calendar/diary-lib.el
>> +++ b/lisp/calendar/diary-lib.el
>> @@ -697,6 +697,8 @@ any entries were found."
>>                  (setq date-start (line-end-position 0))
>>                  ;; Actual entry starts on the next-line?
>>                  (if (looking-at "[ \t]*\n[ \t]") (forward-line 1))
>> +                ;; We don't want leading whitespace
>> +                (skip-chars-forward " \t")
>>                  (setq entry-found t
>>                        entry-start (point))
>>                  (forward-line 1)
>> --
>> 2.42.0




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Fri, 29 Dec 2023 03:43:02 GMT) Full text and rfc822 format available.

Notification sent to "Paul W. Rankin" <hello <at> paulwrankin.com>:
bug acknowledged by developer. (Fri, 29 Dec 2023 03:43:02 GMT) Full text and rfc822 format available.

Message #16 received at 67203-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: "Paul W. Rankin" <hello <at> paulwrankin.com>
Cc: 67203-done <at> debbugs.gnu.org
Subject: Re: bug#67203: [PATCH] * lisp/calendar/diary-lib.el
 (diary-list-entries-2) skip leading whitespace in diary entries
Date: Thu, 28 Dec 2023 19:42:01 -0800
"Paul W. Rankin" <hello <at> paulwrankin.com> writes:

> Sorry for the late reply. I actually stopped using calendar. Twas but a
> brief interlude. I think there's a problem with my patch anyway.

OK, thanks.  I'm therefore closing this bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 26 Jan 2024 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 106 days ago.

Previous Next


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