1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-11 09:20:32 +00:00

agenda: Fix org-agenda-show-new-time on Emacs 24

* lisp/org-agenda.el (org-agenda-show-new-time): Add fallback for when
window-font-width isn't available.

efbf96389 (org-agenda.el: Fix display of agenda new time, 2020-02-02)
reworked the column calculation to use window-font-width, but that
function isn't available until Emacs 25, and it's definition can't be
easily ported to org-compat.

Instead just use the old logic, which had been in place since v8.2.6,
when window-font-width isn't available.

Reported-by: Ihor Radchenko <yantar92@gmail.com>
Link: https://orgmode.org/list/87y2d2mqik.fsf@localhost
This commit is contained in:
Kyle Meyer 2021-05-01 15:48:11 -04:00
parent 8bd3bd093b
commit 94837fc6b5

View File

@ -9700,7 +9700,12 @@ Called with a universal prefix arg, show the priority instead of setting it."
(line-end-position)
'(display nil))
(org-move-to-column
(- (/ (window-width nil t) (window-font-width)) (length stamp)) t)
(- (if (fboundp 'window-font-width)
(/ (window-width nil t) (window-font-width))
;; Fall back to pre-9.3.3 behavior on Emacs <25.
(window-width))
(length stamp))
t)
(add-text-properties
(1- (point)) (point-at-eol)
(list 'display (org-add-props stamp nil