* Args out of range error when exporting agenda when maxlines > 0
@ 2009-04-30 19:56 Mike Buksas
2009-04-30 20:32 ` Nick Dokos
0 siblings, 1 reply; 3+ messages in thread
From: Mike Buksas @ 2009-04-30 19:56 UTC (permalink / raw)
To: emacs-orgmode
Hi all,
I'm trying to export the daily/weekly agenda as a ps file with C-c
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.
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.
I'm using org 6.26d. Here's the backtrace:
Debugger entered--Lisp error: (args-out-of-range 1571 1571)
font-at(1571 #<window 8 on *Org Agenda*>)
auto-compose-region(1 1695)
ps-mule-begin-job(1 1695)
ps-generate(#<buffer *temp*> 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 ... ...)) #<buffer
*Org Agenda*>)
eval((let nil (save-excursion (save-window-excursion ... ...))
#<buffer *Org Agenda*>))
org-let(nil (save-excursion (save-window-excursion
(org-agenda-mark-filtered-text) (let ... ... ...))) #<buffer *Org
Agenda*>)
org-write-agenda("~/test.ps" nil)
Thanks,
Mike
Mike Buksas -- mike.buksas@gmail.com -- www.buksas.net
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Args out of range error when exporting agenda when maxlines > 0
2009-04-30 19:56 Args out of range error when exporting agenda when maxlines > 0 Mike Buksas
@ 2009-04-30 20:32 ` Nick Dokos
2009-04-30 21:15 ` Mike Buksas
0 siblings, 1 reply; 3+ messages in thread
From: Nick Dokos @ 2009-04-30 20:32 UTC (permalink / raw)
To: mike.buksas; +Cc: emacs-orgmode
Mike Buksas <mike.buksas@gmail.com> 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 #<window 8 on *Org Agenda*>)
> auto-compose-region(1 1695)
> ps-mule-begin-job(1 1695)
> ps-generate(#<buffer *temp*> 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 ... ...)) #<buffer
> *Org Agenda*>)
> eval((let nil (save-excursion (save-window-excursion ... ...))
> #<buffer *Org Agenda*>))
> org-let(nil (save-excursion (save-window-excursion
> (org-agenda-mark-filtered-text) (let ... ... ...))) #<buffer *Org
> Agenda*>)
> org-write-agenda("~/test.ps" nil)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Args out of range error when exporting agenda when maxlines > 0
2009-04-30 20:32 ` Nick Dokos
@ 2009-04-30 21:15 ` Mike Buksas
0 siblings, 0 replies; 3+ messages in thread
From: Mike Buksas @ 2009-04-30 21:15 UTC (permalink / raw)
To: nicholas.dokos; +Cc: emacs-orgmode
On Thu, Apr 30, 2009 at 2:32 PM, Nick Dokos <nicholas.dokos@hp.com> 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.
Oops. Unforced error.
> I can't reproduce this (latest git org: 6.26trans, emacs 23.0.91).
> Are you running emacs 22.something?
Emacs 23.0.60.1 (from Debian's emacs-snapshot package)
> 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.
I should have said it looked larger than the buffer. For the test I
just ran, the argument producing the error is 1227, and (point-max) in
*Org Agenda* is 1226, but the 'to' argument to auto-compose-region is
1294. This difference of 68 characters looks to be about the
difference caused by included text. In fact, if I export to text and
load the resulting file, it's size is 1294.
It looks like auto-compose-region is getting called on the *Org
Agenda* buffer instead of *temp*, but getting a final point based on
the size of *temp*
Thanks,
Mike
>
> 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 #<window 8 on *Org Agenda*>)
>> auto-compose-region(1 1695)
>> ps-mule-begin-job(1 1695)
>> ps-generate(#<buffer *temp*> 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 ... ...)) #<buffer
>> *Org Agenda*>)
>> eval((let nil (save-excursion (save-window-excursion ... ...))
>> #<buffer *Org Agenda*>))
>> org-let(nil (save-excursion (save-window-excursion
>> (org-agenda-mark-filtered-text) (let ... ... ...))) #<buffer *Org
>> Agenda*>)
>> org-write-agenda("~/test.ps" nil)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-04-30 21:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-30 19:56 Args out of range error when exporting agenda when maxlines > 0 Mike Buksas
2009-04-30 20:32 ` Nick Dokos
2009-04-30 21:15 ` Mike Buksas
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).