From cd7c52972ea93029278f462fb0240e49aaba4fa2 Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko Date: Tue, 4 Jul 2023 19:34:41 +0300 Subject: [PATCH] org-agenda-show-new-time: Fix when window is very narrow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/org-agenda.el (org-agenda-show-new-time): When window is narrower than timestamp, do not try to display timestamps starting at negative column. Reported-by: Nick Römer Link: https://orgmode.org/list/4196e86e.19136.1891ceef131.Webtop.154@skynet.be --- lisp/org-agenda.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 89c10403b..5594c7453 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -10100,8 +10100,10 @@ (defun org-agenda-show-new-time (marker stamp &optional prefix) (line-end-position) '(display nil)) (org-move-to-column - (- (window-max-chars-per-line) - (length stamp)) + (min + 1 ;; narrow buffer and wide timestamp + (- (window-max-chars-per-line) + (length stamp))) t) (add-text-properties (1- (point)) (line-end-position) -- 2.41.0