From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luke Subject: Making a variable persistent when refreshing the agenda Date: Fri, 13 Apr 2018 22:05:48 +0800 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6zL1-0005HM-UL for emacs-orgmode@gnu.org; Fri, 13 Apr 2018 10:06:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6zKy-0001nw-Nd for emacs-orgmode@gnu.org; Fri, 13 Apr 2018 10:06:03 -0400 Received: from [195.159.176.226] (port=54046 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f6zKy-0001mz-Fe for emacs-orgmode@gnu.org; Fri, 13 Apr 2018 10:06:00 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1f6zIp-00018J-5A for emacs-orgmode@gnu.org; Fri, 13 Apr 2018 16:03:47 +0200 Content-Language: en-US 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" To: emacs-orgmode@gnu.org 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