emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Improve look of agenda on graphical displays
@ 2022-06-27 12:08 Stefan Kangas
  2022-06-29  9:19 ` Ihor Radchenko
  2022-06-30  7:28 ` [PATCH] Improve look of agenda on graphical displays Ihor Radchenko
  0 siblings, 2 replies; 11+ messages in thread
From: Stefan Kangas @ 2022-06-27 12:08 UTC (permalink / raw)
  To: Org-mode; +Cc: Daniel Mendler

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

The attached patch improves the look of the agenda time grid and
separator line on graphical displays.  It was inspired by
org-modern.el by Daniel Mendler.

[-- Attachment #2: 0001-Improve-look-of-agenda-on-graphical-displays.patch --]
[-- Type: text/x-patch, Size: 3132 bytes --]

From dba6d68019c74232f581a55ab012fd9d06f53434 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
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 <mail@daniel-mendler.de>.
---
 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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Improve look of agenda on graphical displays
  2022-06-27 12:08 [PATCH] Improve look of agenda on graphical displays Stefan Kangas
@ 2022-06-29  9:19 ` Ihor Radchenko
  2022-06-29 10:20   ` Stefan Kangas
  2022-06-30  7:28 ` [PATCH] Improve look of agenda on graphical displays Ihor Radchenko
  1 sibling, 1 reply; 11+ messages in thread
From: Ihor Radchenko @ 2022-06-29  9:19 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Org-mode, Daniel Mendler

Stefan Kangas <stefan@marxist.se> writes:

> The attached patch improves the look of the agenda time grid and
> separator line on graphical displays.  It was inspired by
> org-modern.el by Daniel Mendler.

Thanks! Looks good.

>    :group 'org-agenda
> +  :version "29.1"
> ...
> -  :version "24.1"
> +  :version "29.1"
>    :type 'string)

I am wondering if this is meaningful considering that Org is not always
distributed together with Emacs. Will this :version tag make any sense
for people using the newest Org with older Emacs versions?

Best,
Ihor


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Improve look of agenda on graphical displays
  2022-06-29  9:19 ` Ihor Radchenko
@ 2022-06-29 10:20   ` Stefan Kangas
  2022-06-29 12:46     ` [STYLE] :version tags in defcustom definitions (was: [PATCH] Improve look of agenda on graphical displays) Ihor Radchenko
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Kangas @ 2022-06-29 10:20 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org-mode, Daniel Mendler

Ihor Radchenko <yantar92@gmail.com> writes:

> >    :group 'org-agenda
> > +  :version "29.1"
> > ...
> > -  :version "24.1"
> > +  :version "29.1"
> >    :type 'string)
>
> I am wondering if this is meaningful considering that Org is not always
> distributed together with Emacs. Will this :version tag make any sense
> for people using the newest Org with older Emacs versions?

I think it won't really, but that's okay.  Also, this is how Org has
used these tags historically, try grepping for ":version" to see.

IOW, changing this is orthogonal to this patch.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [STYLE] :version tags in defcustom definitions (was: [PATCH] Improve look of agenda on graphical displays)
  2022-06-29 10:20   ` Stefan Kangas
@ 2022-06-29 12:46     ` Ihor Radchenko
  2022-06-29 12:55       ` Stefan Kangas
  0 siblings, 1 reply; 11+ messages in thread
From: Ihor Radchenko @ 2022-06-29 12:46 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Org-mode, Daniel Mendler

Stefan Kangas <stefan@marxist.se> writes:

>> I am wondering if this is meaningful considering that Org is not always
>> distributed together with Emacs. Will this :version tag make any sense
>> for people using the newest Org with older Emacs versions?
>
> I think it won't really, but that's okay.  Also, this is how Org has
> used these tags historically, try grepping for ":version" to see.

I did try. Only ~40% of defcustoms are supplied with :version tags.
Also, ~75% of the tags were introduced long time ago: Emacs 24.
The rest, except the 4 (four in total) Emacs 27 are all Emacs 26.

> IOW, changing this is orthogonal to this patch.

Sure. Just trying to clarify my confusion. The inconsistency with some
defcustoms using :version and some not is bugging me.

Best,
Ihor


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [STYLE] :version tags in defcustom definitions (was: [PATCH] Improve look of agenda on graphical displays)
  2022-06-29 12:46     ` [STYLE] :version tags in defcustom definitions (was: [PATCH] Improve look of agenda on graphical displays) Ihor Radchenko
@ 2022-06-29 12:55       ` Stefan Kangas
  2022-06-29 14:07         ` Timothy
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Kangas @ 2022-06-29 12:55 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org-mode, Daniel Mendler

Ihor Radchenko <yantar92@gmail.com> writes:

> Sure. Just trying to clarify my confusion. The inconsistency with some
> defcustoms using :version and some not is bugging me.

Agreed.  It would be better to be consistent with this.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [STYLE] :version tags in defcustom definitions (was: [PATCH] Improve look of agenda on graphical displays)
  2022-06-29 12:55       ` Stefan Kangas
@ 2022-06-29 14:07         ` Timothy
  2022-06-29 16:56           ` Bruce D'Arcus
  2022-11-13  7:38           ` [PATCH] " Ihor Radchenko
  0 siblings, 2 replies; 11+ messages in thread
From: Timothy @ 2022-06-29 14:07 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Ihor Radchenko, Daniel Mendler, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

Hi Ihor and Stefan,

>> Sure. Just trying to clarify my confusion. The inconsistency with some
>> defcustoms using :version and some not is bugging me.
>
> Agreed.  It would be better to be consistent with this.

Given that org-mode is distributed separately to Emacs, and I get the impression
having a newer org-mode version that Emacs version is not uncommon, I think it
would make sense to have /just/ org-mode version tags.

All the best,
Timothy

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [STYLE] :version tags in defcustom definitions (was: [PATCH] Improve look of agenda on graphical displays)
  2022-06-29 14:07         ` Timothy
@ 2022-06-29 16:56           ` Bruce D'Arcus
  2022-11-13  7:38           ` [PATCH] " Ihor Radchenko
  1 sibling, 0 replies; 11+ messages in thread
From: Bruce D'Arcus @ 2022-06-29 16:56 UTC (permalink / raw)
  To: Timothy; +Cc: Stefan Kangas, Ihor Radchenko, Daniel Mendler, org-mode-email

On Wed, Jun 29, 2022 at 10:23 AM Timothy <tecosaur@gmail.com> wrote:
>
> Hi Ihor and Stefan,
>
> >> Sure. Just trying to clarify my confusion. The inconsistency with some
> >> defcustoms using :version and some not is bugging me.
> >
> > Agreed.  It would be better to be consistent with this.
>
> Given that org-mode is distributed separately to Emacs, and I get the impression
> having a newer org-mode version that Emacs version is not uncommon, I think it
> would make sense to have /just/ org-mode version tags.

+1

Bruce


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Improve look of agenda on graphical displays
  2022-06-27 12:08 [PATCH] Improve look of agenda on graphical displays Stefan Kangas
  2022-06-29  9:19 ` Ihor Radchenko
@ 2022-06-30  7:28 ` Ihor Radchenko
  1 sibling, 0 replies; 11+ messages in thread
From: Ihor Radchenko @ 2022-06-30  7:28 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Org-mode, Daniel Mendler

Stefan Kangas <stefan@marxist.se> writes:

> The attached patch improves the look of the agenda time grid and
> separator line on graphical displays.  It was inspired by
> org-modern.el by Daniel Mendler.

Applied onto main via 998a0aacd.

Best,
Ihor


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] Re: [STYLE] :version tags in defcustom definitions (was: [PATCH] Improve look of agenda on graphical displays)
  2022-06-29 14:07         ` Timothy
  2022-06-29 16:56           ` Bruce D'Arcus
@ 2022-11-13  7:38           ` Ihor Radchenko
  2022-11-19 13:03             ` [PATCH] Re: [STYLE] :version tags in defcustom definitions Bastien Guerry
  1 sibling, 1 reply; 11+ messages in thread
From: Ihor Radchenko @ 2022-11-13  7:38 UTC (permalink / raw)
  To: Timothy, Bastien
  Cc: Stefan Kangas, Ihor Radchenko, Daniel Mendler, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 876 bytes --]

Timothy <tecosaur@gmail.com> writes:

>>> Sure. Just trying to clarify my confusion. The inconsistency with some
>>> defcustoms using :version and some not is bugging me.
>>
>> Agreed.  It would be better to be consistent with this.
>
> Given that org-mode is distributed separately to Emacs, and I get the impression
> having a newer org-mode version that Emacs version is not uncommon, I think it
> would make sense to have /just/ org-mode version tags.

I have just updated the :package-version tags in the new and changed
variables in Org 9.6.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5a10517d021acba071cd4a2c3b90de84c8e9f3cb

I also plan to push the attached change to org-maintenance document in
WORG.

I think we can replace the old :package keywords as needed, similar to
the Emacs' whitespace policy.

Let me know if there are any objections.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-maintenance.org-Document-updating-package-versio.patch --]
[-- Type: text/x-patch, Size: 1126 bytes --]

From f1e2b8daca3bb4bdde0d6d98376d2f1e4c608e94 Mon Sep 17 00:00:00 2001
Message-Id: <f1e2b8daca3bb4bdde0d6d98376d2f1e4c608e94.1668325064.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Sun, 13 Nov 2022 15:33:50 +0800
Subject: [PATCH] org-maintenance.org: Document updating :package-version

* org-maintenance.org (For minor and major releases): Document that it
is necessary to update :package-version in the new and changed
`defcustom' statements.
---
 org-maintenance.org | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/org-maintenance.org b/org-maintenance.org
index 3cc1ea53..35b70e0a 100644
--- a/org-maintenance.org
+++ b/org-maintenance.org
@@ -274,6 +274,10 @@ *** For minor and major releases
 When doing a minor or major release, the =main= branch should be merged
 into the =bugfix= branch.
 
+Also, ~:package-version~ tags should be added to new and changed
+~defcustom~ statements as needed.  If a statement also contain ~:version~
+tag, it should be removed in favor of ~:package-version~.
+
 *** Releasing by adding a new tag
 :PROPERTIES:
 :CUSTOM_ID: release-tags
-- 
2.35.1


[-- Attachment #3: Type: text/plain, Size: 224 bytes --]


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] Re: [STYLE] :version tags in defcustom definitions
  2022-11-13  7:38           ` [PATCH] " Ihor Radchenko
@ 2022-11-19 13:03             ` Bastien Guerry
  2022-11-20  5:47               ` Ihor Radchenko
  0 siblings, 1 reply; 11+ messages in thread
From: Bastien Guerry @ 2022-11-19 13:03 UTC (permalink / raw)
  To: Ihor Radchenko
  Cc: Timothy, Stefan Kangas, Ihor Radchenko, Daniel Mendler,
	emacs-orgmode

Ihor Radchenko <yantar92@posteo.net> writes:

> Let me know if there are any objections.

None on my side, thanks for this.

-- 
 Bastien


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] Re: [STYLE] :version tags in defcustom definitions
  2022-11-19 13:03             ` [PATCH] Re: [STYLE] :version tags in defcustom definitions Bastien Guerry
@ 2022-11-20  5:47               ` Ihor Radchenko
  0 siblings, 0 replies; 11+ messages in thread
From: Ihor Radchenko @ 2022-11-20  5:47 UTC (permalink / raw)
  To: Bastien Guerry
  Cc: Timothy, Stefan Kangas, Ihor Radchenko, Daniel Mendler,
	emacs-orgmode

Bastien Guerry <bzg@gnu.org> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> Let me know if there are any objections.
>
> None on my side, thanks for this.

Applied onto master.
https://git.sr.ht/~bzg/worg/commit/8dd5762e28876fce7193f96eed65356698e917f0

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-11-20  5:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-27 12:08 [PATCH] Improve look of agenda on graphical displays Stefan Kangas
2022-06-29  9:19 ` Ihor Radchenko
2022-06-29 10:20   ` Stefan Kangas
2022-06-29 12:46     ` [STYLE] :version tags in defcustom definitions (was: [PATCH] Improve look of agenda on graphical displays) Ihor Radchenko
2022-06-29 12:55       ` Stefan Kangas
2022-06-29 14:07         ` Timothy
2022-06-29 16:56           ` Bruce D'Arcus
2022-11-13  7:38           ` [PATCH] " Ihor Radchenko
2022-11-19 13:03             ` [PATCH] Re: [STYLE] :version tags in defcustom definitions Bastien Guerry
2022-11-20  5:47               ` Ihor Radchenko
2022-06-30  7:28 ` [PATCH] Improve look of agenda on graphical displays Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).