From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Lundin Subject: [BUG] Infinite loop in org-agenda-show-new-time Date: Mon, 05 Aug 2013 10:42:01 -0500 Message-ID: <87zjswb0vq.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6MvF-000219-4m for emacs-orgmode@gnu.org; Mon, 05 Aug 2013 11:42:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6Mv6-0002xD-Iz for emacs-orgmode@gnu.org; Mon, 05 Aug 2013 11:42:13 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:57675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6Mv6-0002wl-FB for emacs-orgmode@gnu.org; Mon, 05 Aug 2013 11:42:04 -0400 Received: from archdesk (unknown [209.147.100.197]) by mail.messagingengine.com (Postfix) with ESMTPA id 3305AC00E7F for ; Mon, 5 Aug 2013 11:42:02 -0400 (EDT) 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: Org Mode When the agenda buffer is filtered by tag, I find that rescheduling an item (via org-agenda-do-date-later, org-agenda-schedule, etc.) often results in an infinite loop. I believe this loop occurs in the function org-agenda-show-new-time. Here are the steps I took to debug this: 1. I add a counter to the function: --8<---------------cut here---------------start------------->8--- (defun org-agenda-show-new-time (marker stamp &optional prefix) "Show new date stamp via text properties." ;; We use text properties to make this undoable (let ((inhibit-read-only t)) (setq stamp (concat prefix " => " stamp " ")) (setq my-counter 0) ;; <-- my addition (save-excursion (goto-char (point-max)) (while (not (bobp)) (when (equal marker (org-get-at-bol 'org-marker)) (org-move-to-column (- (window-width) (length stamp)) t) (org-agenda-fix-tags-filter-overlays-at (point)) (setq my-counter (1+ my-counter)) ;; <-- also my addition (if (featurep 'xemacs) ;; Use `duplicable' property to trigger undo recording (let ((ex (make-extent nil nil)) (gl (make-glyph stamp))) (set-glyph-face gl 'secondary-selection) (set-extent-properties ex (list 'invisible t 'end-glyph gl 'duplicable t)) (insert-extent ex (1- (point)) (point-at-eol))) (add-text-properties (1- (point)) (point-at-eol) (list 'display (org-add-props stamp nil 'face 'secondary-selection)))) (beginning-of-line 1)) (beginning-of-line 0))))) --8<---------------cut here---------------end--------------->8--- 2. I narrow an agenda diary buffer by tag (e.g., "home"). 3. I reschedule an item. 4. Emacs hangs. 5. I hit C-g to stop the process. 6. I check the value of my-counter. The longer I let the process run, the higher the value of my-counter. E.g., letting it run for approximately ten seconds results in the following: --8<---------------cut here---------------start------------->8--- my-counter's value is 32193 Documentation: Not documented as a variable. --8<---------------cut here---------------end--------------->8--- Without C-g the number will keep increasing indefinitely. Thanks, Matt