bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#67203: [PATCH] * lisp/calendar/diary-lib.el (diary-list-entries-2) s


From: Paul W. Rankin
Subject: 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
User-agent: Purely Mail via Roundcube/1.6.5

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]