emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: tumashu <tumashu@163.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] The align of time is not beautiful as 9.4 when I update to org 9.5.
Date: Mon, 04 Oct 2021 15:48:49 +0800	[thread overview]
Message-ID: <877detcjry.fsf@localhost> (raw)
In-Reply-To: <3afe1bba.2f48.17c350d0a41.Coremail.tumashu@163.com>

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

tumashu <tumashu@163.com> writes:

> Hello:
>
>
> When I update to org 9.5,  I find that  the align of time like "7:00" has been changed.
>
> I think the new style is not beautiful as old style.
>  
> 1. New style look like not align to  the first char, for the width of 9 looks like > 1
> 2. the old style is align ":"

The attached patch should fix the issue. Please, test it though. I do
not use time grid regularly.

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-agenda-Make-sure-that-time-grid-is-aligned-when-.patch --]
[-- Type: text/x-diff, Size: 1240 bytes --]

From df5c35bd84e1d343c52c605c2c77393fb11ad590 Mon Sep 17 00:00:00 2001
Message-Id: <df5c35bd84e1d343c52c605c2c77393fb11ad590.1633333631.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Mon, 4 Oct 2021 15:45:16 +0800
Subject: [PATCH] org-agenda: Make sure that time grid is aligned when hour <10

* lisp/org-agenda.el (org-agenda-format-item): Make sure that hour
part of begin time in time grid always occupy 5 chars

Fixes https://list.orgmode.org/orgmode/3afe1bba.2f48.17c350d0a41.Coremail.tumashu@163.com/
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 354f40867..e20d0225f 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6765,7 +6765,7 @@         (defvar level) (defvar tag) (defvar time))
 	    (setq duration (- (org-duration-to-minutes s2)
 			      (org-duration-to-minutes s1))))
           ;; Format S1 and S2 for display.
-	  (when s1 (setq s1 (org-get-time-of-day s1 'overtime)))
+	  (when s1 (setq s1 (format "%05s" (org-get-time-of-day s1 'overtime))))
 	  (when s2 (setq s2 (org-get-time-of-day s2 'overtime))))
 	(when (string-match org-tag-group-re txt)
 	  ;; Tags are in the string
-- 
2.32.0


  parent reply	other threads:[~2021-10-04  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30  4:53 tumashu
2021-09-30 10:59 ` Ihor Radchenko
2021-09-30 11:19   ` Eric S Fraga
2021-10-04  7:48 ` Ihor Radchenko [this message]
2021-10-04  9:52   ` [PATCH] " Max Nikulin
2021-10-04 10:13     ` Nicolas Goaziou
2021-10-04 10:36       ` Ihor Radchenko
2021-10-06 12:48         ` Nicolas Goaziou
2021-10-04 10:55   ` tumashu
2021-12-11  7:44     ` Ihor Radchenko
2021-12-18  8:15       ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877detcjry.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tumashu@163.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).