Browse Source

org-agenda.el (org-agenda-write): Overwrite file when called non-interactively

* org-agenda.el (org-agenda-write): Overwrite file when called
non-interactively.

Thanks to Simon Thum for reporting this.
Bastien Guerry 12 years ago
parent
commit
06ec886572
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lisp/org-agenda.el

+ 2 - 1
lisp/org-agenda.el

@@ -3219,7 +3219,8 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write."
   (interactive "FWrite agenda to file: \nP")
   (if (or (not (file-writable-p file))
 	  (and (file-exists-p file)
-	       (not (y-or-n-p (format "Overwrite existing file %s? " file)))))
+	       (if (called-interactively-p 'any)
+		   (not (y-or-n-p (format "Overwrite existing file %s? " file))))))
       (error "Cannot write agenda to file %s" file))
   (org-let (if nosettings nil org-agenda-exporter-settings)
     '(save-excursion