emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Making a variable persistent when refreshing the agenda
@ 2018-04-13 14:05 Luke
  2018-04-26 23:34 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Luke @ 2018-04-13 14:05 UTC (permalink / raw)
  To: emacs-orgmode

I like to be able to view a list of tasks that need to be done today, 
along with warnings of any upcoming deadlines within the next few days. 
The number of "deadline warning days" that I require varies from time to 
time, so I have one of my agenda commands set up like so:

("d" "Daily Action List"
  ((agenda
    ""
    ((org-agenda-overriding-header "== TO BE DONE TODAY ==")
	(org-agenda-span
	 (quote day))
	(org-agenda-skip-deadline-prewarning-if-scheduled t)
	(org-agenda-sorting-strategy
	 (quote
	  (habit-up time-up todo-state-up deadline-up timestamp-up priority-down)))
	(org-deadline-warning-days
	 (string-to-number
	  (read-string "Number of warning days [0]: " nil nil "0")))))))

This allows me to interactively specify the number of "deadline warning 
days" when creating the agenda. Sometimes I need to refresh the agenda 
(org-agenda-redo), but this means that I need to re-enter the "Number of 
warning days" each time the agenda refreshes.

What I would like to do is somehow store the value within the agenda, 
and use the stored value when refreshing the agenda (rather than 
re-entering it each time org-agenda-redo is called).

I know that agenda filters persist when the agenda is refreshed, so I'm 
looking to do something similar with my custom value. I've experimented 
with trying to set the variable as a buffer local value, but without 
success.

Is this possible? If so, any ideas how?

-- 
Luke

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

* Re: Making a variable persistent when refreshing the agenda
  2018-04-13 14:05 Making a variable persistent when refreshing the agenda Luke
@ 2018-04-26 23:34 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2018-04-26 23:34 UTC (permalink / raw)
  To: Luke; +Cc: emacs-orgmode

Hi Luke,

Luke <mideniko1234-org@yahoo.co.uk> writes:

> Is this possible? If so, any ideas how?

I would simply set `org-deadline-warning-days' manually with

M-: (setq org-deadline-warning-days 3)

then `r' to redo the agenda.  This is not terribly longer
than setting the number of days from the prompt.

HTH,

-- 
 Bastien

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

end of thread, other threads:[~2018-04-26 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-13 14:05 Making a variable persistent when refreshing the agenda Luke
2018-04-26 23:34 ` Bastien

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).