* bug#67203: [PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) skip leading whitespace in diary entries
@ 2023-11-15 11:13 Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-15 1:11 ` Stefan Kangas
0 siblings, 1 reply; 4+ messages in thread
From: Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-11-15 11:13 UTC (permalink / raw)
To: 67203; +Cc: Paul W. Rankin
---
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#67203: [PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) skip leading whitespace in diary entries
2023-11-15 11:13 bug#67203: [PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) skip leading whitespace in diary entries Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-15 1:11 ` Stefan Kangas
2023-12-29 2:50 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Kangas @ 2023-12-15 1:11 UTC (permalink / raw)
To: 67203; +Cc: Paul W. Rankin
"Paul W. Rankin" via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <bug-gnu-emacs@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#67203: [PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) skip leading whitespace in diary entries
2023-12-15 1:11 ` Stefan Kangas
@ 2023-12-29 2:50 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-29 3:42 ` Stefan Kangas
0 siblings, 1 reply; 4+ messages in thread
From: Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-12-29 2:50 UTC (permalink / raw)
To: Stefan Kangas; +Cc: 67203
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@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
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#67203: [PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) skip leading whitespace in diary entries
2023-12-29 2:50 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-12-29 3:42 ` Stefan Kangas
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2023-12-29 3:42 UTC (permalink / raw)
To: Paul W. Rankin; +Cc: 67203-done
"Paul W. Rankin" <hello@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.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-29 3:42 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-15 11:13 bug#67203: [PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) skip leading whitespace in diary entries Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-15 1:11 ` Stefan Kangas
2023-12-29 2:50 ` Paul W. Rankin via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-29 3:42 ` Stefan Kangas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).