emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* skip scheduled if deadline *on other days*
@ 2015-08-26 21:12 Ken Mankoff
  2015-08-30 12:26 ` Show timestamps but not SCHEDULED Ken Mankoff
  0 siblings, 1 reply; 7+ messages in thread
From: Ken Mankoff @ 2015-08-26 21:12 UTC (permalink / raw)
  To: Org Mode


I'd like to not show SCHEDULED items in an agenda view if those same items have DEADLINES. 

I know of =org-agenda-skip-scheduled-if-deadline-is-shown=, but that seems to only work for items on the same day, and only if the DEADLINE is shown. Even if the DEADLINE isn't shown (farther in the future than the current agenda view), items should be skipped if DEADLINE exists. 

My current agenda is:

  (setq org-agenda-custom-commands
        '(
          ("c" "My Custom Agenda"
           (
            (agenda "" (
                       (org-agenda-overriding-header "Events")
                       (org-agenda-show-all-dates nil)
                       (org-agenda-ndays 10)
                       (org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo '("EVENT")))
		       ))
              ))))

Can someone advise how to modify this to get the behavior described above?

Thanks,

  -k.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Show timestamps but not SCHEDULED
  2015-08-26 21:12 skip scheduled if deadline *on other days* Ken Mankoff
@ 2015-08-30 12:26 ` Ken Mankoff
  2015-08-30 15:34   ` Ken Mankoff
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ken Mankoff @ 2015-08-30 12:26 UTC (permalink / raw)
  To: Org Mode

Hi List,

I have a class of TODO items (I call them EVENTS). These all have timestamps. Sometimes they have SCHEDULED or DEADLINE timestamps too.

I'd like a custom agenda view that shows these EVENTS based on their timestamp, but not the SCHEDULED or DEADLINE timestamps. Is this possible?

Example item:

* EVENT Foo
  SCHEDULED: <2015-09-03>
  <2015-09-04>


My current setup is:

(setq org-agenda-custom-commands
  '(
    ("e" "Event List"
      (
        (agenda "" (
    (org-agenda-overriding-header "Events")
    (org-agenda-show-all-dates t)
    (org-agenda-ndays 30)
    (org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo '("EVENT") 'done))
  ;;(org-agenda-skip-function '(org-agenda-skip-entry-if 'scheduled 'nottodo '("EVENT") 'done))
))))))

As it is, I see SCHEDULED. If I swap the comment on the last two lines, then I don't see SCHEDULED, but I don't see the event at all either, which is more problematic.

I think the solution here might be to add a function to org-agenda-finalize-hook that removes lines with SCHEDULED or DEADLINE? Does this sound like the correct approach to the better Org hackers on this list?

I am basing this approach on the code that removes empty sections of the Agenda:
https://lists.gnu.org/archive/html/emacs-orgmode/2015-06/msg00266.html

Thanks,

  -k.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show timestamps but not SCHEDULED
  2015-08-30 12:26 ` Show timestamps but not SCHEDULED Ken Mankoff
@ 2015-08-30 15:34   ` Ken Mankoff
  2015-08-30 20:09   ` Ken Mankoff
  2015-09-10 16:33   ` Michael Brand
  2 siblings, 0 replies; 7+ messages in thread
From: Ken Mankoff @ 2015-08-30 15:34 UTC (permalink / raw)
  To: Org Mode

Hi,

On 2015-08-30 at 08:26, Ken Mankoff <mankoff@gmail.com> wrote:
> I'd like a custom agenda view that shows EVENTS based on their
> timestamp, but not the SCHEDULED or DEADLINE timestamps. Is this
> possible?
>
> Example item:
>
> * EVENT Foo
>   SCHEDULED: <2015-09-03>
>   <2015-09-04>

I think I've found three possible solutions to this, but none appear to work, probably due to implementation issues.

1) =org-agenda-entry-text-exclude-regexps= should remove lines matching a regex. I tried using it like this:

(setq org-agenda-custom-commands
  '(
    ("e" "Event List"
      (
        (agenda "" (
    (org-agenda-overriding-header "Events")
    (org-agenda-show-all-dates t)
    (org-agenda-ndays 30)
    (org-agenda-skip-function '(org-agenda-skip-entry-if 'nottodo '("EVENT") 'done))
    (org-agenda-entry-text-exclude-regexps '("Scheduled:"))
))))))


2) =org-agenda-entry-text-cleanup-hook= OR =org-agenda-text-cleanup-hook=. I've tried using them like this:

(defun kdm/org-agenda-event-no-schedule ()
  (delete-matching-lines "Scheduled:" (beginning-of-buffer) (end-of-buffer)))
(add-hook 'org-agenda-entry-text-cleanup-hook 'kdm/org-agenda-event-no-schedule)
(add-hook 'org-agenda-text-cleanup-hook 'kdm/org-agenda-event-no-schedule)

But again, I don't see any effects from this.

Can someone explain what I'm doing wrong with these three approaches, or if there is some other way to filter lines or remove SCHEDULED items (but not timestamped items) from an Agenda view?

Thanks,

  -k.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show timestamps but not SCHEDULED
  2015-08-30 12:26 ` Show timestamps but not SCHEDULED Ken Mankoff
  2015-08-30 15:34   ` Ken Mankoff
@ 2015-08-30 20:09   ` Ken Mankoff
  2015-09-10 16:33   ` Michael Brand
  2 siblings, 0 replies; 7+ messages in thread
From: Ken Mankoff @ 2015-08-30 20:09 UTC (permalink / raw)
  To: Org Mode

On 2015-08-30 at 08:26, Ken Mankoff <mankoff@gmail.com> wrote:
> I'd like a custom agenda view that shows EVENTS based on their
> timestamp, but not the SCHEDULED or DEADLINE timestamps. Is this
> possible?
>
> Example item:
>
> * EVENT Foo
>   SCHEDULED: <2015-09-03>
>   <2015-09-04>

A solution. Not very generic, but works for me and may help others:

(defun kdm/org-agenda-event-no-schedule ()
  "Remove SHEDULED lines from Event Agenda."
  (delete-matching-lines "Scheduled:" (re-search-forward "^Events$") (re-search-forward "^$")))
(add-hook 'org-agenda-finalize-hook #'kdm/org-agenda-event-no-schedule)

  -k.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show timestamps but not SCHEDULED
  2015-08-30 12:26 ` Show timestamps but not SCHEDULED Ken Mankoff
  2015-08-30 15:34   ` Ken Mankoff
  2015-08-30 20:09   ` Ken Mankoff
