From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UNRrBpIWymOMOAAAbAwnHQ (envelope-from ) for ; Fri, 20 Jan 2023 05:20:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 4A6OBZIWymOoPAAAG6o9tA (envelope-from ) for ; Fri, 20 Jan 2023 05:20:34 +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 9DA3B13650 for ; Fri, 20 Jan 2023 05:20:33 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIisN-00075d-DS; Thu, 19 Jan 2023 23:19:39 -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 ) id 1pIisM-00075R-6e for emacs-orgmode@gnu.org; Thu, 19 Jan 2023 23:19:38 -0500 Received: from netyu.xyz ([152.44.41.246] helo=mail.netyu.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIisK-0000eQ-El; Thu, 19 Jan 2023 23:19:37 -0500 Received: from fw.net.yu.netyu.xyz ( [222.248.4.98]) by netyu.xyz (OpenSMTPD) with ESMTPSA id 49045c7f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 20 Jan 2023 04:19:29 +0000 (UTC) References: <873597xtqr.fsf@gautierponsinet.xyz> <87y1q1h0gm.fsf@localhost> <63f0246aa85d34eb4fc787d4fad4c3e3@gautierponsinet.xyz> <87v8l46tos.fsf@localhost> <87lely4wne.fsf@localhost> <12a8d2e8b36fb5c6f61a2b084e22a7b8@gautierponsinet.xyz> User-agent: mu4e 1.8.13; emacs 29.0.60 To: gautier@gautierponsinet.xyz Cc: Ihor Radchenko , Bastien , emacs-orgmode@gnu.org Subject: Re: New face: org-agenda-calendar-timerange Date: Fri, 20 Jan 2023 11:32:49 +0800 In-reply-to: <12a8d2e8b36fb5c6f61a2b084e22a7b8@gautierponsinet.xyz> Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=152.44.41.246; envelope-from=ruijie@netyu.xyz; helo=mail.netyu.xyz X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FROM_SUSPICIOUS_NTLD=0.499, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Ruijie Yu From: Ruijie Yu via "General discussions about Org-mode." Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674188433; a=rsa-sha256; cv=none; b=YgUkPwxh8IRmQqvXH6fwg76ZZy2sZ309S29Loem15SJclGdFvrp8Y3pHIlR2Mu8iRd6p0i puDH9BQtnHvUyV1CqBdaDQ5MH4J7QT6qDbDMk5yQ2GEY7zOdqkTLWC7y3YJDoKqZje6NCF 8FT4qsjVERjfYmd1o/UZrVm61ZplxMVl9EX7/YWnKdU526lxS/FoClATfeA4OCRfDXEgoV 0ofEsTXcfNf7+SET1Pav7ihN0WaMwgHA78Wvx2iMp9OQZ6u2rUpEKGaYw3r4yXzZ09W3Zv f6GZd8NpTmxAi4thEGC6wJMPkMy/j9ePfnRrr/fGOP5+YVoEKhmtIxeWMUEk9A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674188433; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=k+KVPtE23j/9Lfe/0qYyqk3BLbGU3hPuy+8dUi9lnNI=; b=X3CGN7dWHtUxZBWiITZaGnX0NC0/qJSWKny1AbrvW+MQcdkUWxRgpbmXPH9jz1r3tQ3YkJ cAHwH61uFvOwzHuv7mWs5WNFiGDwZ4RWB5ENea4RPA9jWsfZg3jCXOSld3ptMXbs5OYPTu CarpJyjl9z+rzJjybjw/ytfVYdX9VYnFwLQBgHCLJEoBxi2FzpJDOXnuiQPHzxUFnQYHu7 1ZNzq1vRGJzLFN6HhEu0aEXIKGMzAluLPm5RrjH93PzXPGDtGZarHfjal3BgaM7NMtGb/P G5mgvBSMO7h0442XH42mVOjfuXhHguxdmNT8/iOsx6W4AWjmLDCl/qkptVNJ+w== X-Spam-Score: -3.21 X-Migadu-Queue-Id: 9DA3B13650 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -3.21 X-TUID: NkeFuBUiWfLR --=-=-= Content-Type: text/plain gautier@gautierponsinet.xyz writes: > Please find attached a patch containing two commits. > > [...] > > It seems to me that this should be done by creating repeating tasks > rather than an entry with a timerange, because suppose I want to put > in my agenda an event spanning on several days including the precise > hours at which it starts and ends but which starts and ends on the > same hour, for example an entry with the following timerange: > > <2023-01-19 jeu. 12:00>--<2023-01-26 jeu. 12:00> . Slight tangent, it seems that this time range has French abbreviations, is there any resource I can take a look to find recognized abbreviations for each language that I am interested in? > In this case, it makes no sense to print the time "12:00" everyday in > the range. I would expect the agenda to show the event on each days it > is, the time at which the event starts on the first day, and the time > at which the event ends on the last day. Does that make sense? I agree, this is what I am used to with other calendar programs for displaying multi-day events. For the in-between days, maybe these events should be shown as full-day events? > All the best, > Gautier. > From e3feebdf3596645d28d66c1baf6296bcaedf1f42 Mon Sep 17 00:00:00 2001 > From: Gautier Ponsinet > Date: Thu, 19 Jan 2023 21:34:37 +0100 > Subject: [PATCH 1/2] org-agenda: Apply the face `org-agenda-calendar-event' > > * list/org-agenda.el (org-agenda-get-blocks): Apply the face > `org-agenda-calendar-event' to entries with a time range within a > single day. > --- > lisp/org-agenda.el | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index d983a0916..4f29f3eb6 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > [...] > @@ -7109,6 +7108,9 @@ scheduled items with an hour specification like [h]h:mm." > (setq donep (member todo-state org-done-keywords)) > (when (and donep org-agenda-skip-timestamp-if-done) > (throw :skip t)) > + (setq face (if (= d1 d2) > + 'org-agenda-calendar-event > + nil)) > (setq marker (org-agenda-new-marker (point)) > category (org-get-category)) > (setq effort (save-match-data (or (get-text-property (point) 'effort) > [...] > -- > 2.39.1 I see an (if cond then nil) construct. Not that it matters for the entire patch, since the else case is updated in the second commit, but I want to use this opportunity to fulfill my longstanding curiosity on lisp styles. For cases where the "else" branch is nil, I have seen the following three types of constructs: 1. (if cond then nil) -- like this commit 2. (and cond then) -- what I have heard people prefer and have started to adopt 3. (if cond then) -- I found this construct in various patches and source files Do people prefer one over the other two, and why? > From 5dc50a84ab6adc1765eaf5bf3cf3c670df69f355 Mon Sep 17 00:00:00 2001 > From: Gautier Ponsinet > Date: Thu, 19 Jan 2023 22:18:12 +0100 > Subject: [PATCH 2/2] Define the face `org-agenda-calendar-daterange' > [...] > -- > 2.39.1 The patch applies cleanly on current main branch (52f29d4da), and all tests from `make test` passed. However, I don't see any effects on a test org buffer (see attached) -- in particular, I don't see the `org-agenda-calendar-daterange' face being shown anywhere on the buffer. According to `C-u C-x =' (`what-cursor-position'), all three date ranges use `org-date' face. $ git am this.patch $ make test $ emacs -Q -L lisp -l org agenda.org (type `C-u C-x =' on each date range to see `org-date') --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=agenda.org Content-Description: test org file * Multi-Day Range <2023-01-20 Fri 13:00>--<2023-01-23 Mon 13:00> description * Same-Day Multi-Stamp Range <2023-01-21 Sat 13:00>-<2023-01-21 Sat 15:00> description * Same-Day Single-Stamp Range <2023-01-21 Sat 13:00-15:00> description --=-=-= Content-Type: text/plain Thoughts? Will do the same on the original main branch to ensure I didn't misunderstand something. Best, RY --=-=-=--