From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Args out of range error when exporting agenda when maxlines > 0 Date: Thu, 30 Apr 2009 16:32:14 -0400 Message-ID: <9749.1241123534@alphaville.usa.hp.com> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lzcxp-0005YR-9s for emacs-orgmode@gnu.org; Thu, 30 Apr 2009 16:34:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lzcxk-0005XZ-9g for emacs-orgmode@gnu.org; Thu, 30 Apr 2009 16:34:36 -0400 Received: from [199.232.76.173] (port=35298 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lzcxk-0005XW-3w for emacs-orgmode@gnu.org; Thu, 30 Apr 2009 16:34:32 -0400 Received: from mx20.gnu.org ([199.232.41.8]:19338) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lzcxj-0005Ct-PX for emacs-orgmode@gnu.org; Thu, 30 Apr 2009 16:34:31 -0400 Received: from g5t0009.atlanta.hp.com ([15.192.0.46]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LzcwH-0006KH-28 for emacs-orgmode@gnu.org; Thu, 30 Apr 2009 16:33:01 -0400 In-Reply-To: Message from Mike Buksas of "Thu, 30 Apr 2009 13:56:56 MDT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: mike.buksas@gmail.com Cc: emacs-orgmode@gnu.org Mike Buksas wrote: > I'm trying to export the daily/weekly agenda as a ps file with C-c > C-w. That should be C-x C-w. > I get an out-of-range error, when: > - I've set org-agenda-add-entry-text-maxlines to be greater than zero > (and org-agenda-add-entry-text is in the before-write hook). > > - If there's an agenda item with more text to add. > I can't reproduce this (latest git org: 6.26trans, emacs 23.0.91). Are you running emacs 22.something? I suspect that the ps-foo implementation has changed sufficiently in 23.0.91, so that the backtrace would be different from the one you are getting (e.g. ps-mule-begin-job does not call auto-compose-region in 23.0.91, afaict). > HTML and text export are fine, and the entry text is included. From > the backtrace I can see that the argument to auto-compose-region is > too large. It looks like it would correct for the buffer with the > extra entry text added. Why do you think it's too large? Afaict, it's (point-max), i.e. the end of the buffer. My agenda e.g. has 2525 chars. So 1695 does not seem too large. HTH, Nick > > I'm using org 6.26d. Here's the backtrace: > > Debugger entered--Lisp error: (args-out-of-range 1571 1571) > font-at(1571 #) > auto-compose-region(1 1695) > ps-mule-begin-job(1 1695) > ps-generate(# 1 1695 ps-generate-postscript-with-faces) > ps-spool-with-faces(1 1695 nil) > ps-print-with-faces(1 1695 "~/test.ps") > ps-print-buffer-with-faces("~/test.ps") > (progn (fset (quote ps-get-buffer-name) (function* ...)) > (ps-print-buffer-with-faces file)) > (unwind-protect (progn (fset ... ...) (ps-print-buffer-with-faces > file)) (if --cl-letf-bound-- (fset ... --cl-letf-save--) (fmakunbound > ...))) > (let* ((--cl-letf-bound-- ...) (--cl-letf-save-- ...)) > (unwind-protect (progn ... ...) (if --cl-letf-bound-- ... ...))) > (letf ((... ...)) (ps-print-buffer-with-faces file)) > (letf* ((... ...)) (ps-print-buffer-with-faces file)) > (flet ((ps-get-buffer-name nil "Agenda View")) > (ps-print-buffer-with-faces file)) > (cond ((string-match "\\.html?\\'" file) (set-buffer ...) (when ... > ... ... ...) (write-file file) (kill-buffer ...) (message "HTML > written to %s" file)) ((string-match "\\.ps\\'" file) (require ...) > (flet ... ...) (message "Postscript written to %s" file)) > ((string-match "\\.pdf\\'" file) (require ...) (flet ... ...) > (call-process "ps2pdf" nil nil nil ... ...) (message "PDF written to > %s" file)) ((string-match "\\.ics\\'" file) (let ... ...)) (t (let ... > ... ... ... ... ... ...))) > (save-current-buffer (set-buffer temp-buffer) (insert bs) > (org-agenda-remove-marked-text (quote org-filtered)) (while (setq beg > ...) (delete-region beg ...)) (run-hooks (quote > org-agenda-before-write-hook)) (cond (... ... ... ... ... ...) (... > ... ... ...) (... ... ... ... ...) (... ...) (t ...))) > (with-current-buffer temp-buffer (insert bs) > (org-agenda-remove-marked-text (quote org-filtered)) (while (setq beg > ...) (delete-region beg ...)) (run-hooks (quote > org-agenda-before-write-hook)) (cond (... ... ... ... ... ...) (... > ... ... ...) (... ... ... ... ...) (... ...) (t ...))) > (unwind-protect (with-current-buffer temp-buffer (insert bs) > (org-agenda-remove-marked-text ...) (while ... ...) (run-hooks ...) > (cond ... ... ... ... ...)) (and (buffer-name temp-buffer) > (kill-buffer temp-buffer))) > (let ((temp-buffer ...)) (unwind-protect (with-current-buffer > temp-buffer ... ... ... ... ...) (and ... ...))) > (with-temp-buffer (insert bs) (org-agenda-remove-marked-text (quote > org-filtered)) (while (setq beg ...) (delete-region beg ...)) > (run-hooks (quote org-agenda-before-write-hook)) (cond (... ... ... > ... ... ...) (... ... ... ...) (... ... ... ... ...) (... ...) (t > ...))) > (let ((bs ...) beg) (org-agenda-unmark-filtered-text) > (with-temp-buffer (insert bs) (org-agenda-remove-marked-text ...) > (while ... ...) (run-hooks ...) (cond ... ... ... ... ...))) > (save-window-excursion (org-agenda-mark-filtered-text) (let (... > beg) (org-agenda-unmark-filtered-text) (with-temp-buffer ... ... ... > ... ...))) > (save-excursion (save-window-excursion > (org-agenda-mark-filtered-text) (let ... ... ...))) > (let nil (save-excursion (save-window-excursion ... ...)) # *Org Agenda*>) > eval((let nil (save-excursion (save-window-excursion ... ...)) > #)) > org-let(nil (save-excursion (save-window-excursion > (org-agenda-mark-filtered-text) (let ... ... ...))) # Agenda*>) > org-write-agenda("~/test.ps" nil)