@ 2015-09-10 16:33   ` Michael Brand
  2015-09-10 16:51     ` Ken Mankoff
  2 siblings, 1 reply; 7+ messages in thread
From: Michael Brand @ 2015-09-10 16:33 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: Org Mode

Hi Ken

On Sun, Aug 30, 2015 at 2:26 PM, Ken Mankoff <mankoff@gmail.com> wrote:

> I'd like a custom agenda view that shows these EVENTS based on their
> timestamp, but not the SCHEDULED or DEADLINE timestamps. Is this
> possible?

There is a custom agenda variable for this, see "C-h v
org-agenda-entry-types".

Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show timestamps but not SCHEDULED
  2015-09-10 16:33   ` Michael Brand
@ 2015-09-10 16:51     ` Ken Mankoff
  2015-09-10 17:06       ` Michael Brand
  0 siblings, 1 reply; 7+ messages in thread
From: Ken Mankoff @ 2015-09-10 16:51 UTC (permalink / raw)
  To: Michael Brand; +Cc: Org Mode


On 2015-09-10 at 12:33, Michael Brand <michael.ch.brand@gmail.com> wrote:
> On Sun, Aug 30, 2015 at 2:26 PM, Ken Mankoff <mankoff@gmail.com> wrote:
>
>> I'd like a custom agenda view that shows these EVENTS based on their
>> timestamp, but not the SCHEDULED or DEADLINE timestamps. Is this
>> possible?
>
> There is a custom agenda variable for this, see "C-h v
> org-agenda-entry-types".

This variable will exclude entire entries if they have a SCHEDULED line. I am looking to see those entries, but only at the date time in <here>, not the date time SCHELUDE:<here>.

  -k.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Show timestamps but not SCHEDULED
  2015-09-10 16:51     ` Ken Mankoff
@ 2015-09-10 17:06       ` Michael Brand
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Brand @ 2015-09-10 17:06 UTC (permalink / raw)
  To: Ken Mankoff; +Cc: Org Mode

Hi Ken

On Thu, Sep 10, 2015 at 6:51 PM, Ken Mankoff <mankoff@gmail.com> wrote:
> This variable will exclude entire entries if they have a SCHEDULED
> line. I am looking to see those entries, but only at the date time
> in <here>, not the date time SCHELUDE:<here>.

I see, I missed your real requirement in the first place.

Probably not what you want, but one way could be to use
org-agenda-entry-types in combination with separation of the tasks:

* EVENT Foo
** EVENT Foo - prepare
   SCHEDULED: <2015-09-03>
** EVENT Foo - meeting
   <2015-09-04>

Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-10 17:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-26 21:12 skip scheduled if deadline *on other days* Ken Mankoff
2015-08-30 12:26 ` Show timestamps but not SCHEDULED Ken Mankoff
2015-08-30 15:34   ` Ken Mankoff
2015-08-30 20:09   ` Ken Mankoff
2015-09-10 16:33   ` Michael Brand
2015-09-10 16:51     ` Ken Mankoff
2015-09-10 17:06       ` Michael Brand

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).