From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Barnier Subject: [PATCH] Add the ability to remove time ranges specifications for agenda items that span on several days Date: Mon, 12 Jul 2010 13:57:24 +0000 (UTC) Message-ID: References: <871vb99ghh.dlv@debian.org> <1912379A-F701-4A61-BD37-D43A648EBD7B@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=47959 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OYJYF-0001ti-BO for emacs-orgmode@gnu.org; Mon, 12 Jul 2010 10:00:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OYJYE-0003s3-7s for emacs-orgmode@gnu.org; Mon, 12 Jul 2010 10:00:07 -0400 Received: from lo.gmane.org ([80.91.229.12]:51195) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OYJYD-0003rm-S6 for emacs-orgmode@gnu.org; Mon, 12 Jul 2010 10:00:06 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OYJYB-0005N7-7U for emacs-orgmode@gnu.org; Mon, 12 Jul 2010 16:00:03 +0200 Received: from zone129host186.ens-lsh.fr ([zone129host186.ens-lsh.fr]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jul 2010 16:00:03 +0200 Received: from julien by zone129host186.ens-lsh.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jul 2010 16:00:03 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Carsten Dominik gmail.com> writes: > No, there is currently not. I just coded a small patch that seems to work. It introduces a new custom variable to org-agenda, called "org-agenda-remove-timeranges-from-blocks" (there could be a better name !) which, when non-nil, removes the time ranges specifications from agenda lines. Short example with the following entry : *** <2010-07-16 lun.>--<2010-07-17 mer.> Test entry If the variable is set to nil : Vendredi 16 Juillet 2010 -- <2010-07-16 lun.>--<2010-07-17 mer.> Test entry Samedi 17 Juillet 2010 -- <2010-07-16 lun.>--<2010-07-17 mer.> Test entry If the variable is non-nil : Vendredi 16 Juillet 2010 -- Test entry Samedi 17 Juillet 2010 -- Test entry Feel free to modify the patch or to find it quite unuseful :-) Sincerely, Julien --- lisp/org-agenda.el | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 191ee52..7a10375 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -1336,6 +1336,11 @@ the headline/diary entry." (const :tag "Never" nil) (const :tag "When at beginning of entry" beg))) +(defcustom org-agenda-remove-timeranges-from-blocks nil + "Non-nil means remove time ranges specifications in agenda +items that span on several days." + :group 'org-agenda-line-format + :type 'boolean) (defcustom org-agenda-default-appointment-duration nil "Default duration for appointments that only have a starting time. @@ -4790,13 +4795,20 @@ FRACTION is what fraction of the head-warning time has passed." (setq tags (org-get-tags-at)) (looking-at "\\*+[ \t]+\\([^\r\n]+\\)") (setq head (match-string 1)) + (setq remove-re + (if org-agenda-remove-timeranges-from-blocks + (concat + "<" (regexp-quote s1) ".*?>" + "--" + "<" (regexp-quote s2) ".*?>") + nil)) (setq txt (org-format-agenda-item (format (nth (if (= d1 d2) 0 1) org-agenda-timerange-leaders) (1+ (- d0 d1)) (1+ (- d2 d1))) head category tags - timestr))) + timestr nil remove-re))) (org-add-props txt props 'org-marker marker 'org-hd-marker hdmarker 'type "block" 'date date -- 1.7.1