From mboxrd@z Thu Jan 1 00:00:00 1970 From: "G. Martin Butz" Subject: Re: Strange Behaviour while rescheduling date Date: Sat, 21 Sep 2013 18:41:22 +0200 Message-ID: <523DCC32.1030009@mkblog.org> References: <523C9E31.7090107@mkblog.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060502020604070008080401" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNQFO-0008QG-Jx for emacs-orgmode@gnu.org; Sat, 21 Sep 2013 12:41:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNQFK-0007FU-3G for emacs-orgmode@gnu.org; Sat, 21 Sep 2013 12:41:30 -0400 Received: from vwp11191.webpack.hosteurope.de ([2a01:488:42:1000:5bfa:4441::]:35386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNQFJ-0007F9-IB for emacs-orgmode@gnu.org; Sat, 21 Sep 2013 12:41:26 -0400 In-Reply-To: <523C9E31.7090107@mkblog.org> 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@gnu.org" This is a multi-part message in MIME format. --------------060502020604070008080401 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit In case I try to reschedule a date from the weekly agenda view I get the following backtrace; I am under the impression, that this seems not to be the bug, which I have tried to describe in the last message, but at least it shows, that something is wrong (with my setup/emacs/org?) ----------------------------8<----------------------------------------- Debugger entered--Lisp error: (error "Before first headline at position 1 in buffer date.org") signal(error ("Before first headline at position 1 in buffer date.org")) error("Before first headline at position %d in buffer %s" 1 #) (condition-case nil (outline-back-to-heading invisible-ok) (error (error "Before first headline at position %d in buffer %s" (point) (current-buffer)))) org-back-to-heading(t) (...) ----------------------------8<----------------------------------------- (I post the full backtrace message as txt-attachment). Thanks Martin Am 20.09.2013 21:12, schrieb G. Martin Butz: > Hi, > > I tried to describe this error a while ago, but did not get any response > - probably due to the fact, that I can not find out, how to securely > reproduce this very annoying behaviour; I will try to describe: > > 1. I try to reschedule an entry (C-c C-s) > 2. The buffer with the org file seems to be replaced by a calendar > 3. Futhermore 2 additional buffers appear with the calendar in it > 4. If can not assign a date meaning cursor movement (Shift Left/Right) > seems to be random e.g. skipping a few day and also going in the wrong > direction (e.g. left means right) > 5. If I try quitting emacs, I am asked if I want to save the original > org-mode buffer (in which I tried to reschedule a date) > 6. If I dare to do this, emacs will write the calender into this buffer > thereby erasing the original org mode file. > > I tried to deliver a backtrace (load org-mode and activate the debugger > according to [1]) but: There is no error message at all (!sic)! > > The only thing I could do is to make a screenshot showing state no. 3 [2]. > > This makes keeping track of dates in org-mode almost unusable for me. > Does anyone have an idea, what I could do to pinpoint this behaviour? > > I am running org-mode 8.2 (updated today, but have had this error since > a while) on emacs 24.3.1 on Linux Crunchbang Waldorf. > > Thanks for any hints and thanks alot for wonderful org-mode in general > Martin > > [1] > [2] -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | G. Martin Butz, mb@mkblog.org, 0421 98749324, www.mkblog.org | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --------------060502020604070008080401 Content-Type: text/plain; charset=UTF-8; name="backtrace.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="backtrace.txt" Debugger entered--Lisp error: (error "Before first headline at position 1= in buffer date.org") signal(error ("Before first headline at position 1 in buffer date.org")= ) error("Before first headline at position %d in buffer %s" 1 #) (condition-case nil (outline-back-to-heading invisible-ok) (error (erro= r "Before first headline at position %d in buffer %s" (point) (current-bu= ffer)))) org-back-to-heading(t) (let (col list elt ts buffer-invisibility-spec) (org-back-to-heading t)= (looking-at (concat org-outline-regexp "\\( *\\)[^ \n]*")) (goto-char (match-end 1)) (setq col (current-column)) (goto-char = (match-end 0)) (if (eobp) (insert "\n") (forward-char 1)) (if (and (not w= hat) (not (looking-at (concat "[ ]*" org-keyword-time-not-clock-regexp))= )) (progn (throw (quote exit) nil))) (if (and (not (looking-at org-outlin= e-regexp)) (looking-at (concat "[^ \n]*?" org-keyword-time-regexp "[^ \n]*")) (not (equal (match-string 1) org-clock-string))) (narrow-to-regio= n (match-beginning 0) (match-end 0)) (insert-before-markers "\n") (backwa= rd-char 1) (narrow-to-region (point) (point)) (and org-adapt-indentation = (org-indent-to-column col))) (setq list (cons what remove)) (while list (= setq elt (car (prog1 list (setq list (cdr list))))) (if (or (and (eq elt = (quote scheduled)) (re-search-forward org-scheduled-time-regexp nil t)) (= and (eq elt (quote deadline)) (re-search-forward org-deadline-time-regexp= nil t)) (and (eq elt (quote closed)) (re-search-forward org-closed-time-= regexp nil t))) (progn (replace-match "") (if (looking-at "--+<[^>]+>") (= replace-match ""))))) (and (looking-at "[ ]+") (replace-match "")) (and = org-adapt-indentation (bolp) (org-indent-to-column col)) (if what (progn = (insert (if (not (or (bolp) (eq ... 32))) " " "") (cond ((eq what (quote = scheduled)) org-scheduled-string) ((eq what (quote deadline)) org-deadlin= e-string) ((eq what (quote closed)) org-closed-string)) " ") (setq ts (or= g-insert-time-stamp time (or org-time-was-given (and (eq what ...) org-lo= g-done-with-time)) (eq what (quote closed)) nil nil (list org-end-time-wa= s-given))) (insert (if (not (or (bolp) (eq ... 32) (memq ... ...) (eobp))= ) " " "")) (end-of-line 1))) (goto-char (point-min)) (widen) (if (and (lo= oking-at "[ ]*\n") (equal (char-before) 10)) (delete-region (1- (point))= (point-at-eol))) ts) (save-restriction (let (col list elt ts buffer-invisibility-spec) (org-= back-to-heading t) (looking-at (concat org-outline-regexp "\\( *\\)[^ \n]*")) (goto-char (match-end 1)) (setq col (current-column)) (goto-char = (match-end 0)) (if (eobp) (insert "\n") (forward-char 1)) (if (and (not w= hat) (not (looking-at (concat "[ ]*" org-keyword-time-not-clock-regexp))= )) (progn (throw (quote exit) nil))) (if (and (not (looking-at org-outlin= e-regexp)) (looking-at (concat "[^ \n]*?" org-keyword-time-regexp "[^ \n]*")) (not (equal (match-string 1) org-clock-string))) (narrow-to-regio= n (match-beginning 0) (match-end 0)) (insert-before-markers "\n") (backwa= rd-char 1) (narrow-to-region (point) (point)) (and org-adapt-indentation = (org-indent-to-column col))) (setq list (cons what remove)) (while list (= setq elt (car (prog1 list (setq list (cdr list))))) (if (or (and (eq elt = (quote scheduled)) (re-search-forward org-scheduled-time-regexp nil t)) (= and (eq elt (quote deadline)) (re-search-forward org-deadline-time-regexp= nil t)) (and (eq elt (quote closed)) (re-search-forward org-closed-time-= regexp nil t))) (progn (replace-match "") (if (looking-at "--+<[^>]+>") (= replace-match ""))))) (and (looking-at "[ ]+") (replace-match "")) (and = org-adapt-indentation (bolp) (org-indent-to-column col)) (if what (progn = (insert (if (not (or ... ...)) " " "") (cond ((eq what ...) org-scheduled= -string) ((eq what ...) org-deadline-string) ((eq what ...) org-closed-st= ring)) " ") (setq ts (org-insert-time-stamp time (or org-time-was-given (= and ... org-log-done-with-time)) (eq what (quote closed)) nil nil (list o= rg-end-time-was-given))) (insert (if (not (or ... ... ... ...)) " " "")) = (end-of-line 1))) (goto-char (point-min)) (widen) (if (and (looking-at "[= ]*\n") (equal (char-before) 10)) (delete-region (1- (point)) (point-at-= eol))) ts)) (save-excursion (save-restriction (let (col list elt ts buffer-invisibi= lity-spec) (org-back-to-heading t) (looking-at (concat org-outline-regexp= "\\( *\\)[^ \n]*")) (goto-char (match-end 1)) (setq col (current-column)) (goto-char = (match-end 0)) (if (eobp) (insert "\n") (forward-char 1)) (if (and (not w= hat) (not (looking-at (concat "[ ]*" org-keyword-time-not-clock-regexp))= )) (progn (throw (quote exit) nil))) (if (and (not (looking-at org-outlin= e-regexp)) (looking-at (concat "[^ \n]*?" org-keyword-time-regexp "[^ \n]*")) (not (equal (match-string 1) org-clock-string))) (narrow-to-regio= n (match-beginning 0) (match-end 0)) (insert-before-markers "\n") (backwa= rd-char 1) (narrow-to-region (point) (point)) (and org-adapt-indentation = (org-indent-to-column col))) (setq list (cons what remove)) (while list (= setq elt (car (prog1 list (setq list ...)))) (if (or (and (eq elt ...) (r= e-search-forward org-scheduled-time-regexp nil t)) (and (eq elt ...) (re-= search-forward org-deadline-time-regexp nil t)) (and (eq elt ...) (re-sea= rch-forward org-closed-time-regexp nil t))) (progn (replace-match "") (if= (looking-at "--+<[^>]+>") (replace-match ""))))) (and (looking-at "[ ]+= ") (replace-match "")) (and org-adapt-indentation (bolp) (org-indent-to-c= olumn col)) (if what (progn (insert (if (not ...) " " "") (cond (... org-= scheduled-string) (... org-deadline-string) (... org-closed-string)) " ")= (setq ts (org-insert-time-stamp time (or org-time-was-given ...) (eq wha= t ...) nil nil (list org-end-time-was-given))) (insert (if (not ...) " " = "")) (end-of-line 1))) (goto-char (point-min)) (widen) (if (and (looking-= at "[ ]*\n") (equal (char-before) 10)) (delete-region (1- (point)) (poin= t-at-eol))) ts))) (catch (quote exit) (if (and (memq what (quote (scheduled deadline))) (= or (not time) (and (stringp time) (string-match "^[-+]+[0-9]" time)))) (p= rogn (save-excursion (org-back-to-heading t) (setq end (save-excursion (o= utline-next-heading) (point))) (if (re-search-forward (if (eq what ...) o= rg-scheduled-time-regexp org-deadline-time-regexp) end t) (progn (setq ts= (match-string 1) default-time (apply ... ...) default-input (and ts ...)= )))))) (if what (progn (setq time (if (stringp time) (apply (quote encode= -time) (org-read-date-analyze time default-time (decode-time default-time= ))) (or time (org-read-date nil (quote to-time) nil nil default-time defa= ult-input)))))) (if (and org-insert-labeled-timestamps-at-point (member w= hat (quote (scheduled deadline)))) (progn (insert (if (eq what (quote sch= eduled)) org-scheduled-string org-deadline-string) " ") (org-insert-time-= stamp time org-time-was-given nil nil nil (list org-end-time-was-given)) = (setq what nil))) (save-excursion (save-restriction (let (col list elt ts= buffer-invisibility-spec) (org-back-to-heading t) (looking-at (concat or= g-outline-regexp "\\( *\\)[^ \n]*")) (goto-char (match-end 1)) (setq col (current-column)) (goto-char = (match-end 0)) (if (eobp) (insert "\n") (forward-char 1)) (if (and (not w= hat) (not (looking-at ...))) (progn (throw (quote exit) nil))) (if (and (= not (looking-at org-outline-regexp)) (looking-at (concat "[^ \n]*?" org-keyword-time-regexp "[^ \n]*")) (not (equal ... org-clock-string))) (narrow-to-region (match-begi= nning 0) (match-end 0)) (insert-before-markers "\n") (backward-char 1) (n= arrow-to-region (point) (point)) (and org-adapt-indentation (org-indent-t= o-column col))) (setq list (cons what remove)) (while list (setq elt (car= (prog1 list ...))) (if (or (and ... ...) (and ... ...) (and ... ...)) (p= rogn (replace-match "") (if ... ...)))) (and (looking-at "[ ]+") (replac= e-match "")) (and org-adapt-indentation (bolp) (org-indent-to-column col)= ) (if what (progn (insert (if ... " " "") (cond ... ... ...) " ") (setq t= s (org-insert-time-stamp time ... ... nil nil ...)) (insert (if ... " " "= ")) (end-of-line 1))) (goto-char (point-min)) (widen) (if (and (looking-a= t "[ ]*\n") (equal (char-before) 10)) (delete-region (1- (point)) (point= -at-eol))) ts)))) (let (org-time-was-given org-end-time-was-given ts end default-time def= ault-input) (catch (quote exit) (if (and (memq what (quote (scheduled dea= dline))) (or (not time) (and (stringp time) (string-match "^[-+]+[0-9]" t= ime)))) (progn (save-excursion (org-back-to-heading t) (setq end (save-ex= cursion (outline-next-heading) (point))) (if (re-search-forward (if ... o= rg-scheduled-time-regexp org-deadline-time-regexp) end t) (progn (setq ts= ... default-time ... default-input ...)))))) (if what (progn (setq time = (if (stringp time) (apply (quote encode-time) (org-read-date-analyze time= default-time ...)) (or time (org-read-date nil ... nil nil default-time = default-input)))))) (if (and org-insert-labeled-timestamps-at-point (memb= er what (quote (scheduled deadline)))) (progn (insert (if (eq what (quote= scheduled)) org-scheduled-string org-deadline-string) " ") (org-insert-t= ime-stamp time org-time-was-given nil nil nil (list org-end-time-was-give= n)) (setq what nil))) (save-excursion (save-restriction (let (col list el= t ts buffer-invisibility-spec) (org-back-to-heading t) (looking-at (conca= t org-outline-regexp "\\( *\\)[^ \n]*")) (goto-char (match-end 1)) (setq col (current-column)) (goto-char = (match-end 0)) (if (eobp) (insert "\n") (forward-char 1)) (if (and (not w= hat) (not ...)) (progn (throw ... nil))) (if (and (not ...) (looking-at .= =2E.) (not ...)) (narrow-to-region (match-beginning 0) (match-end 0)) (in= sert-before-markers "\n") (backward-char 1) (narrow-to-region (point) (po= int)) (and org-adapt-indentation (org-indent-to-column col))) (setq list = (cons what remove)) (while list (setq elt (car ...)) (if (or ... ... ...)= (progn ... ...))) (and (looking-at "[ ]+") (replace-match "")) (and org= -adapt-indentation (bolp) (org-indent-to-column col)) (if what (progn (in= sert ... ... " ") (setq ts ...) (insert ...) (end-of-line 1))) (goto-char= (point-min)) (widen) (if (and (looking-at "[ ]*\n") (equal ... 10)) (de= lete-region (1- ...) (point-at-eol))) ts))))) org-add-planning-info(scheduled nil closed) (cond ((equal arg (quote (4))) (progn (if (and old-date org-log-resched= ule) (progn (org-add-log-setup (quote delschedule) nil old-date (quote fi= ndpos) org-log-reschedule))) (org-remove-timestamp-with-keyword org-sched= uled-string) (message "Item is no longer scheduled."))) ((equal arg (quot= e (16))) (save-excursion (if (re-search-forward org-scheduled-time-regexp= (save-excursion (outline-next-heading) (point)) t) (let* ((rpl0 (match-s= tring 1)) (rpl (replace-regexp-in-string " -[0-9]+[hdwmy]" "" rpl0))) (re= place-match (concat org-scheduled-string " <" rpl (format " -%dd" ...) ">= ") t t)) (user-error "No scheduled information to update")))) (t (org-add= -planning-info (quote scheduled) time (quote closed)) (if (and old-date o= rg-log-reschedule (not (equal old-date (substring org-last-inserted-times= tamp 1 -1)))) (progn (org-add-log-setup (quote reschedule) nil old-date (= quote findpos) org-log-reschedule))) (if repeater (progn (save-excursion = (org-back-to-heading t) (if (re-search-forward (concat org-scheduled-stri= ng " " org-last-inserted-timestamp) (save-excursion ... ...) t) (progn (g= oto-char ...) (insert " " repeater) (setq org-last-inserted-timestamp ...= )))))) (message "Scheduled to %s" org-last-inserted-timestamp))) (let* ((old-date (org-entry-get nil "SCHEDULED")) (old-date-time (if ol= d-date (org-time-string-to-time old-date))) (repeater (and old-date (stri= ng-match "\\([.+-]+[0-9]+[hdwmy]\\(?:[/ ][-+]?[0-9]+[hdwmy]\\)?\\) ?" old= -date) (match-string 1 old-date)))) (cond ((equal arg (quote (4))) (progn= (if (and old-date org-log-reschedule) (progn (org-add-log-setup (quote d= elschedule) nil old-date (quote findpos) org-log-reschedule))) (org-remov= e-timestamp-with-keyword org-scheduled-string) (message "Item is no longe= r scheduled."))) ((equal arg (quote (16))) (save-excursion (if (re-search= -forward org-scheduled-time-regexp (save-excursion (outline-next-heading)= (point)) t) (let* ((rpl0 ...) (rpl ...)) (replace-match (concat org-sche= duled-string " <" rpl ... ">") t t)) (user-error "No scheduled informatio= n to update")))) (t (org-add-planning-info (quote scheduled) time (quote = closed)) (if (and old-date org-log-reschedule (not (equal old-date (subst= ring org-last-inserted-timestamp 1 -1)))) (progn (org-add-log-setup (quot= e reschedule) nil old-date (quote findpos) org-log-reschedule))) (if repe= ater (progn (save-excursion (org-back-to-heading t) (if (re-search-forwar= d ... ... t) (progn ... ... ...))))) (message "Scheduled to %s" org-last-= inserted-timestamp)))) (if (and (org-region-active-p) org-loop-over-headlines-in-active-region= ) (let ((cl (if (eq org-loop-over-headlines-in-active-region (quote start= -level)) (quote region-start-level) (quote region))) org-loop-over-headli= nes-in-active-region) (org-map-entries (list (quote org-schedule) (list (= quote quote) arg) time) org-loop-over-headlines-in-active-region cl (if (= outline-invisible-p) (org-end-of-subtree nil t)))) (let* ((old-date (org-= entry-get nil "SCHEDULED")) (old-date-time (if old-date (org-time-string-= to-time old-date))) (repeater (and old-date (string-match "\\([.+-]+[0-9]= +[hdwmy]\\(?:[/ ][-+]?[0-9]+[hdwmy]\\)?\\) ?" old-date) (match-string 1 o= ld-date)))) (cond ((equal arg (quote (4))) (progn (if (and old-date org-l= og-reschedule) (progn (org-add-log-setup ... nil old-date ... org-log-res= chedule))) (org-remove-timestamp-with-keyword org-scheduled-string) (mess= age "Item is no longer scheduled."))) ((equal arg (quote (16))) (save-exc= ursion (if (re-search-forward org-scheduled-time-regexp (save-excursion .= =2E. ...) t) (let* (... ...) (replace-match ... t t)) (user-error "No sch= eduled information to update")))) (t (org-add-planning-info (quote schedu= led) time (quote closed)) (if (and old-date org-log-reschedule (not (equa= l old-date ...))) (progn (org-add-log-setup (quote reschedule) nil old-da= te (quote findpos) org-log-reschedule))) (if repeater (progn (save-excurs= ion (org-back-to-heading t) (if ... ...)))) (message "Scheduled to %s" or= g-last-inserted-timestamp))))) org-schedule(nil nil) (setq ts (org-schedule arg time)) (save-current-buffer (set-buffer buffer) (widen) (goto-char pos) (setq = ts (org-schedule arg time))) (let ((--cline (org-current-line)) (--cmd this-command) (--buf1 (curren= t-buffer)) (--buf2 buffer) (--undo1 buffer-undo-list) (--undo2 (save-curr= ent-buffer (set-buffer buffer) buffer-undo-list)) --c1 --c2) (save-curren= t-buffer (set-buffer buffer) (widen) (goto-char pos) (setq ts (org-schedu= le arg time))) (org-agenda-show-new-time marker ts " S") (if org-agenda-a= llow-remote-undo (progn (setq --c1 (org-verify-change-for-undo --undo1 (s= ave-current-buffer (set-buffer --buf1) buffer-undo-list)) --c2 (org-verif= y-change-for-undo --undo2 (save-current-buffer (set-buffer --buf2) buffer= -undo-list))) (if (or --c1 --c2) (progn (and --c1 (save-current-buffer (s= et-buffer --buf1) (undo-boundary))) (and --c2 (save-current-buffer (set-b= uffer --buf2) (undo-boundary))) (setq org-agenda-undo-list (cons (list --= cmd --cline --buf1 --c1 --buf2 --c2) org-agenda-undo-list))))))) (let* ((marker (or (org-get-at-bol (quote org-marker)) (org-agenda-erro= r))) (type (marker-insertion-type marker)) (buffer (marker-buffer marker)= ) (pos (marker-position marker)) (org-insert-labeled-timestamps-at-point = nil) ts) (set-marker-insertion-type marker t) (let ((--cline (org-current= -line)) (--cmd this-command) (--buf1 (current-buffer)) (--buf2 buffer) (-= -undo1 buffer-undo-list) (--undo2 (save-current-buffer (set-buffer buffer= ) buffer-undo-list)) --c1 --c2) (save-current-buffer (set-buffer buffer) = (widen) (goto-char pos) (setq ts (org-schedule arg time))) (org-agenda-sh= ow-new-time marker ts " S") (if org-agenda-allow-remote-undo (progn (setq= --c1 (org-verify-change-for-undo --undo1 (save-current-buffer (set-buffe= r --buf1) buffer-undo-list)) --c2 (org-verify-change-for-undo --undo2 (sa= ve-current-buffer (set-buffer --buf2) buffer-undo-list))) (if (or --c1 --= c2) (progn (and --c1 (save-current-buffer ... ...)) (and --c2 (save-curre= nt-buffer ... ...)) (setq org-agenda-undo-list (cons ... org-agenda-undo-= list))))))) (message "%s" ts)) org-agenda-schedule(nil) call-interactively(org-agenda-schedule nil nil) --------------060502020604070008080401--