From dba6d68019c74232f581a55ab012fd9d06f53434 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 27 Jun 2022 14:04:00 +0200 Subject: [PATCH] Improve look of agenda on graphical displays * lisp/org-agenda.el (org-agenda-block-separator) (org-agenda-time-grid, org-agenda-current-time-string): Improve default visual elements on graphical displays. Inspired by org-modern.el by Daniel Mendler . --- lisp/org-agenda.el | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index a66d6e116..495fd5454 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -131,13 +131,18 @@ name and week number or the separator lines." :group 'org-agenda :type 'boolean) -(defcustom org-agenda-block-separator ?= +(defcustom org-agenda-block-separator + (if (and (display-graphic-p) + (char-displayable-p ?─)) + ?─ + ?=) "The separator between blocks in the agenda. If this is a string, it will be used as the separator, with a newline added. If it is a character, it will be repeated to fill the window width. If nil the separator is disabled. In `org-agenda-custom-commands' this addresses the separator between the current and the previous block." :group 'org-agenda + :version "29.1" :type '(choice (const :tag "Disabled" nil) (character) @@ -1539,11 +1544,12 @@ the variable `org-agenda-time-grid'." :type 'boolean) (defcustom org-agenda-time-grid - '((daily today require-timed) - (800 1000 1200 1400 1600 1800 2000) - "......" - "----------------") - + (let ((graphical (and (display-graphic-p) + (char-displayable-p ?┄)))) + `((daily today require-timed) + (800 1000 1200 1400 1600 1800 2000) + ,(if graphical " ┄┄┄┄┄ " "......") + ,(if graphical "┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄" "----------------"))) "The settings for time grid for agenda display. This is a list of four items. The first item is again a list. It contains symbols specifying conditions when the grid should be displayed: @@ -1563,6 +1569,7 @@ times that have a grid line. The fourth item is a string placed after the grid times. This will align with agenda items." :group 'org-agenda-time-grid + :version "29.1" :type '(list (set :greedy t :tag "Grid Display Options" @@ -1584,10 +1591,14 @@ will align with agenda items." :type 'boolean) (defcustom org-agenda-current-time-string - "now - - - - - - - - - - - - - - - - - - - - - - - - -" + (if (and (display-graphic-p) + (char-displayable-p ?⭠) + (char-displayable-p ?─)) + "⭠ now ───────────────────────────────────────────────" + "now - - - - - - - - - - - - - - - - - - - - - - - - -") "The string for the current time marker in the agenda." :group 'org-agenda-time-grid - :version "24.1" + :version "29.1" :type 'string) (defgroup org-agenda-sorting nil -- 2.30.2