From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Pechiar Subject: [BUG] org-agenda-goto-today from end of agenda buffer fails / OS-X only Date: Sat, 29 Sep 2012 00:20:49 -0300 Message-ID: <20120929032049.GA21191@soloJazz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:53621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THnbs-00025A-0U for emacs-orgmode@gnu.org; Fri, 28 Sep 2012 23:20:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THnbq-0007hQ-Mo for emacs-orgmode@gnu.org; Fri, 28 Sep 2012 23:20:55 -0400 Received: from oproxy7-pub.bluehost.com ([67.222.55.9]:38963) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1THnbq-0007gx-9s for emacs-orgmode@gnu.org; Fri, 28 Sep 2012 23:20:54 -0400 Received: from [186.48.120.48] (port=57030 helo=iso.palmas.net) by box519.bluehost.com with esmtpa (Exim 4.76) (envelope-from ) id 1THnbn-0002Up-G7 for emacs-orgmode@gnu.org; Fri, 28 Sep 2012 21:20:51 -0600 Content-Disposition: inline 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 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.