From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>
Received: from mp11.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms5.migadu.com with LMTPS
	id kCWFOBQW8mNkuwAAbAwnHQ
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 19 Feb 2023 13:29:08 +0100
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp11.migadu.com with LMTPS
	id wJObOBQW8mOwcAAA9RJhRA
	(envelope-from <emacs-orgmode-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 19 Feb 2023 13:29:08 +0100
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id AE33E1E81B
	for <larch@yhetil.org>; Sun, 19 Feb 2023 13:29:08 +0100 (CET)
Authentication-Results: aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20210112 header.b=D8Kf0ZdN;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=gmail.com
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676809748; a=rsa-sha256; cv=none;
	b=TxQcHZ0d8F3o3Bh1039yQ7L0fU/Gf2q45lrOzqzEHFoPP3bwC0n3xrarPSkABCcGHEGW+O
	U2zJboAkmJdEprNxFVf9pQomqVCkog6aGw7SXys66AAIhd7pmy3RAPF2X1sLq7okffWctr
	lsNLZVm6m+yz8nZBz/QL1zMktVUxIto+4/9UkYyYqhAejvHbtUJ4vBvz4QhjXLUO8LPnTo
	AwnUpbSYSjkdiisgcRycrGTZ5RL126fzdzQGsGKvNpVVYprmKju/R+1vOjacKsy1mMoYMK
	bl5WcIM+xCPAcqJmPrrNHFVTT1fFiYP9gnurFBsiuvUeQnytaEHlB8zM8kK4zQ==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=pass header.d=gmail.com header.s=20210112 header.b=D8Kf0ZdN;
	spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org";
	dmarc=pass (policy=none) header.from=gmail.com
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1676809748;
	h=from:from:sender:sender:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:mime-version:mime-version:
	 content-type:content-type:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=h0qJSVmYkRTtF8fMh0Usop28oPEN/3TJz71lf1D8yK8=;
	b=ir1iVSuT7/pHXzNvqnJuAdJoZUsruCInqmASjnVVqMfdMROKODQDkAkiU6EEtD15OO1Ehu
	N9Ll0ExC59bFzdv/YouqS79P/8XllUJyCYzlYNO2d0PMYz/WPr2LWD3uC4kLUAfrptnOX6
	aZajjfso8y+NrvzZKgP9nys8dYh0grTdYcgpOxYoemi8rvLlLRVcq12OrXQzOzFm7AUz6i
	Sg+gdgRHCLu5Yugtnwt55I9TBTEOtmzYXRmhq1DSZU1lQi7+nGI7j79PYPvJ5qbR22L8J4
	o72XLmAS8Q5UO1EcdNY8MCetfFsQ8RlxOJxLwgxLOR7exhb/Vv/nXJWt6sAafQ==
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <emacs-orgmode-bounces@gnu.org>)
	id 1pTinv-0006hY-Ez; Sun, 19 Feb 2023 07:28:31 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ichernyshovvv@gmail.com>)
 id 1pTint-0006hQ-Pv
 for emacs-orgmode@gnu.org; Sun, 19 Feb 2023 07:28:29 -0500
Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ichernyshovvv@gmail.com>)
 id 1pTins-0003WW-8D
 for emacs-orgmode@gnu.org; Sun, 19 Feb 2023 07:28:29 -0500
