From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH 1/4] Rename org-agenda-today to org-today. Date: Tue, 30 Nov 2010 07:27:53 +0100 Message-ID: <003742C3-1C32-4B05-973E-B368F769E8DD@gmail.com> References: <1291040314-1884-1-git-send-email-julien@danjou.info> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=42428 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNfaH-0007wf-1s for emacs-orgmode@gnu.org; Wed, 01 Dec 2010 00:50:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNJgy-0004SD-Nq for emacs-orgmode@gnu.org; Tue, 30 Nov 2010 01:27:58 -0500 Received: from mail-ey0-f169.google.com ([209.85.215.169]:51196) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNJgy-0004S6-DG for emacs-orgmode@gnu.org; Tue, 30 Nov 2010 01:27:56 -0500 Received: by eydd26 with SMTP id d26so16121996eyd.0 for ; Mon, 29 Nov 2010 22:27:55 -0800 (PST) In-Reply-To: <1291040314-1884-1-git-send-email-julien@danjou.info> 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: Julien Danjou Cc: emacs-orgmode@gnu.org Hi Julien, the purpose of this change is .... to be able to use this also in org.el without having to load org-agenda.el? - Carsten On Nov 29, 2010, at 3:18 PM, Julien Danjou wrote: > Signed-off-by: Julien Danjou > --- > lisp/org-agenda.el | 18 ++++++------------ > lisp/org.el | 6 ++++++ > 2 files changed, 12 insertions(+), 12 deletions(-) > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index 48856c9..aee7ca7 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -3208,7 +3208,7 @@ dates." > org-timeline-show-empty-dates)) > (org-deadline-warning-days 0) > (org-agenda-only-exact-dates t) > - (today (org-agenda-today)) > + (today (org-today)) > (past t) > args > s e rtn d emptyp) > @@ -3285,7 +3285,7 @@ When EMPTY is non-nil, also include days > without any entries." > (if inactive org-ts-regexp-both org-ts-regexp))) > dates dates1 date day day1 day2 ts1 ts2) > (if force-today > - (setq dates (list (org-agenda-today)))) > + (setq dates (list (org-today)))) > (save-excursion > (goto-char beg) > (while (re-search-forward re end t) > @@ -3396,7 +3396,7 @@ given in `org-agenda-start-on-weekday'." > org-agenda-start-on-weekday nil)) > (thefiles (org-agenda-files nil 'ifmode)) > (files thefiles) > - (today (org-agenda-today)) > + (today (org-today)) > (sd (or start-day today)) > (start (if (or (null org-agenda-start-on-weekday) > (< org-agenda-ndays 7)) > @@ -3839,7 +3839,7 @@ for a keyword. A numeric prefix directly > selects the Nth keyword in > (org-set-sorting-strategy 'todo) > (org-prepare-agenda "TODO") > (if (and (stringp arg) (not (string-match "\\S-" arg))) (setq arg > nil)) > - (let* ((today (org-agenda-today)) > + (let* ((today (org-today)) > (date (calendar-gregorian-from-absolute today)) > (kwds org-todo-keywords-for-agenda) > (completion-ignore-case t) > @@ -7956,7 +7956,7 @@ belonging to the \"Work\" category." > (let* ((cnt 0) ; count added events > (org-agenda-new-buffers nil) > (org-deadline-warning-days 0) > - ;; Do not use `org-agenda-today' here because appt only takes > + ;; Do not use `org-today' here because appt only takes > ;; time and without date as argument, so it may pass wrong > ;; information otherwise > (today (org-date-to-gregorian > @@ -7999,15 +7999,9 @@ belonging to the \"Work\" category." > (message "No event to add") > (message "Added %d event%s for today" cnt (if (> cnt 1) "s" > ""))))) > > -(defun org-agenda-today () > - "Return today date, considering `org-extend-today-until'." > - (time-to-days > - (time-subtract (current-time) > - (list 0 (* 3600 org-extend-today-until) 0)))) > - > (defun org-agenda-todayp (date) > "Does DATE mean today, when considering `org-extend-today-until'?" > - (let ((today (org-agenda-today)) > + (let ((today (org-today)) > (date (if (and date (listp date)) (calendar-absolute-from-gregorian > date) > date))) > (eq date today))) > diff --git a/lisp/org.el b/lisp/org.el > index 873b294..6c4c433 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -4798,6 +4798,12 @@ The following commands are available: > (nthcdr 2 time)))) > (current-time))) > > +(defun org-today () > + "Return today date, considering `org-extend-today-until'." > + (time-to-days > + (time-subtract (current-time) > + (list 0 (* 3600 org-extend-today-until) 0)))) > + > ;;;; Font-Lock stuff, including the activators > > (defvar org-mouse-map (make-sparse-keymap)) > -- > 1.7.2.3 > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode