forked from mirrors/org-mode
org-agenda.el: More appropriate error when there is no Org agenda.
* org-agenda.el (org-agenda-check-type): Throw a more appropriate error message when no agenda is currently being displayed.
This commit is contained in:
parent
4ea1d6206a
commit
6f571de2f0
|
@ -6381,11 +6381,13 @@ in the file. Otherwise, restriction will be to the current subtree."
|
||||||
(defun org-agenda-check-type (error &rest types)
|
(defun org-agenda-check-type (error &rest types)
|
||||||
"Check if agenda buffer is of allowed type.
|
"Check if agenda buffer is of allowed type.
|
||||||
If ERROR is non-nil, throw an error, otherwise just return nil."
|
If ERROR is non-nil, throw an error, otherwise just return nil."
|
||||||
|
(if (not org-agenda-type)
|
||||||
|
(error "No Org agenda currently displayed")
|
||||||
(if (memq org-agenda-type types)
|
(if (memq org-agenda-type types)
|
||||||
t
|
t
|
||||||
(if error
|
(if error
|
||||||
(error "Not allowed in %s-type agenda buffers" org-agenda-type)
|
(error "Not allowed in %s-type agenda buffers" org-agenda-type)
|
||||||
nil)))
|
nil))))
|
||||||
|
|
||||||
(defun org-agenda-Quit (&optional arg)
|
(defun org-agenda-Quit (&optional arg)
|
||||||
"Exit agenda by removing the window or the buffer."
|
"Exit agenda by removing the window or the buffer."
|
||||||
|
|
Loading…
Reference in New Issue