emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-agenda-goto-today from end of agenda buffer fails / OS-X only
@ 2012-09-29  3:20 Juan Pechiar
  2012-09-29  6:18 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Juan Pechiar @ 2012-09-29  3:20 UTC (permalink / raw)
  To: Emacs-orgmode

A very minor bug when jumping to today from agenda buffer, on Emacs
for OS-X.

To reproduce:

On the weekly agenda buffer (C-c a a):
 - switch to a week other than the current week (e.g. press 'f')
 - go to the end of the buffer ('M->')
 - call org-agenda-goto-today (press '.')

This operation fails with

    'call-interactively: Wrong type argument: consp, nil'

The following setf fails because org-agenda-overriding-arguments is nil:

    (setf (nth 1 org-agenda-overriding-arguments) sd)

The value of org-agenda-overriding-arguments is set to

    (get-text-property (point) 'org-last-args)

So apparently, at end of agenda buffer (not on this week), this last
expression returns nil.

I get this error on Emacs for OSX (GNU Emacs 24.1.50.1
(x86_64-apple-darwin, NS apple-appkit-1038.36)), running Emacs -q or
otherwise, with latest org-mode development version (Org-mode version
7.9.1 (release_7.9.1-421-ge54882)).

Error does not occur on Linux.

Call trace:

Debugger entered--Lisp error: (wrong-type-argument consp nil)
  setcar(nil 734770)
  (let* ((c (nthcdr 1 org-agenda-overriding-arguments))) (setcar c sd))
  (setf (nth 1 org-agenda-overriding-arguments) sd)
  (let* ((sd (org-agenda-compute-starting-span (org-today) (or curspan org-agenda-ndays org-agenda-span))) (org-agenda-overriding-arguments args)) (setf (nth 1 org-agenda-overriding-arguments) sd) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda))
  (cond (tdpos (goto-char tdpos)) ((eq org-agenda-type (quote agenda)) (let* ((sd (org-agenda-compute-starting-span (org-today) (or curspan org-agenda-ndays org-agenda-span))) (org-agenda-overriding-arguments args)) (setf (nth 1 org-agenda-overriding-arguments) sd) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda))) (t (error "Cannot find today")))
  (let* ((args (get-text-property (point) (quote org-last-args))) (curspan (nth 2 args)) (tdpos (text-property-any (point-min) (point-max) (quote org-today) t))) (cond (tdpos (goto-char tdpos)) ((eq org-agenda-type (quote agenda)) (let* ((sd (org-agenda-compute-starting-span (org-today) (or curspan org-agenda-ndays org-agenda-span))) (org-agenda-overriding-arguments args)) (setf (nth 1 org-agenda-overriding-arguments) sd) (org-agenda-redo) (org-agenda-find-same-or-today-or-agenda))) (t (error "Cannot find today"))))
  org-agenda-goto-today()
  call-interactively(org-agenda-goto-today nil nil)

Thanks,
.j.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [BUG] org-agenda-goto-today from end of agenda buffer fails / OS-X only
  2012-09-29  3:20 [BUG] org-agenda-goto-today from end of agenda buffer fails / OS-X only Juan Pechiar
@ 2012-09-29  6:18 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-09-29  6:18 UTC (permalink / raw)
  To: Juan Pechiar; +Cc: Emacs-orgmode

Hi Juan,

Juan Pechiar <juan@pechiar.com> writes:

> A very minor bug when jumping to today from agenda buffer, on Emacs
> for OS-X.

Fixed, thanks.  

The thing is, if you add a text property from (point-min) to
(point-max), (get-text-property (point-max) 'prop) will always
return nil -- because it checks against the character *after*
(point-max)... which does not exist of course.

Thanks for reporting this!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-29  6:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-29  3:20 [BUG] org-agenda-goto-today from end of agenda buffer fails / OS-X only Juan Pechiar
2012-09-29  6:18 ` Bastien

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).