From d832837693f598684dc95cfa256d131bc079c236 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sun, 26 Aug 2012 23:24:40 +0200 Subject: [PATCH] org-agenda.el: Define `org-toggle-sticky-agenda' before calling it --- lisp/org-agenda.el | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index c50c60aa2..e9a5a42a2 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -1852,18 +1852,6 @@ works you probably want to add it to `org-agenda-custom-commands' for good." ;;; Multiple agenda buffers support - -(defcustom org-agenda-sticky nil - "Non-nil means agenda q key will bury agenda buffers. -Agenda commands will then show existing buffer instead of generating new ones. -When nil, `q' will kill the single agenda buffer." - :group 'org-agenda - :type 'boolean - :set (lambda (var val) - (if (boundp var) - (org-toggle-sticky-agenda (if val 1 0)) - (set var val)))) - (defun org-toggle-sticky-agenda (&optional arg) "Toggle `org-agenda-sticky'." (interactive "P") @@ -1880,6 +1868,17 @@ When nil, `q' will kill the single agenda buffer." (message "Sticky agenda was %s" (if org-agenda-sticky "enabled" "disabled")))))) +(defcustom org-agenda-sticky nil + "Non-nil means agenda q key will bury agenda buffers. +Agenda commands will then show existing buffer instead of generating new ones. +When nil, `q' will kill the single agenda buffer." + :group 'org-agenda + :type 'boolean + :set (lambda (var val) + (if (boundp var) + (org-toggle-sticky-agenda (if val 1 0)) + (set var val)))) + (defvar org-agenda-buffer nil "Agenda buffer currently being generated.")