emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: tumashu  <tumashu@163.com>
To: "Ihor Radchenko" <yantar92@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re:[PATCH] The align of time is not beautiful as 9.4 when I update to org 9.5.
Date: Mon, 4 Oct 2021 18:55:28 +0800 (CST)	[thread overview]
Message-ID: <7cf862df.1706.17c4af1bcdb.Coremail.tumashu@163.com> (raw)
In-Reply-To: <877detcjry.fsf@localhost>

















At 2021-10-04 15:48:49, "Ihor Radchenko" <yantar92@gmail.com> wrote:
>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.

If change s1, I think s2 should be deal with too, by the way, what about change the below function?

```
(defun org-agenda-time-of-day-to-ampm-maybe (time)
  "Conditionally convert TIME to AM/PM format.
This is based on `org-agenda-timegrid-use-ampm'."
  (if org-agenda-timegrid-use-ampm
      (org-agenda-time-of-day-to-ampm time)
    time))
    ^^^
```

Another way is creating a new function for the below code, so user can advice it to full control time string format.

```
(cond (s2 (concat
			      (org-agenda-time-of-day-to-ampm-maybe s1)
			      "-" (org-agenda-time-of-day-to-ampm-maybe s2)
			      (when org-agenda-timegrid-use-ampm " ")))
			 (s1 (concat
			      (org-agenda-time-of-day-to-ampm-maybe s1)
			      (if org-agenda-timegrid-use-ampm
                                  (concat time-grid-trailing-characters " ")
                                time-grid-trailing-characters)))
			 (t ""))

```


>
>Best,
>Ihor
>

  parent reply	other threads:[~2021-10-04 11:11 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 ` [PATCH] " Ihor Radchenko
2021-10-04  9:52   ` 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 [this message]
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=7cf862df.1706.17c4af1bcdb.Coremail.tumashu@163.com \
    --to=tumashu@163.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@gmail.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).