emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Custom timestamps in date ranges
@ 2017-07-05 13:52 jeeger
  2017-07-05 21:19 ` Nicolas Goaziou
  0 siblings, 1 reply; 2+ messages in thread
From: jeeger @ 2017-07-05 13:52 UTC (permalink / raw)
  To: emacs-orgmode

Hello!

I have a single-line patch to contribute. In my org-mode version (Org 
mode version 9.0.9 (9.0.9-30-g796a78-elpa)), custom timestamps do not 
correctly apply to date ranges. Only the second date is replaced in the 
custom date format. I've tracked this down to org-activate-dates. The 
line

       (if (match-end 3)
		  (org-display-custom-time (match-beginning 3) (match-end 3))
		  (org-display-custom-time (match-beginning 1) (match-end 1)))

leads to only the second of the date range being fontified. The 
corrected version is:

	(when (match-end 3)
		(org-display-custom-time (match-beginning 3) (match-end 3)))
	(org-display-custom-time (match-beginning 1) (match-end 1))

This fontifies the first date correctly as well.

Regards,
Jan Seeger

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

* Re: Custom timestamps in date ranges
  2017-07-05 13:52 Custom timestamps in date ranges jeeger
@ 2017-07-05 21:19 ` Nicolas Goaziou
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-07-05 21:19 UTC (permalink / raw)
  To: jeeger; +Cc: emacs-orgmode

Hello,

jeeger <jeeger@mail.thenybble.de> writes:

> I have a single-line patch to contribute. In my org-mode version (Org
> mode version 9.0.9 (9.0.9-30-g796a78-elpa)), custom timestamps do not
> correctly apply to date ranges. Only the second date is replaced in
> the custom date format. I've tracked this down to org-activate-dates.
> The line
>
>       (if (match-end 3)
> 		  (org-display-custom-time (match-beginning 3) (match-end 3))
> 		  (org-display-custom-time (match-beginning 1) (match-end 1)))
>
> leads to only the second of the date range being fontified. The
> corrected version is:
>
> 	(when (match-end 3)
> 		(org-display-custom-time (match-beginning 3) (match-end 3)))
> 	(org-display-custom-time (match-beginning 1) (match-end 1))
>
> This fontifies the first date correctly as well.

Thank you.

Would it makes sense to add a comment above the `when' explaining this
is about date ranges?

Also, could you use git format-patch and add an appropriate commit
message so I can apply your changes?

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2017-07-05 21:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-05 13:52 Custom timestamps in date ranges jeeger
2017-07-05 21:19 ` Nicolas Goaziou

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).