From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: missing todo's in agenda after emacs/org upgrade Date: Fri, 19 Aug 2011 15:12:26 +0200 Message-ID: <1036961E-31E7-42C0-B5B9-1A7D5DD9BDEB@gmail.com> References: <06FD744B-8465-49C4-9A4A-45E2B4DCBF2B@agfa.com> <80y5yqpgin.fsf@somewhere.org> <3247E27F-C23D-4B93-9040-C64C8B7546F1@agfa.com> <87r54hk0q1.fsf@gnu.org> Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/mixed; boundary=Apple-Mail-1-444897577 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47550) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuOsB-0005jF-61 for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 09:12:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QuOsA-0006vu-0E for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 09:12:31 -0400 Received: from mail-ey0-f171.google.com ([209.85.215.171]:35799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuOs9-0006vl-Ov for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 09:12:29 -0400 Received: by eyg24 with SMTP id 24so2681981eyg.30 for ; Fri, 19 Aug 2011 06:12:28 -0700 (PDT) In-Reply-To: <87r54hk0q1.fsf@gnu.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: Sebastien Vauban , emacs-orgmode@gnu.org --Apple-Mail-1-444897577 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Aug 19, 2011, at 3:08 PM, Bastien wrote: > Hi Carsten, > > Carsten Dominik writes: > >> OK, I am attaching a patch proposal which will clean this up a bit. > > Thanks for tackling these issues -- I can't read the patch thourh, > as it is just two lines long, can you resent it? Strange. Here it is again: --Apple-Mail-1-444897577 Content-Disposition: attachment; filename=agenda-include-all.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="agenda-include-all.patch" Content-Transfer-Encoding: 7bit Changes at master Modified lisp/org-agenda.el diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index c2b111a..29a2377 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -351,7 +351,8 @@ This will be spliced into the custom type of `org-agenda-custom-commands'.") -(defcustom org-agenda-custom-commands nil +(defcustom org-agenda-custom-commands '(("n" "Agenda and all TODO's" + ((agenda "") (alltodo)))) "Custom commands for the agenda. These commands will be offered on the splash screen displayed by the agenda dispatcher \\[org-agenda]. Each entry is a list like this: @@ -1081,14 +1082,6 @@ Custom commands can set this variable in the options section." :group 'org-agenda-daily/weekly :type 'boolean) -(defcustom org-agenda-include-all-todo nil - "Set means weekly/daily agenda will always contain all TODO entries. -The TODO entries will be listed at the top of the agenda, before -the entries for specific days. -This option is deprecated, it is better to define a block agenda instead." - :group 'org-agenda-daily/weekly - :type 'boolean) - (defcustom org-agenda-repeating-timestamp-show-all t "Non-nil means show all occurrences of a repeating stamp in the agenda. When set to a list of strings, only show occurrences of repeating @@ -3351,7 +3344,7 @@ no longer in use." (defvar org-agenda-only-exact-dates nil) ; dynamically scoped -(defun org-timeline (&optional include-all) +(defun org-timeline (&optional dotodo) "Show a time-sorted view of the entries in the current org file. Only entries with a time stamp of today or later will be listed. With \\[universal-argument] prefix, all unfinished TODO items will also be shown, @@ -3362,7 +3355,6 @@ dates." (org-compile-prefix-format 'timeline) (org-set-sorting-strategy 'timeline) (let* ((dopast t) - (dotodo include-all) (doclosed org-agenda-show-log) (entry (buffer-file-name (or (buffer-base-buffer (current-buffer)) (current-buffer)))) @@ -3381,7 +3373,7 @@ dates." (setq org-agenda-redo-command (list 'progn (list 'org-switch-to-buffer-other-window (current-buffer)) - (list 'org-timeline (list 'quote include-all)))) + (list 'org-timeline (list 'quote dotodo)))) (if (not dopast) ;; Remove past dates from the list of dates. (setq day-numbers (delq nil (mapcar (lambda(x) @@ -3489,7 +3481,7 @@ Custom commands can set this variable in the options section.") (defvar org-starting-day 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 agenda buffer -(defvar org-include-all-loc nil) ; local variable +(defvar org-arg-loc nil) ; local variable (defvar org-agenda-entry-types '(:deadline :scheduled :timestamp :sexp) "List of types searched for when creating the daily/weekly agenda. @@ -3525,29 +3517,29 @@ somewhat less efficient) way of determining what is included in the daily/weekly agenda, see `org-agenda-skip-function'.") ;;;###autoload -(defun org-agenda-list (&optional include-all start-day span) +(defun org-agenda-list (&optional arg start-day span) "Produce a daily/weekly view from all files in variable `org-agenda-files'. 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. With a numeric prefix argument in an interactive call, the agenda will -span INCLUDE-ALL days. Lisp programs should instead specify SPAN to change +span ARG days. Lisp programs should instead specify SPAN to change the number of days. SPAN defaults to `org-agenda-span'. 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)) - (setq span include-all include-all nil)) + (if (and (integerp arg) (> arg 0)) + (setq span arg arg nil)) (setq start-day (or start-day org-agenda-start-day)) (if org-agenda-overriding-arguments - (setq include-all (car org-agenda-overriding-arguments) + (setq arg (car org-agenda-overriding-arguments) start-day (nth 1 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)))) - (setq org-agenda-last-arguments (list include-all start-day span)) + (setq org-agenda-last-arguments (list arg start-day span)) (org-compile-prefix-format 'agenda) (org-set-sorting-strategy 'agenda) (let* ((span (org-agenda-ndays-to-span @@ -3574,7 +3566,7 @@ given in `org-agenda-start-on-weekday'." s e rtn rtnall file date d start-pos end-pos todayp clocktable-start clocktable-end filter) (setq org-agenda-redo-command - (list 'org-agenda-list (list 'quote include-all) start-day (list 'quote span))) + (list 'org-agenda-list (list 'quote arg) start-day (list 'quote span))) (dotimes (n (1- ndays)) (push (1+ (car day-numbers)) day-numbers)) (setq day-numbers (nreverse day-numbers)) @@ -3582,7 +3574,7 @@ given in `org-agenda-start-on-weekday'." 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) + (org-set-local 'org-arg-loc arg) (org-set-local 'org-agenda-current-span (org-agenda-ndays-to-span span)) (unless org-agenda-compact-blocks (let* ((d1 (car day-numbers)) --Apple-Mail-1-444897577 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > >> It does: >> >> - Clean up the variable name include-all, which is confusing >> for readers of the code >> - Make `org-agenda-custom-commands' have a default value, >> which is a block that does put agenda and TODO list into >> one view. Note that I have changed the sequence from Peter's >> proposal, I am putting the agenda first - this makes more sense, >> I think, and also reduces the likelihood that the cursor will be >> in the TODO list when you are trying to move through time. >> - I have *not* changes the problem that trying to change time views >> in the TODO block will not work - this would have required >> more coding and would create undefined behavior in some block >> agendas. >> >> HTH, please give me feed back. Bastien, let me know if/when >> I should push this change. > > I'll test it this afternoon. > > Best, > > -- > Bastien - Carsten --Apple-Mail-1-444897577--