From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Wright, Jason L" Subject: batch saving patch for emacs 23/org 8.0.1 Date: Tue, 23 Apr 2013 15:15:13 -0600 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUkYb-0005yv-8g for emacs-orgmode@gnu.org; Tue, 23 Apr 2013 17:15:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUkYW-0004tO-OU for emacs-orgmode@gnu.org; Tue, 23 Apr 2013 17:15:21 -0400 Received: from na3sys010aog106.obsmtp.com ([74.125.245.80]:42244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUkYW-0004t5-H2 for emacs-orgmode@gnu.org; Tue, 23 Apr 2013 17:15:16 -0400 Received: by mail-ob0-f199.google.com with SMTP id wp18so6075018obc.6 for ; Tue, 23 Apr 2013 14:15:13 -0700 (PDT) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org When running: emacs -l ~/.emacs -eval '(org-batch-store-agenda-views)' -eval '(org-mobile-push)' It errors with: (wrong-number-of-arguments called-interactively-p 1) A proposed fix is below. What I don't know is whether the fix breaks something else (i.e. it seems to work for me, but my elisp-fu is woefully lacking). -bash-4.1$ emacs --version GNU Emacs 23.1.1 org-version: 8.0.1 (same potential error in git) Backtrace: Debugger entered--Lisp error: (wrong-number-of-arguments called-interactively-p 1) (called-interactively-p (quote any)) (if (called-interactively-p (quote any)) (not (y-or-n-p ...))) (and (file-exists-p file) (if (called-interactively-p ...) (not ...))) (or (not (file-writable-p file)) (and (file-exists-p file) (if ... ...))) (if (or (not ...) (and ... ...)) (user-error "Cannot write agenda to file %s" file)) org-agenda-write("/home/jason/mobile/theagenda.html" nil t "*Org Agenda*") (let nil (org-agenda-write (expand-file-name ... dir) nil t bufname)) eval((let nil (org-agenda-write (expand-file-name ... dir) nil t bufname))) (org-eval-in-environment (append org-agenda-exporter-settings opts pars) (org-agenda-write (expand-file-name ... dir) nil t bufname)) (while files (org-eval-in-environment (append org-agenda-exporter-settings opts pars) (org-agenda-write ... nil t bufname))) (progn (org-eval-in-environment (append org-agenda-exporter-settings opts pars) (org-agenda nil thiscmdkey)) (set-buffer bufname) (while files (org-eval-in-environment ... ...)) (and (get-buffer bufname) (kill-buffer bufname))) (if files (progn (org-eval-in-environment ... ...) (set-buffer bufname) (while files ...) (and ... ...))) (when files (org-eval-in-environment (append org-agenda-exporter-settings opts pars) (org-agenda nil thiscmdkey)) (set-buffer bufname) (while files (org-eval-in-environment ... ...)) (and (get-buffer bufname) (kill-buffer bufname))) (while cmds (setq cmd (pop cmds) thiscmdkey (car cmd) thiscmdcmd (cdr cmd) match (nth 2 thiscmdcmd) bufname (if org-agenda-sticky ... org-agenda-buffer-name) cmd-or-set (nth 2 cmd) opts (nth ... cmd) files (nth ... cmd)) (if (stringp files) (setq files ...)) (when files (org-eval-in-environment ... ...) (set-buffer bufname) (while files ...) (and ... ...))) (save-window-excursion (while cmds (setq cmd ... thiscmdkey ... thiscmdcmd ... match ... bufname ... cmd-or-set ... opts ... files ...) (if ... ...) (when files ... ... ... ...))) (let ((cmds ...) (pop-up-frames nil) (dir default-directory) (pars ...) cmd thiscmdkey thiscmdcmd match files opts cmd-or-set bufname) (save-window-excursion (while cmds ... ... ...))) (lambda (&rest parameters) "Run all custom agenda commands that have a file argument." (let (... ... ... ... cmd thiscmdkey thiscmdcmd match files opts cmd-or-set bufname) (save-window-excursion ...)))() (org-batch-store-agenda-views) eval((org-batch-store-agenda-views)) command-line-1(("-l" "/home/jason/.emacs" "-eval" "(org-batch-store-agenda-views)" "-eval" "(org-mobile-push)")) command-line() normal-top-level() Patch: diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 754247a..1fd9ee8 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3307,7 +3307,7 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda (interactive "FWrite agenda to file: \nP") (if (or (not (file-writable-p file)) (and (file-exists-p file) - (if (called-interactively-p 'any) + (if (org-called-interactively-p 'any) (not (y-or-n-p (format "Overwrite existing file %s? " file)))))) (user-error "Cannot write agenda to file %s" file)) (org-let (if nosettings nil org-agenda-exporter-settings)