Browse Source

org-agenda-append-agenda: check that we are in an agenda buffer.

Matt Lundin 14 years ago
parent
commit
9bb4ef66ab
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lisp/org-agenda.el

+ 2 - 0
lisp/org-agenda.el

@@ -2266,6 +2266,8 @@ Pressing `<' twice means to restrict to the current subtree or region
 This function allows interactive building of block agendas.
 This function allows interactive building of block agendas.
 Agenda views are separated by `org-agenda-block-separator'."
 Agenda views are separated by `org-agenda-block-separator'."
   (interactive)
   (interactive)
+  (unless (string= (buffer-name) org-agenda-buffer-name)
+    (error "Can only append from within agenda buffer"))
   (let ((org-agenda-multi t))
   (let ((org-agenda-multi t))
     (org-agenda)
     (org-agenda)
     (widen)))
     (widen)))