Received: by mail-lf1-x131.google.com with SMTP id t5so581514lfe.11
 for <emacs-orgmode@gnu.org>; Sun, 19 Feb 2023 04:28:27 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
 h=mime-version:message-id:date:subject:to:from:user-agent:from:to:cc
 :subject:date:message-id:reply-to;
 bh=h0qJSVmYkRTtF8fMh0Usop28oPEN/3TJz71lf1D8yK8=;
 b=D8Kf0ZdN37XzgizZjnNAQgbVKkfOFIKZq2P95nKS3T/jO0uWQb08TFogQCxCzSIGXS
 w29rL5CNEHMkqppmPzM3Fx2c4WxMmiH0Psl7qKO+SGKq37AnavarvabMcEODyEdzIJG/
 NSk+SpC+l+g0d6HKzF8wab6pjHa24HJA1cEE9mcSQWFYRMArOxm0yBrmV/YClkAhGK6y
 wp73LC65vJ/kH93Eqr4qkJMtUFgW4fS3vuQ6eX/UH1SLPEp4zTMJnGMe89GHOeEUgoGU
 uMmgGyNFT27o6Uf7u6rjgrSjUakwyIpyHp3AakoiuGqOiedHaBW3DatlI4dpXVXUjmcq
 m1CQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=mime-version:message-id:date:subject:to:from:user-agent
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=h0qJSVmYkRTtF8fMh0Usop28oPEN/3TJz71lf1D8yK8=;
 b=ZKBcZLwCha4QFGt/4ex0KxXIOSnn/rPkdas8uDSjHSe1ubEesTMt9oobx2e+he4Twc
 Zwa8XG0CLCKOqnA+lZY4rRdt1bQWSQnWo4j0tYTsNWKYp2q1dB1iN1oZHYO1/bYoA5qQ
 6SmjidW352Hwc/OGkmv3T9vJ2MXLcOWRt4C4IXnbu6lvFP4uPyMwCGE7mmrAtp8iKFsd
 UA7d1wc57QOqrA6THPZlagad7BIsBnyBz3OyzYkbxj1ssJw+kpatQk78gvOQbvSbuuj6
 ircMltPczVmZnKQzEFhb/UiQ+5GCl2SpYAzkyH7n33wGKpikuuFs7bkRiBDb41B9rd3p
 Souw==
X-Gm-Message-State: AO0yUKUdyc0fNQvkHnhLx1Fm7hr7Y8n/Oh2130D2ziDlquIU+QGjFXoE
 k/wFwvUwxXwQ+NhXbKEjKAkbDnBigSM=
X-Google-Smtp-Source: AK7set9ClSBnOcHI9sZ80RwmqHQfrFDhbasM/lX80w/Xj2/Mav05SBXKO6yhHqFkRRucc5GmiR2KhA==
X-Received: by 2002:ac2:5a46:0:b0:4db:2c28:8974 with SMTP id
 r6-20020ac25a46000000b004db2c288974mr250962lfn.12.1676809705787; 
 Sun, 19 Feb 2023 04:28:25 -0800 (PST)
Received: from laptop ([62.118.86.114]) by smtp.gmail.com with ESMTPSA id
 v23-20020a197417000000b004dc48d91061sm1238629lfe.304.2023.02.19.04.28.24
 for <emacs-orgmode@gnu.org>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 19 Feb 2023 04:28:25 -0800 (PST)
User-agent: mu4e 1.8.13; emacs 30.0.50
From: Ilya Chernyshov <ichernyshovvv@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [PATCH] org-element-timestamp-interpreter: Return daterange anyway,
 if DATERANGE is non-nil
Date: Sun, 19 Feb 2023 19:25:38 +0700
Message-ID: <87y1ot6dqz.fsf@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
Received-SPF: pass client-ip=2a00:1450:4864:20::131;
 envelope-from=ichernyshovvv@gmail.com; helo=mail-lf1-x131.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-BeenThere: emacs-orgmode@gnu.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "General discussions about Org-mode." <emacs-orgmode.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/emacs-orgmode>
List-Post: <mailto:emacs-orgmode@gnu.org>
X-Migadu-Queue-Id: AE33E1E81B
X-Spam-Score: -4.85
X-Migadu-Spam-Score: -4.85
X-Migadu-Scanner: scn0.migadu.com
List-Help: <mailto:emacs-orgmode-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/emacs-orgmode>,
 <mailto:emacs-orgmode-request@gnu.org?subject=subscribe>
Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org
X-Migadu-Flow: FLOW_IN
X-Migadu-Country: US
X-TUID: hoEDCv2SaYdF

Hello, guys

`org-element-timestamp-interpreter' function returns string of the 
form
"<2023-02-19 Sun 10:00>--<2023-02-19 Sun 10:30>" for a timestamp 
object
passed to it. The better result would be "<2023-02-19 Sun 
10:00-10:30>".

This function is also used for interpreting clock entries, which 
only
have the format of "[2023-02-19 Sun 10:00]--[2023-02-19 Sun 
10:30]".

So, an option is needed that controls whether to return a 
daterange
(even it's possible to return a timerange) or a timerange (if the 
dates
in the range are equal).

I wrote a patch that handles this problem, could you please review 
the
code and give some advice to improve it?

-- 
Best,
Ilya