Browse Source

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
Kyle Meyer 4 năm trước cách đây
mục cha
commit
94837fc6b5
1 tập tin đã thay đổi với 6 bổ sung1 xóa
  1. 6 1
      lisp/org-agenda.el

+ 6 - 1
lisp/org-agenda.el

@@ -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