From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Danjou Subject: Re: [PATCH] org-agenda: rework ndays and span handling Date: Fri, 03 Dec 2010 10:30:23 +0100 Message-ID: References: <1291027797-22612-1-git-send-email-julien@danjou.info> <870C3B1D-3360-4B23-BCEA-DA88715FEF25@gmail.com> <87fwuhwt1p.fsf@pinto.chemeng.ucl.ac.uk> <87mxopiqqi.fsf@keller.adm.naquadah.org> <87fwufhah5.fsf@gollum.intra.norang.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0928768205==" Return-path: Received: from [140.186.70.92] (port=37624 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PORyK-0006Oz-RS for emacs-orgmode@gnu.org; Fri, 03 Dec 2010 04:30:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PORyI-0007Pw-3B for emacs-orgmode@gnu.org; Fri, 03 Dec 2010 04:30:32 -0500 Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]:35806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PORyG-0007PG-4C for emacs-orgmode@gnu.org; Fri, 03 Dec 2010 04:30:30 -0500 In-Reply-To: <87fwufhah5.fsf@gollum.intra.norang.ca> (Bernt Hansen's message of "Thu, 02 Dec 2010 21:11:02 -0500") 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: Bernt Hansen Cc: Eric S Fraga , emacs-orgmode@gnu.org, Carsten Dominik --===============0928768205== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain On Fri, Dec 03 2010, Bernt Hansen wrote: > I tried your patch out tonight and I'm confused about org-agenda-ndays. > This is stated as obsolete (since 24.1 ? what's that?) An Emacs version. make-obsolete-variable requires a version number to be set, and that's usually the Emacs version number. The next Emacs release including this code will be 24.1, therefore I've set this to 24.1, which is the Good Practice AFAIK. > but the default > for org-agenda-span doesn't seem to be set based on the existing value > of org-agenda-ndays. Is that on purpose? Yes, but org-agenda-ndays is used instead of org-agenda-span if org-agenda-ndays has been set. > I'm fine with customizing org-agenda-span as long as it's documented > that this needs to be done for the next version of org-mode that > includes your patch. I've updated the texi file accordingly (s/ndays/span/). > I also noticed the display on the modeline says 'Day', 'Week', 'Month', > or 'Year' when displaying the agenda with 'd', 'w', 'v m', and 'v y' > which is great. However this data is lost and replaced with '1 days' if > moving forwards or backwards in the agenda with 'f' and 'b' or jumping > to a date with 'j'. Yep, that's a bug. I've fixed it, new version attached. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-agenda-rework-ndays-and-span-handling.patch Content-Transfer-Encoding: quoted-printable From=208c3bd1ca371bdb39ab1b64f323154a8135335da8 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 26 Nov 2010 14:22:17 +0100 Subject: [PATCH] org-agenda: rework ndays and span handling * org-agenda.el (org-agenda-custom-commands-local-options): Allow org-agenda-span to be a symbol. (org-agenda-ndays): Make obsolete. (org-agenda-span): New variable superseding org-agenda-ndays. (org-agenda-menu): Use org-agenda-current-span. (org-agenda-current-span): New local variable storing current span. (org-agenda-list): Take a span instead of ndays as argument. This function is now responsible for computing the ndays based on span. (org-agenda-ndays-to-span): Return span only if number of days really matches. (org-agenda-span-to-ndays): New function. (org-agenda-manipulate-query): Use org-agenda-compute-starting-span. (org-agenda-goto-today): Use org-agenda-compute-starting-span. (org-agenda-later): Do not give compute a new span, use the current one. (org-agenda-day-view, org-agenda-week-view) (org-agenda-month-view, org-agenda-year-view): Stop touching org-agenda-ndays. (org-agenda-change-time-span): Only compute starting-span. (org-agenda-compute-starting-span): New function derived from the old org-agenda-compute-time-span. (org-agenda-set-mode-name): Compute mode based on org-agenda-current-span. (org-agenda-span-name): New function. * org-mouse.el: Replace Replace org-agenda-ndays by org-agenda-current-span. * org.texi, orgguide.texi: Replace org-agenda-ndays by org-agenda-span. Signed-off-by: Julien Danjou =2D-- doc/org.texi | 14 ++-- doc/orgguide.texi | 6 +- lisp/org-agenda.el | 243 +++++++++++++++++++++++++++++-------------------= ---- lisp/org-mouse.el | 4 +- 4 files changed, 146 insertions(+), 121 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index e2e9af5..b5b70c9 100644 =2D-- a/doc/org.texi +++ b/doc/org.texi @@ -6966,14 +6966,14 @@ paper agenda, showing all the tasks for the current= week or day. @table @kbd @cindex org-agenda, command @orgcmd{C-c a a,org-agenda-list} =2D@vindex org-agenda-ndays +@vindex org-agenda-span Compile an agenda for the current week from a list of Org files. The agen= da shows the entries for each day. With a numeric prefix@footnote{For backwa= rd compatibility, the universal prefix @kbd{C-u} causes all TODO entries to be listed before the agenda. This feature is deprecated, use the dedicated T= ODO list, or a block agenda instead (@pxref{Block agenda}).} (like @kbd{C-u 2= 1 C-c a a}) you may set the number of days to be displayed (see also the =2Dvariable @code{org-agenda-ndays}) +variable @code{org-agenda-span}) @end table =20 Remote editing from the agenda buffer means, for example, that you can @@ -7621,10 +7621,10 @@ argument as well. For example, @kbd{200712 w} will= jump to week 12 in be mapped to the interval 1938-2037. @c @orgcmd{f,org-agenda-later} =2D@vindex org-agenda-ndays =2DGo forward in time to display the following @code{org-agenda-ndays} days. +@vindex org-agenda-span +Go forward in time to display the following @code{org-agenda-current-span}= days. For example, if the display covers a week, switch to the following week. =2DWith prefix arg, go forward that many times @code{org-agenda-ndays} days. +With prefix arg, go forward that many times @code{org-agenda-current-span}= days. @c @orgcmd{b,org-agenda-earlier} Go backward in time to display earlier dates. @@ -8369,7 +8369,7 @@ or, if you need to modify some parameters@footnote{Qu= oting depends on the system you use, please check the FAQ for examples.} @example emacs -eval '(org-batch-store-agenda-views \ =2D org-agenda-ndays 30 \ + org-agenda-span month \ org-agenda-start-day "2007-11-01" \ org-agenda-include-diary nil \ org-agenda-files (quote ("~/org/project.org")))' \ @@ -14033,7 +14033,7 @@ You may also modify parameters on the fly like this: @example emacs -batch -l ~/.emacs \ -eval '(org-batch-agenda "a" \ =2D org-agenda-ndays 30 \ + org-agenda-span month \ org-agenda-include-diary nil \ org-agenda-files (quote ("~/org/project.org")))' \ | lpr diff --git a/doc/orgguide.texi b/doc/orgguide.texi index b67f7f1..690111b 100644 =2D-- a/doc/orgguide.texi +++ b/doc/orgguide.texi @@ -1931,9 +1931,9 @@ Delete other windows. Switch to day/week view.=20 @c @item f @r{and} b =2DGo forward/backward in time to display the following @code{org-agenda-nd= ays} =2Ddays. For example, if the display covers a week, switch to the =2Dfollowing/previous week. +Go forward/backward in time to display the following +@code{org-agenda-current-span} days. For example, if the display covers a +week, switch to the following/previous week. @c @item . Go to today. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index c339f60..a4d59a2 100644 =2D-- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -242,8 +242,12 @@ you can \"misuse\" it to also add other text to the he= ader. However, (const org-agenda-prefix-format :value " %-12:c%?-12t% s") (string)) (list :tag "Number of days in agenda" =2D (const org-agenda-ndays) =2D (integer :value 1)) + (const org-agenda-span) + (choice (const :tag "Day" 'day) + (const :tag "Week" 'week) + (const :tag "Month" 'month) + (const :tag "Year" 'year) + (integer :tag "Custom"))) (list :tag "Fixed starting date" (const org-agenda-start-day) (string :value "2007-11-01")) @@ -888,12 +892,25 @@ option will be ignored." :group 'org-agenda-windows :type 'boolean) =20 =2D(defcustom org-agenda-ndays 7 =2D "Number of days to include in overview display. +(defcustom org-agenda-ndays nil + "Number of days to include in overview display. Should be 1 or 7. +Obsolete, see `org-agenda-span'." + :group 'org-agenda-daily/weekly + :type 'integer) + +(make-obsolete-variable 'org-agenda-ndays 'org-agenda-span "24.1") + +(defcustom org-agenda-span 'week + "Number of days to include in overview display. +Can be day, week, month, year, or any number of days. Custom commands can set this variable in the options section." :group 'org-agenda-daily/weekly =2D :type 'integer) + :type '(choice (const :tag "Day" 'day) + (const :tag "Week" 'week) + (const :tag "Month" 'month) + (const :tag "Year" 'year) + (integer :tag "Custom"))) =20 (defcustom org-agenda-start-on-weekday 1 "Non-nil means start the overview always on the specified weekday. @@ -1825,19 +1842,19 @@ The following commands are available: ("View" ["Day View" org-agenda-day-view :active (org-agenda-check-type nil 'agenda) =2D :style radio :selected (equal org-agenda-ndays 1) + :style radio :selected (eq org-agenda-current-span 'day) :keys "v d (or just d)"] ["Week View" org-agenda-week-view :active (org-agenda-check-type nil 'agenda) =2D :style radio :selected (equal org-agenda-ndays 7) + :style radio :selected (eq org-agenda-current-span 'week) :keys "v w (or just w)"] ["Month View" org-agenda-month-view :active (org-agenda-check-type nil 'agenda) =2D :style radio :selected (member org-agenda-ndays '(28 29 30 31)) + :style radio :selected (eq org-agenda-current-span 'month) :keys "v m"] ["Year View" org-agenda-year-view :active (org-agenda-check-type nil 'agenda) =2D :style radio :selected (member org-agenda-ndays '(365 366)) + :style radio :selected (eq org-agenda-current-span 'year) :keys "v y"] "--" ["Include Diary" org-agenda-toggle-diary @@ -3323,7 +3340,8 @@ When EMPTY is non-nil, also include days without any = entries." (defvar org-agenda-last-arguments nil "The arguments of the previous call to `org-agenda'.") (defvar org-starting-day nil) ; local variable in the agenda buffer =2D(defvar org-agenda-span nil) ; local variable in the agenda buffer +(defvar org-agenda-current-span nil + "The current span used in the agenda view.") ; local variable in the age= nda buffer (defvar org-include-all-loc nil) ; local variable =20 (defvar org-agenda-entry-types '(:deadline :scheduled :timestamp :sexp) @@ -3360,7 +3378,7 @@ somewhat less efficient) way of determining what is i= ncluded in the daily/weekly agenda, see `org-agenda-skip-function'.") =20 ;;;###autoload =2D(defun org-agenda-list (&optional include-all start-day ndays) +(defun org-agenda-list (&optional include-all start-day span) "Produce a daily/weekly view from all files in variable `org-agenda-file= s'. The view will be for the current day or week, but from the overview buffer you will be able to go to other days/weeks. @@ -3371,35 +3389,36 @@ This feature is considered obsolete, please use the= TODO list or a block agenda instead. =20 With a numeric prefix argument in an interactive call, the agenda will =2Dspan INCLUDE-ALL days. Lisp programs should instead specify NDAYS to ch= ange =2Dthe number of days. NDAYS defaults to `org-agenda-ndays'. +span INCLUDE-ALL days. Lisp programs should instead specify SPAN to change +the number of days. SPAN defaults to `org-agenda-span'. =20 START-DAY defaults to TODAY, or to the most recent match for the weekday given in `org-agenda-start-on-weekday'." (interactive "P") (if (and (integerp include-all) (> include-all 0)) =2D (setq ndays include-all include-all nil)) =2D (setq ndays (or ndays org-agenda-ndays) =2D start-day (or start-day org-agenda-start-day)) + (setq span include-all include-all nil)) + (setq start-day (or start-day org-agenda-start-day)) (if org-agenda-overriding-arguments (setq include-all (car org-agenda-overriding-arguments) start-day (nth 1 org-agenda-overriding-arguments) =2D ndays (nth 2 org-agenda-overriding-arguments))) + span (nth 2 org-agenda-overriding-arguments))) (if (stringp start-day) ;; Convert to an absolute day number (setq start-day (time-to-days (org-read-date nil t start-day)))) =2D (setq org-agenda-last-arguments (list include-all start-day ndays)) + (setq org-agenda-last-arguments (list include-all start-day span)) (org-compile-prefix-format 'agenda) (org-set-sorting-strategy 'agenda) =2D (let* ((org-agenda-start-on-weekday =2D (if (or (equal ndays 7) (and (null ndays) (equal 7 org-agenda-ndays))) =2D org-agenda-start-on-weekday nil)) =2D (thefiles (org-agenda-files nil 'ifmode)) =2D (files thefiles) + (let* ((span (org-agenda-ndays-to-span (or span org-agenda-ndays org-age= nda-span))) (today (org-agenda-today)) (sd (or start-day today)) + (ndays (org-agenda-span-to-ndays span sd)) + (org-agenda-start-on-weekday + (if (eq ndays 7) + org-agenda-start-on-weekday)) + (thefiles (org-agenda-files nil 'ifmode)) + (files thefiles) (start (if (or (null org-agenda-start-on-weekday) =2D (< org-agenda-ndays 7)) + (< ndays 7)) sd (let* ((nt (calendar-day-of-week (calendar-gregorian-from-absolute sd))) @@ -3409,24 +3428,19 @@ given in `org-agenda-start-on-weekday'." (day-numbers (list start)) (day-cnt 0) (inhibit-redisplay (not debug-on-error)) =2D s e rtn rtnall file date d start-pos end-pos todayp nd + s e rtn rtnall file date d start-pos end-pos todayp clocktable-start clocktable-end filter) (setq org-agenda-redo-command =2D (list 'org-agenda-list (list 'quote include-all) start-day ndays)) =2D ;; Make the list of days =2D (setq ndays (or ndays org-agenda-ndays) =2D nd ndays) =2D (while (> ndays 1) =2D (push (1+ (car day-numbers)) day-numbers) =2D (setq ndays (1- ndays))) + (list 'org-agenda-list (list 'quote include-all) start-day (list 'quote= span))) + (dotimes (n (1- ndays)) + (push (1+ (car day-numbers)) day-numbers)) (setq day-numbers (nreverse day-numbers)) (setq clocktable-start (car day-numbers) clocktable-end (1+ (or (org-last day-numbers) 0))) (org-prepare-agenda "Day/Week") (org-set-local 'org-starting-day (car day-numbers)) (org-set-local 'org-include-all-loc include-all) =2D (org-set-local 'org-agenda-span =2D (org-agenda-ndays-to-span nd)) + (org-set-local 'org-agenda-current-span (org-agenda-ndays-to-span span= )) (when (and (or include-all org-agenda-include-all-todo) (member today day-numbers)) (setq files thefiles @@ -3454,7 +3468,7 @@ given in `org-agenda-start-on-weekday'." (if org-agenda-overriding-header (insert (org-add-props (copy-sequence org-agenda-overriding-header) nil 'face 'org-agenda-structure) "\n") =2D (insert (capitalize (symbol-name (org-agenda-ndays-to-span nd))) + (insert (org-agenda-span-name span) "-agenda" (if (< (- d2 d1) 350) (if (=3D w1 w2) @@ -3519,7 +3533,7 @@ given in `org-agenda-start-on-weekday'." (if rtnall (insert (org-finalize-agenda-entries (org-agenda-add-time-grid-maybe =2D rtnall nd todayp)) + rtnall ndays todayp)) "\n")) (put-text-property s (1- (point)) 'day d) (put-text-property s (1- (point)) 'org-day-cnt day-cnt)))) @@ -3560,7 +3574,31 @@ given in `org-agenda-start-on-weekday'." (message ""))) =20 (defun org-agenda-ndays-to-span (n) =2D (cond ((< n 7) 'day) ((=3D n 7) 'week) ((< n 32) 'month) (t 'year))) + "Return a span symbol for a span of N days, or N if none matches." + (cond ((symbolp n) n) + ((=3D n 1) 'day) + ((=3D n 7) 'week) + (t n))) + +(defun org-agenda-span-to-ndays (span start-day) + "Return ndays from SPAN starting at START-DAY." + (cond ((numberp span) span) + ((eq span 'day) 1) + ((eq span 'week) 7) + ((eq span 'month) + (let ((date (calendar-gregorian-from-absolute start-day))) + (calendar-last-day-of-month (car date) (caddr date)))) + ((eq span 'year) + (let ((date (calendar-gregorian-from-absolute start-day))) + (if (calendar-leap-year-p (caddr date)) 366 365))))) + +(defun org-agenda-span-name (span) + "Return a SPAN name." + (if (null span) + "" + (if (symbolp span) + (capitalize (symbol-name span)) + (format "%d days" span)))) =20 ;;; Agenda word search =20 @@ -6000,11 +6038,9 @@ Negative selection means regexp must not match for s= election of an entry." (cond (tdpos (goto-char tdpos)) ((eq org-agenda-type 'agenda) =2D (let* ((sd (org-agenda-today)) =2D (comp (org-agenda-compute-time-span sd org-agenda-span)) + (let* ((sd (org-agenda-compute-starting-span (org-agenda-today) (or = org-agenda-ndays org-agenda-span))) (org-agenda-overriding-arguments org-agenda-last-arguments)) =2D (setf (nth 1 org-agenda-overriding-arguments) (car comp)) =2D (setf (nth 2 org-agenda-overriding-arguments) (cdr comp)) + (setf (nth 1 org-agenda-overriding-arguments) sd) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda))) (t (error "Cannot find today"))))) @@ -6021,28 +6057,28 @@ Negative selection means regexp must not match for = selection of an entry." With prefix ARG, go forward that many times the current span." (interactive "p") (org-agenda-check-type t 'agenda) =2D (let* ((span org-agenda-span) + (let* ((span org-agenda-current-span) (sd org-starting-day) (greg (calendar-gregorian-from-absolute sd)) (cnt (org-get-at-bol 'org-day-cnt)) =2D greg2 nd) + greg2) (cond ((eq span 'day) =2D (setq sd (+ arg sd) nd 1)) + (setq sd (+ arg sd))) ((eq span 'week) =2D (setq sd (+ (* 7 arg) sd) nd 7)) + (setq sd (+ (* 7 arg) sd))) ((eq span 'month) (setq greg2 (list (+ (car greg) arg) (nth 1 greg) (nth 2 greg)) sd (calendar-absolute-from-gregorian greg2)) =2D (setcar greg2 (1+ (car greg2))) =2D (setq nd (- (calendar-absolute-from-gregorian greg2) sd))) + (setcar greg2 (1+ (car greg2)))) ((eq span 'year) (setq greg2 (list (car greg) (nth 1 greg) (+ arg (nth 2 greg))) sd (calendar-absolute-from-gregorian greg2)) =2D (setcar (nthcdr 2 greg2) (1+ (nth 2 greg2))) =2D (setq nd (- (calendar-absolute-from-gregorian greg2) sd)))) + (setcar (nthcdr 2 greg2) (1+ (nth 2 greg2)))) + (t + (setq sd (+ (* span arg) sd)))) (let ((org-agenda-overriding-arguments =2D (list (car org-agenda-last-arguments) sd nd t))) + (list (car org-agenda-last-arguments) sd span t))) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda cnt)))) =20 @@ -6085,7 +6121,6 @@ With prefix ARG, go backward that many times the curr= ent span." "Switch to daily view for agenda. With argument DAY-OF-YEAR, switch to that day of the year." (interactive "P") =2D (setq org-agenda-ndays 1) (org-agenda-change-time-span 'day day-of-year)) (defun org-agenda-week-view (&optional iso-week) "Switch to daily view for agenda. @@ -6095,7 +6130,6 @@ week. Any digits before this encode a year. So 2007= 12 means week 12 of year 2007. Years in the range 1938-2037 can also be written as 2-digit years." (interactive "P") =2D (setq org-agenda-ndays 7) (org-agenda-change-time-span 'week iso-week)) (defun org-agenda-month-view (&optional month) "Switch to monthly view for agenda. @@ -6120,70 +6154,61 @@ written as 2-digit years." "Change the agenda view to SPAN. SPAN may be `day', `week', `month', `year'." (org-agenda-check-type t 'agenda) =2D (if (and (not n) (equal org-agenda-span span)) + (if (and (not n) (equal org-agenda-current-span span)) (error "Viewing span is already \"%s\"" span)) (let* ((sd (or (org-get-at-bol 'day) org-starting-day)) =2D (computed (org-agenda-compute-time-span sd span n)) + (sd (org-agenda-compute-starting-span sd span n)) (org-agenda-overriding-arguments =2D (list (car org-agenda-last-arguments) =2D (car computed) (cdr computed) t))) + (list (car org-agenda-last-arguments) sd span t))) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda)) (org-agenda-set-mode-name) (message "Switched to %s view" span)) =20 =2D(defun org-agenda-compute-time-span (sd span &optional n) =2D "Compute starting date and number of days for agenda. +(defun org-agenda-compute-starting-span (sd span &optional n) + "Compute starting date for agenda. SPAN may be `day', `week', `month', `year'. The return value is a cons cell with the starting date and the number of days, so that the date SD will be in that range." (let* ((greg (calendar-gregorian-from-absolute sd)) (dg (nth 1 greg)) (mg (car greg)) =2D (yg (nth 2 greg)) =2D nd w1 y1 m1 thisweek) + (yg (nth 2 greg))) (cond ((eq span 'day) (when n (setq sd (+ (calendar-absolute-from-gregorian (list mg 1 yg)) =2D n -1))) =2D (setq nd 1)) + n -1)))) ((eq span 'week) (let* ((nt (calendar-day-of-week (calendar-gregorian-from-absolute sd))) (d (if org-agenda-start-on-weekday (- nt org-agenda-start-on-weekday) =2D 0))) + 0)) + y1) (setq sd (- sd (+ (if (< d 0) 7 0) d))) (when n (require 'cal-iso) =2D (setq thisweek (car (calendar-iso-from-absolute sd))) (when (> n 99) (setq y1 (org-small-year-to-year (/ n 100)) n (mod n 100))) (setq sd (calendar-absolute-from-iso (list n 1 =2D (or y1 (nth 2 (calendar-iso-from-absolute sd))))))) =2D (setq nd 7))) + (or y1 (nth 2 (calendar-iso-from-absolute sd))))))))) ((eq span 'month) =2D (when (and n (> n 99)) =2D (setq y1 (org-small-year-to-year (/ n 100)) =2D n (mod n 100))) =2D (setq sd (calendar-absolute-from-gregorian =2D (list (or n mg) 1 (or y1 yg))) =2D nd (- (calendar-absolute-from-gregorian =2D (list (1+ (or n mg)) 1 (or y1 yg))) =2D sd))) + (let (y1) + (when (and n (> n 99)) + (setq y1 (org-small-year-to-year (/ n 100)) + n (mod n 100))) + (setq sd (calendar-absolute-from-gregorian + (list (or n mg) 1 (or y1 yg)))))) ((eq span 'year) (setq sd (calendar-absolute-from-gregorian =2D (list 1 1 (or n yg))) =2D nd (- (calendar-absolute-from-gregorian =2D (list 1 1 (1+ (or n yg)))) =2D sd)))) =2D (cons sd nd))) + (list 1 1 (or n yg)))))) + sd)) =20 (defun org-agenda-next-date-line (&optional arg) "Jump to the next line indicating a date in agenda buffer." @@ -6336,36 +6361,36 @@ When called with a prefix argument, include all arc= hive files as well." (defun org-agenda-set-mode-name () "Set the mode name to indicate all the small mode settings." (setq mode-name =2D (concat "Org-Agenda" =2D (if (get 'org-agenda-files 'org-restrict) " []" "") =2D (if (equal org-agenda-ndays 1) " Day" "") =2D (if (equal org-agenda-ndays 7) " Week" "") =2D (if org-agenda-follow-mode " Follow" "") =2D (if org-agenda-entry-text-mode " ETxt" "") =2D (if org-agenda-include-diary " Diary" "") =2D (if org-agenda-include-deadlines " Ddl" "") =2D (if org-agenda-use-time-grid " Grid" "") =2D (if (and (boundp 'org-habit-show-habits) =2D org-habit-show-habits) " Habit" "") =2D (if (consp org-agenda-show-log) " LogAll" =2D (if org-agenda-show-log " Log" "")) =2D (if (or org-agenda-filter (get 'org-agenda-filter =2D :preset-filter)) =2D (concat " {" (mapconcat =2D 'identity =2D (append (get 'org-agenda-filter =2D :preset-filter) =2D org-agenda-filter) "") "}") =2D "") =2D (if org-agenda-archives-mode =2D (if (eq org-agenda-archives-mode t) =2D " Archives" =2D (format " :%s:" org-archive-tag)) =2D "") =2D (if org-agenda-clockreport-mode =2D (if (eq org-agenda-clockreport-mode 'with-filter) =2D " Clock{}" " Clock") =2D ""))) + (list "Org-Agenda" + (if (get 'org-agenda-files 'org-restrict) " []" "") + " " + '(:eval (org-agenda-span-name org-agenda-current-span)) + (if org-agenda-follow-mode " Follow" "") + (if org-agenda-entry-text-mode " ETxt" "") + (if org-agenda-include-diary " Diary" "") + (if org-agenda-include-deadlines " Ddl" "") + (if org-agenda-use-time-grid " Grid" "") + (if (and (boundp 'org-habit-show-habits) + org-habit-show-habits) " Habit" "") + (if (consp org-agenda-show-log) " LogAll" + (if org-agenda-show-log " Log" "")) + (if (or org-agenda-filter (get 'org-agenda-filter + :preset-filter)) + (concat " {" (mapconcat + 'identity + (append (get 'org-agenda-filter + :preset-filter) + org-agenda-filter) "") "}") + "") + (if org-agenda-archives-mode + (if (eq org-agenda-archives-mode t) + " Archives" + (format " :%s:" org-archive-tag)) + "") + (if org-agenda-clockreport-mode + (if (eq org-agenda-clockreport-mode 'with-filter) + " Clock{}" " Clock") + ""))) (force-mode-line-update)) =20 (defun org-agenda-post-command-hook () diff --git a/lisp/org-mouse.el b/lisp/org-mouse.el index e16c977..d18a12d 100644 =2D-- a/lisp/org-mouse.el +++ b/lisp/org-mouse.el @@ -1100,10 +1100,10 @@ This means, between the beginning of line and the p= oint." "--" ["Day View" org-agenda-day-view :active (org-agenda-check-type nil 'agenda) =2D :style radio :selected (equal org-agenda-ndays 1)] + :style radio :selected (eq org-agenda-current-span 'day)] ["Week View" org-agenda-week-view :active (org-agenda-check-type nil 'agenda) =2D :style radio :selected (equal org-agenda-ndays 7)] + :style radio :selected (eq org-agenda-current-span 'week)] "--" ["Show Logbook entries" org-agenda-log-mode :style toggle :selected org-agenda-show-log =2D-=20 1.7.2.3 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =2D-=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info --=-=-=-- --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkz4uK8ACgkQpGK1HsL+5c2D6ACguOJTfiAhJACP7OCFuN0o3lmj W84Anj2JH3DCWYV59ZTIQp16vzVwJNrV =jCgY -----END PGP SIGNATURE----- --==-=-=-- --===============0928768205== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0928768205==--