* [bug] org-agenda-diary-entry fails
@ 2013-02-19 9:39 Eric S Fraga
2013-02-19 15:54 ` W. Greenhouse
0 siblings, 1 reply; 3+ messages in thread
From: Eric S Fraga @ 2013-02-19 9:39 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 414 bytes --]
Hello,
with org up to date from git repository as of a few minutes ago, trying
to insert a day diary entry from the agenda view
(org-agenda-diary-entry) fails. Debug trace is attached.
I cannot see what could be causing this problem. Any suggestions? I
can start trying to bisect on recent changes.
Thanks,
eric
--
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org 7.9.3e-1123-g33d362
[-- Attachment #2: debug-trace.txt --]
[-- Type: text/plain, Size: 29672 bytes --]
Debugger entered--Lisp error: (error "Before first headline at position 1 in buffer diary.org")
signal(error ("Before first headline at position 1 in buffer diary.org"))
error("Before first headline at position %d in buffer %s" 1 #<buffer diary.org>)
(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)
(let (start-level re) (org-back-to-heading t) (setq start-level (funcall outline-level)) (if (equal start-level 1) nil (setq re (concat "^\\*\\{1," (number-to-string (1- start-level)) "\\} ")) (if (re-search-backward re nil t) (funcall outline-level))))
org-up-heading-safe()
(while (org-up-heading-safe) (if (looking-at org-complex-heading-regexp) (progn (setq rtn (cons (org-match-string-no-properties 4) rtn)))))
(save-restriction (widen) (while (org-up-heading-safe) (if (looking-at org-complex-heading-regexp) (progn (setq rtn (cons (org-match-string-no-properties 4) rtn))))) rtn)
(save-excursion (save-restriction (widen) (while (org-up-heading-safe) (if (looking-at org-complex-heading-regexp) (progn (setq rtn (cons (org-match-string-no-properties 4) rtn))))) rtn))
(let (rtn case-fold-search) (save-excursion (save-restriction (widen) (while (org-up-heading-safe) (if (looking-at org-complex-heading-regexp) (progn (setq rtn (cons ... rtn))))) rtn)))
(if fastp (progn (if (> level 19) (error "Outline path failure, more than 19 levels")) (progn (let* ((i level)) (while (<= i 19) (aset org-olpa i nil) (setq i (+ i 1))) nil)) (prog1 (delq nil (append org-olpa nil)) (aset org-olpa level heading))) (let (rtn case-fold-search) (save-excursion (save-restriction (widen) (while (org-up-heading-safe) (if (looking-at org-complex-heading-regexp) (progn (setq rtn ...)))) rtn))))
org-get-outline-path()
(and (derived-mode-p (quote org-mode)) (org-get-outline-path))
(let* (case-fold-search message-log-max (bfn (buffer-file-name (buffer-base-buffer))) (path (and (derived-mode-p (quote org-mode)) (org-get-outline-path))) res) (if current (setq path (append path (save-excursion (org-back-to-heading t) (if (looking-at org-complex-heading-regexp) (list (match-string 4))))))) (setq res (org-format-outline-path path (1- (frame-width)) (and file bfn (concat (file-name-nondirectory bfn) separator)) separator)) (if just-return-string (org-no-properties res) (message "%s" res)))
org-display-outline-path(nil nil "->" t)
(let ((s (org-display-outline-path nil nil "->" t))) (if (eq "" s) "" (concat s "->")))
(save-excursion (goto-char (or --mpom (point))) (let ((s (org-display-outline-path nil nil "->" t))) (if (eq "" s) "" (concat s "->"))))
(save-excursion (if (markerp --mpom) (set-buffer (marker-buffer --mpom))) (save-excursion (goto-char (or --mpom (point))) (let ((s (org-display-outline-path nil nil "->" t))) (if (eq "" s) "" (concat s "->")))))
(let ((--mpom (org-get-at-bol (quote org-marker)))) (save-excursion (if (markerp --mpom) (set-buffer (marker-buffer --mpom))) (save-excursion (goto-char (or --mpom (point))) (let ((s (org-display-outline-path nil nil "->" t))) (if (eq "" s) "" (concat s "->"))))))
(setq time (cond (s2 (concat (org-agenda-time-of-day-to-ampm-maybe s1) "-" (org-agenda-time-of-day-to-ampm-maybe s2) (if org-agenda-timegrid-use-ampm " "))) (s1 (concat (org-agenda-time-of-day-to-ampm-maybe s1) (if org-agenda-timegrid-use-ampm "........ " "......"))) (t "")) extra (or (and (not habitp) extra) "") breadcrumbs (let ((--mpom (org-get-at-bol (quote org-marker)))) (save-excursion (if (markerp --mpom) (set-buffer (marker-buffer --mpom))) (save-excursion (goto-char (or --mpom (point))) (let ((s (org-display-outline-path nil nil "->" t))) (if (eq "" s) "" (concat s "->")))))) category (if (symbolp category) (symbol-name category) category) thecategory (copy-sequence category) level (or level ""))
(let* ((category (or category (if (stringp org-category) org-category (and org-category (symbol-name org-category))) (if buffer-file-name (file-name-sans-extension (file-name-nondirectory buffer-file-name)) ""))) (category-icon (org-agenda-get-category-icon category)) (category-icon (if category-icon (propertize " " (quote display) category-icon) "")) (tag (if tags (nth (1- (length tags)) tags) "")) time effort neffort (ts (if dotime (concat (if (stringp dotime) dotime "") (and org-agenda-search-headline-for-time txt)))) (time-of-day (and dotime (org-get-time-of-day ts))) stamp plain s0 s1 s2 rtn srp l duration thecategory breadcrumbs) (and (derived-mode-p (quote org-mode)) buffer-file-name (add-to-list (quote org-agenda-contributing-files) buffer-file-name)) (if (and dotime time-of-day) (progn (if (or (setq stamp (string-match org-stamp-time-of-day-regexp ts)) (setq plain (string-match org-plain-time-of-day-regexp ts))) (progn (setq s0 (match-string 0 ts) srp (and stamp (match-end 3)) s1 (match-string (if plain 1 2) ts) s2 (match-string (if plain 8 ...) ts)) (if (and org-prefix-has-time org-agenda-remove-times-when-in-prefix (or stamp plain) (string-match ... txt) (not ...) (if ... ... t)) (setq txt (replace-match "" nil nil txt))))) (if s1 (setq s1 (org-get-time-of-day s1 (quote string) t))) (if s2 (setq s2 (org-get-time-of-day s2 (quote string) t))) (let (org-time-clocksum-use-effort-durations) (if (and s1 (not s2) org-agenda-default-appointment-duration) (progn (setq s2 (org-minutes-to-clocksum-string ...))))) (if s2 (progn (setq duration (- (org-hh:mm-string-to-minutes s2) (org-hh:mm-string-to-minutes s1))))))) (if (string-match "\\([ ]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ ]*$" txt) (progn (if (or (eq org-agenda-remove-tags t) (and org-agenda-remove-tags org-prefix-has-tag)) (setq txt (replace-match "" t t txt)) (setq txt (replace-match (concat (make-string ... 32) (match-string 2 txt)) t t txt))))) (if (derived-mode-p (quote org-mode)) (progn (setq effort (condition-case nil (progn (get-text-property 0 (quote org-effort) txt)) (error nil))) (if effort (setq neffort (org-duration-string-to-minutes effort) effort (setq effort (concat "[" effort "]"))) (setq effort "")))) (if remove-re (progn (while (string-match remove-re txt) (setq txt (replace-match "" t t txt))))) (add-text-properties 0 (length txt) (quote (org-heading t)) txt) (setq time (cond (s2 (concat (org-agenda-time-of-day-to-ampm-maybe s1) "-" (org-agenda-time-of-day-to-ampm-maybe s2) (if org-agenda-timegrid-use-ampm " "))) (s1 (concat (org-agenda-time-of-day-to-ampm-maybe s1) (if org-agenda-timegrid-use-ampm "........ " "......"))) (t "")) extra (or (and (not habitp) extra) "") breadcrumbs (let ((--mpom (org-get-at-bol (quote org-marker)))) (save-excursion (if (markerp --mpom) (set-buffer (marker-buffer --mpom))) (save-excursion (goto-char (or --mpom (point))) (let ((s ...)) (if (eq "" s) "" (concat s "->")))))) category (if (symbolp category) (symbol-name category) category) thecategory (copy-sequence category) level (or level "")) (if (string-match org-bracket-link-regexp category) (progn (setq l (if (match-end 3) (- (match-end 3) (match-beginning 3)) (- (match-end 1) (match-beginning 1)))) (if (< l (or org-prefix-category-length 0)) (progn (setq category (copy-sequence category)) (org-add-props category nil (quote extra-space) (make-string (- org-prefix-category-length l 1) 32))))) (if (and org-prefix-category-max-length (>= (length category) org-prefix-category-max-length)) (setq category (substring category 0 (1- org-prefix-category-max-length))))) (setq rtn (concat (eval formatter) txt)) (remove-text-properties 0 (length rtn) (quote (line-prefix t wrap-prefix t)) rtn) (org-add-props rtn nil (quote org-category) (if thecategory (downcase thecategory) category) (quote tags) (mapcar (quote org-downcase-keep-props) tags) (quote org-highest-priority) org-highest-priority (quote org-lowest-priority) org-lowest-priority (quote time-of-day) time-of-day (quote duration) duration (quote effort) effort (quote effort-minutes) neffort (quote breadcrumbs) breadcrumbs (quote txt) txt (quote level) level (quote time) time (quote extra) extra (quote format) org-prefix-format-compiled (quote dotime) dotime))
(progn (setq txt (org-trim txt)) (setq txt (org-agenda-fix-displayed-tags txt tags org-agenda-show-inherited-tags org-agenda-hide-tags-regexp)) (let* ((category (or category (if (stringp org-category) org-category (and org-category (symbol-name org-category))) (if buffer-file-name (file-name-sans-extension (file-name-nondirectory buffer-file-name)) ""))) (category-icon (org-agenda-get-category-icon category)) (category-icon (if category-icon (propertize " " (quote display) category-icon) "")) (tag (if tags (nth (1- (length tags)) tags) "")) time effort neffort (ts (if dotime (concat (if (stringp dotime) dotime "") (and org-agenda-search-headline-for-time txt)))) (time-of-day (and dotime (org-get-time-of-day ts))) stamp plain s0 s1 s2 rtn srp l duration thecategory breadcrumbs) (and (derived-mode-p (quote org-mode)) buffer-file-name (add-to-list (quote org-agenda-contributing-files) buffer-file-name)) (if (and dotime time-of-day) (progn (if (or (setq stamp (string-match org-stamp-time-of-day-regexp ts)) (setq plain (string-match org-plain-time-of-day-regexp ts))) (progn (setq s0 (match-string 0 ts) srp (and stamp ...) s1 (match-string ... ts) s2 (match-string ... ts)) (if (and org-prefix-has-time org-agenda-remove-times-when-in-prefix ... ... ... ...) (setq txt ...)))) (if s1 (setq s1 (org-get-time-of-day s1 (quote string) t))) (if s2 (setq s2 (org-get-time-of-day s2 (quote string) t))) (let (org-time-clocksum-use-effort-durations) (if (and s1 (not s2) org-agenda-default-appointment-duration) (progn (setq s2 ...)))) (if s2 (progn (setq duration (- ... ...)))))) (if (string-match "\\([ ]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ ]*$" txt) (progn (if (or (eq org-agenda-remove-tags t) (and org-agenda-remove-tags org-prefix-has-tag)) (setq txt (replace-match "" t t txt)) (setq txt (replace-match (concat ... ...) t t txt))))) (if (derived-mode-p (quote org-mode)) (progn (setq effort (condition-case nil (progn (get-text-property 0 ... txt)) (error nil))) (if effort (setq neffort (org-duration-string-to-minutes effort) effort (setq effort (concat "[" effort "]"))) (setq effort "")))) (if remove-re (progn (while (string-match remove-re txt) (setq txt (replace-match "" t t txt))))) (add-text-properties 0 (length txt) (quote (org-heading t)) txt) (setq time (cond (s2 (concat (org-agenda-time-of-day-to-ampm-maybe s1) "-" (org-agenda-time-of-day-to-ampm-maybe s2) (if org-agenda-timegrid-use-ampm " "))) (s1 (concat (org-agenda-time-of-day-to-ampm-maybe s1) (if org-agenda-timegrid-use-ampm "........ " "......"))) (t "")) extra (or (and (not habitp) extra) "") breadcrumbs (let ((--mpom (org-get-at-bol (quote org-marker)))) (save-excursion (if (markerp --mpom) (set-buffer (marker-buffer --mpom))) (save-excursion (goto-char (or --mpom ...)) (let (...) (if ... "" ...))))) category (if (symbolp category) (symbol-name category) category) thecategory (copy-sequence category) level (or level "")) (if (string-match org-bracket-link-regexp category) (progn (setq l (if (match-end 3) (- (match-end 3) (match-beginning 3)) (- (match-end 1) (match-beginning 1)))) (if (< l (or org-prefix-category-length 0)) (progn (setq category (copy-sequence category)) (org-add-props category nil (quote extra-space) (make-string ... 32))))) (if (and org-prefix-category-max-length (>= (length category) org-prefix-category-max-length)) (setq category (substring category 0 (1- org-prefix-category-max-length))))) (setq rtn (concat (eval formatter) txt)) (remove-text-properties 0 (length rtn) (quote (line-prefix t wrap-prefix t)) rtn) (org-add-props rtn nil (quote org-category) (if thecategory (downcase thecategory) category) (quote tags) (mapcar (quote org-downcase-keep-props) tags) (quote org-highest-priority) org-highest-priority (quote org-lowest-priority) org-lowest-priority (quote time-of-day) time-of-day (quote duration) duration (quote effort) effort (quote effort-minutes) neffort (quote breadcrumbs) breadcrumbs (quote txt) txt (quote level) level (quote time) time (quote extra) extra (quote format) org-prefix-format-compiled (quote dotime) dotime)))
(unwind-protect (progn (setq txt (org-trim txt)) (setq txt (org-agenda-fix-displayed-tags txt tags org-agenda-show-inherited-tags org-agenda-hide-tags-regexp)) (let* ((category (or category (if (stringp org-category) org-category (and org-category ...)) (if buffer-file-name (file-name-sans-extension ...) ""))) (category-icon (org-agenda-get-category-icon category)) (category-icon (if category-icon (propertize " " (quote display) category-icon) "")) (tag (if tags (nth (1- ...) tags) "")) time effort neffort (ts (if dotime (concat (if ... dotime "") (and org-agenda-search-headline-for-time txt)))) (time-of-day (and dotime (org-get-time-of-day ts))) stamp plain s0 s1 s2 rtn srp l duration thecategory breadcrumbs) (and (derived-mode-p (quote org-mode)) buffer-file-name (add-to-list (quote org-agenda-contributing-files) buffer-file-name)) (if (and dotime time-of-day) (progn (if (or (setq stamp ...) (setq plain ...)) (progn (setq s0 ... srp ... s1 ... s2 ...) (if ... ...))) (if s1 (setq s1 (org-get-time-of-day s1 ... t))) (if s2 (setq s2 (org-get-time-of-day s2 ... t))) (let (org-time-clocksum-use-effort-durations) (if (and s1 ... org-agenda-default-appointment-duration) (progn ...))) (if s2 (progn (setq duration ...))))) (if (string-match "\\([ ]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ ]*$" txt) (progn (if (or (eq org-agenda-remove-tags t) (and org-agenda-remove-tags org-prefix-has-tag)) (setq txt (replace-match "" t t txt)) (setq txt (replace-match ... t t txt))))) (if (derived-mode-p (quote org-mode)) (progn (setq effort (condition-case nil (progn ...) (error nil))) (if effort (setq neffort (org-duration-string-to-minutes effort) effort (setq effort ...)) (setq effort "")))) (if remove-re (progn (while (string-match remove-re txt) (setq txt (replace-match "" t t txt))))) (add-text-properties 0 (length txt) (quote (org-heading t)) txt) (setq time (cond (s2 (concat (org-agenda-time-of-day-to-ampm-maybe s1) "-" (org-agenda-time-of-day-to-ampm-maybe s2) (if org-agenda-timegrid-use-ampm " "))) (s1 (concat (org-agenda-time-of-day-to-ampm-maybe s1) (if org-agenda-timegrid-use-ampm "........ " "......"))) (t "")) extra (or (and (not habitp) extra) "") breadcrumbs (let ((--mpom (org-get-at-bol ...))) (save-excursion (if (markerp --mpom) (set-buffer ...)) (save-excursion (goto-char ...) (let ... ...)))) category (if (symbolp category) (symbol-name category) category) thecategory (copy-sequence category) level (or level "")) (if (string-match org-bracket-link-regexp category) (progn (setq l (if (match-end 3) (- ... ...) (- ... ...))) (if (< l (or org-prefix-category-length 0)) (progn (setq category ...) (org-add-props category nil ... ...)))) (if (and org-prefix-category-max-length (>= (length category) org-prefix-category-max-length)) (setq category (substring category 0 (1- org-prefix-category-max-length))))) (setq rtn (concat (eval formatter) txt)) (remove-text-properties 0 (length rtn) (quote (line-prefix t wrap-prefix t)) rtn) (org-add-props rtn nil (quote org-category) (if thecategory (downcase thecategory) category) (quote tags) (mapcar (quote org-downcase-keep-props) tags) (quote org-highest-priority) org-highest-priority (quote org-lowest-priority) org-lowest-priority (quote time-of-day) time-of-day (quote duration) duration (quote effort) effort (quote effort-minutes) neffort (quote breadcrumbs) breadcrumbs (quote txt) txt (quote level) level (quote time) time (quote extra) extra (quote format) org-prefix-format-compiled (quote dotime) dotime))) (set-match-data save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal (match-data))) (unwind-protect (progn (setq txt (org-trim txt)) (setq txt (org-agenda-fix-displayed-tags txt tags org-agenda-show-inherited-tags org-agenda-hide-tags-regexp)) (let* ((category (or category (if ... org-category ...) (if buffer-file-name ... ""))) (category-icon (org-agenda-get-category-icon category)) (category-icon (if category-icon (propertize " " ... category-icon) "")) (tag (if tags (nth ... tags) "")) time effort neffort (ts (if dotime (concat ... ...))) (time-of-day (and dotime (org-get-time-of-day ts))) stamp plain s0 s1 s2 rtn srp l duration thecategory breadcrumbs) (and (derived-mode-p (quote org-mode)) buffer-file-name (add-to-list (quote org-agenda-contributing-files) buffer-file-name)) (if (and dotime time-of-day) (progn (if (or ... ...) (progn ... ...)) (if s1 (setq s1 ...)) (if s2 (setq s2 ...)) (let (org-time-clocksum-use-effort-durations) (if ... ...)) (if s2 (progn ...)))) (if (string-match "\\([ ]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ ]*$" txt) (progn (if (or ... ...) (setq txt ...) (setq txt ...)))) (if (derived-mode-p (quote org-mode)) (progn (setq effort (condition-case nil ... ...)) (if effort (setq neffort ... effort ...) (setq effort "")))) (if remove-re (progn (while (string-match remove-re txt) (setq txt ...)))) (add-text-properties 0 (length txt) (quote (org-heading t)) txt) (setq time (cond (s2 (concat ... "-" ... ...)) (s1 (concat ... ...)) (t "")) extra (or (and (not habitp) extra) "") breadcrumbs (let ((--mpom ...)) (save-excursion (if ... ...) (save-excursion ... ...))) category (if (symbolp category) (symbol-name category) category) thecategory (copy-sequence category) level (or level "")) (if (string-match org-bracket-link-regexp category) (progn (setq l (if ... ... ...)) (if (< l ...) (progn ... ...))) (if (and org-prefix-category-max-length (>= ... org-prefix-category-max-length)) (setq category (substring category 0 ...)))) (setq rtn (concat (eval formatter) txt)) (remove-text-properties 0 (length rtn) (quote (line-prefix t wrap-prefix t)) rtn) (org-add-props rtn nil (quote org-category) (if thecategory (downcase thecategory) category) (quote tags) (mapcar (quote org-downcase-keep-props) tags) (quote org-highest-priority) org-highest-priority (quote org-lowest-priority) org-lowest-priority (quote time-of-day) time-of-day (quote duration) duration (quote effort) effort (quote effort-minutes) neffort (quote breadcrumbs) breadcrumbs (quote txt) txt (quote level) level (quote time) time (quote extra) extra (quote format) org-prefix-format-compiled (quote dotime) dotime))) (set-match-data save-match-data-internal (quote evaporate))))
(let* ((bindings (car org-prefix-format-compiled)) (formatter (cadr org-prefix-format-compiled))) (progn (let* ((--cl-var-- bindings) (--cl-var-- nil) (var nil) (value nil)) (while (consp --cl-var--) (setq --cl-var-- (car --cl-var--) var (car (prog1 --cl-var-- (setq --cl-var-- ...))) value (car --cl-var--)) (set var value) (setq --cl-var-- (cdr --cl-var--))) nil)) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (setq txt (org-trim txt)) (setq txt (org-agenda-fix-displayed-tags txt tags org-agenda-show-inherited-tags org-agenda-hide-tags-regexp)) (let* ((category (or category ... ...)) (category-icon (org-agenda-get-category-icon category)) (category-icon (if category-icon ... "")) (tag (if tags ... "")) time effort neffort (ts (if dotime ...)) (time-of-day (and dotime ...)) stamp plain s0 s1 s2 rtn srp l duration thecategory breadcrumbs) (and (derived-mode-p (quote org-mode)) buffer-file-name (add-to-list (quote org-agenda-contributing-files) buffer-file-name)) (if (and dotime time-of-day) (progn (if ... ...) (if s1 ...) (if s2 ...) (let ... ...) (if s2 ...))) (if (string-match "\\([ ]+\\)\\(:[[:alnum:]_@#%:]+:\\)[ ]*$" txt) (progn (if ... ... ...))) (if (derived-mode-p (quote org-mode)) (progn (setq effort ...) (if effort ... ...))) (if remove-re (progn (while ... ...))) (add-text-properties 0 (length txt) (quote (org-heading t)) txt) (setq time (cond (s2 ...) (s1 ...) (t "")) extra (or (and ... extra) "") breadcrumbs (let (...) (save-excursion ... ...)) category (if (symbolp category) (symbol-name category) category) thecategory (copy-sequence category) level (or level "")) (if (string-match org-bracket-link-regexp category) (progn (setq l ...) (if ... ...)) (if (and org-prefix-category-max-length ...) (setq category ...))) (setq rtn (concat (eval formatter) txt)) (remove-text-properties 0 (length rtn) (quote (line-prefix t wrap-prefix t)) rtn) (org-add-props rtn nil (quote org-category) (if thecategory (downcase thecategory) category) (quote tags) (mapcar (quote org-downcase-keep-props) tags) (quote org-highest-priority) org-highest-priority (quote org-lowest-priority) org-lowest-priority (quote time-of-day) time-of-day (quote duration) duration (quote effort) effort (quote effort-minutes) neffort (quote breadcrumbs) breadcrumbs (quote txt) txt (quote level) level (quote time) time (quote extra) extra (quote format) org-prefix-format-compiled (quote dotime) dotime))) (set-match-data save-match-data-internal (quote evaporate)))))
org-agenda-format-item(nil "11:00 test" nil nil nil t)
(setq fmt (org-agenda-format-item nil text nil nil nil t) time (get-text-property 0 (quote time) fmt) time2 (if (> (length time) 0) (concat " " (car (split-string time "\\."))) nil) text (get-text-property 0 (quote txt) fmt))
(if org-agenda-insert-diary-extract-time (setq fmt (org-agenda-format-item nil text nil nil nil t) time (get-text-property 0 (quote time) fmt) time2 (if (> (length time) 0) (concat " " (car (split-string time "\\."))) nil) text (get-text-property 0 (quote txt) fmt)))
(let ((org-prefix-has-time t) (org-agenda-time-leading-zero t) fmt time time2) (if org-agenda-insert-diary-extract-time (setq fmt (org-agenda-format-item nil text nil nil nil t) time (get-text-property 0 (quote time) fmt) time2 (if (> (length time) 0) (concat " " (car (split-string time "\\."))) nil) text (get-text-property 0 (quote txt) fmt))) (if (eq org-agenda-insert-diary-strategy (quote top-level)) (org-agenda-insert-diary-as-top-level text) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-agenda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d1)) nil nil nil nil time2))
(cond ((eq type (quote anniversary)) (or (re-search-forward "^*[ ]+Anniversaries" nil t) (progn (or (org-at-heading-p t) (progn (outline-next-heading) (insert "* Anniversaries\n\n") (beginning-of-line -1))))) (outline-next-heading) (org-back-over-empty-lines) (backward-char 1) (insert "\n") (insert (format "%%%%(org-anniversary %d %2d %2d) %s" (nth 2 d1) (car d1) (nth 1 d1) text))) ((eq type (quote day)) (let ((org-prefix-has-time t) (org-agenda-time-leading-zero t) fmt time time2) (if org-agenda-insert-diary-extract-time (setq fmt (org-agenda-format-item nil text nil nil nil t) time (get-text-property 0 (quote time) fmt) time2 (if (> (length time) 0) (concat " " (car ...)) nil) text (get-text-property 0 (quote txt) fmt))) (if (eq org-agenda-insert-diary-strategy (quote top-level)) (org-agenda-insert-diary-as-top-level text) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-agenda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d1)) nil nil nil nil time2)) (end-of-line 0)) ((eq type (quote block)) (if (> (calendar-absolute-from-gregorian d1) (calendar-absolute-from-gregorian d2)) (setq d1 (prog1 d2 (setq d2 d1)))) (if (eq org-agenda-insert-diary-strategy (quote top-level)) (org-agenda-insert-diary-as-top-level text) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-agenda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d1))) (insert "--") (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d2))) (end-of-line 0)))
(let ((cw (current-window-configuration))) (org-switch-to-buffer-other-window (find-file-noselect org-agenda-diary-file)) (widen) (goto-char (point-min)) (cond ((eq type (quote anniversary)) (or (re-search-forward "^*[ ]+Anniversaries" nil t) (progn (or (org-at-heading-p t) (progn (outline-next-heading) (insert "* Anniversaries\n\n") (beginning-of-line -1))))) (outline-next-heading) (org-back-over-empty-lines) (backward-char 1) (insert "\n") (insert (format "%%%%(org-anniversary %d %2d %2d) %s" (nth 2 d1) (car d1) (nth 1 d1) text))) ((eq type (quote day)) (let ((org-prefix-has-time t) (org-agenda-time-leading-zero t) fmt time time2) (if org-agenda-insert-diary-extract-time (setq fmt (org-agenda-format-item nil text nil nil nil t) time (get-text-property 0 (quote time) fmt) time2 (if (> ... 0) (concat " " ...) nil) text (get-text-property 0 (quote txt) fmt))) (if (eq org-agenda-insert-diary-strategy (quote top-level)) (org-agenda-insert-diary-as-top-level text) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-agenda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d1)) nil nil nil nil time2)) (end-of-line 0)) ((eq type (quote block)) (if (> (calendar-absolute-from-gregorian d1) (calendar-absolute-from-gregorian d2)) (setq d1 (prog1 d2 (setq d2 d1)))) (if (eq org-agenda-insert-diary-strategy (quote top-level)) (org-agenda-insert-diary-as-top-level text) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-agenda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d1))) (insert "--") (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-gregorian d2))) (end-of-line 0))) (if (string-match "\\S-" text) (progn (set-window-configuration cw) (message "%s entry added to %s" (capitalize (symbol-name type)) (abbreviate-file-name org-agenda-diary-file))) (org-reveal t) (message "Please finish entry here")))
org-agenda-add-entry-to-org-agenda-diary-file(day "11:00 test" (3 1 2013))
(cond ((equal char 100) (setq text (read-string "Day entry: ")) (org-agenda-add-entry-to-org-agenda-diary-file (quote day) text d1) (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char 97) (setq d1 (list (car d1) (nth 1 d1) (read-number (format "Reference year [%d]: " (nth 2 d1)) (nth 2 d1)))) (setq text (read-string "Anniversary (use %d to show years): ")) (org-agenda-add-entry-to-org-agenda-diary-file (quote anniversary) text d1) (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char 98) (setq text (read-string "Block entry: ")) (if (and d1 d2 (not (equal d1 d2))) nil (error "No block of days selected")) (org-agenda-add-entry-to-org-agenda-diary-file (quote block) text d1 d2) (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char 106) (org-switch-to-buffer-other-window (find-file-noselect org-agenda-diary-file)) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-reveal t)) (t (error "Invalid selection character `%c'" char)))
(let (d1 d2 char (text "") dp1 dp2) (if (equal (buffer-name) "*Calendar*") (setq d1 (calendar-cursor-to-date t) d2 (car calendar-mark-ring)) (setq dp1 (get-text-property (point-at-bol) (quote day))) (if dp1 nil (error "No date defined in current line")) (setq d1 (calendar-gregorian-from-absolute dp1) d2 (and (condition-case nil (progn (mark)) (error nil)) (save-excursion (goto-char (mark)) (setq dp2 (get-text-property (point-at-bol) (quote day)))) (calendar-gregorian-from-absolute dp2)))) (message "Diary entry: [d]ay [a]nniversary [b]lock [j]ump to date tree") (setq char (read-char-exclusive)) (cond ((equal char 100) (setq text (read-string "Day entry: ")) (org-agenda-add-entry-to-org-agenda-diary-file (quote day) text d1) (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char 97) (setq d1 (list (car d1) (nth 1 d1) (read-number (format "Reference year [%d]: " (nth 2 d1)) (nth 2 d1)))) (setq text (read-string "Anniversary (use %d to show years): ")) (org-agenda-add-entry-to-org-agenda-diary-file (quote anniversary) text d1) (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char 98) (setq text (read-string "Block entry: ")) (if (and d1 d2 (not (equal d1 d2))) nil (error "No block of days selected")) (org-agenda-add-entry-to-org-agenda-diary-file (quote block) text d1 d2) (and (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char 106) (org-switch-to-buffer-other-window (find-file-noselect org-agenda-diary-file)) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-reveal t)) (t (error "Invalid selection character `%c'" char))))
org-agenda-diary-entry-in-org-file()
(if (not (eq org-agenda-diary-file (quote diary-file))) (org-agenda-diary-entry-in-org-file) (require (quote diary-lib)) (let* ((char (progn (message "Diary entry: [d]ay [w]eekly [m]onthly [y]early [a]nniversary [b]lock [c]yclic") (read-char-exclusive))) (cmd (cdr (assoc char (quote (... ... ... ... ... ... ...))))) (oldf (symbol-function (quote calendar-cursor-to-date))) (point (point)) (mark (or (mark t) (point)))) (if cmd nil (error "No command associated with <%c>" char)) (if (and (get-text-property point (quote day)) (or (not (equal 98 char)) (get-text-property mark (quote day)))) nil (error "Don't know which date to use for diary entry")) (let ((calendar-mark-ring (list (calendar-gregorian-from-absolute (or ... ...))))) (unwind-protect (progn (fset (quote calendar-cursor-to-date) (function (lambda ... ...))) (call-interactively cmd)) (fset (quote calendar-cursor-to-date) oldf)))))
org-agenda-diary-entry()
call-interactively(org-agenda-diary-entry nil nil)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug] org-agenda-diary-entry fails
2013-02-19 9:39 [bug] org-agenda-diary-entry fails Eric S Fraga
@ 2013-02-19 15:54 ` W. Greenhouse
2013-02-19 20:33 ` Eric S Fraga
0 siblings, 1 reply; 3+ messages in thread
From: W. Greenhouse @ 2013-02-19 15:54 UTC (permalink / raw)
To: emacs-orgmode-mXXj517/zsQ
Hi Eric,
Eric S Fraga <e.fraga-hclig2XLE9Zaa/9Udqfwiw@public.gmane.org> writes:
> Hello,
>
> with org up to date from git repository as of a few minutes ago, trying
> to insert a day diary entry from the agenda view
> (org-agenda-diary-entry) fails. Debug trace is attached.
>
> I cannot see what could be causing this problem. Any suggestions? I
> can start trying to bisect on recent changes.
>
> Thanks,
> eric
Does the `diary.org' file already exist with at least one headline in
it?
> Debugger entered--Lisp error: (error "Before first headline at position 1 in buffer diary.org")
> signal(error ("Before first headline at position 1 in buffer diary.org"))
> error("Before first headline at position %d in buffer %s" 1 #<buffer diary.org>)
> (condition-case nil (outline-back-to-heading invisible-ok) (error
> (error "Before first headline at position %d in buffer %s" (point)
> (current-buffer))))
Granted, this is an issue that the org-diary really should be able to
handle, but it's worth trying this again in a file with at least one
headline.
I am using a datetree-formatted org file that I'd already been using for
a while as an org-capture target before putting my diary entries there.
So far it's been okay.
Let me know how it goes,
--
WGG
GnuPG/PGP key: subkeys.gnupg.net 0D2D3F9E
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug] org-agenda-diary-entry fails
2013-02-19 15:54 ` W. Greenhouse
@ 2013-02-19 20:33 ` Eric S Fraga
0 siblings, 0 replies; 3+ messages in thread
From: Eric S Fraga @ 2013-02-19 20:33 UTC (permalink / raw)
To: W. Greenhouse; +Cc: emacs-orgmode
"W. Greenhouse" <wgreenhouse@riseup.net> writes:
> Hi Eric,
>
> Eric S Fraga <e.fraga@ucl.ac.uk> writes:
>
>> Hello,
>>
>> with org up to date from git repository as of a few minutes ago, trying
>> to insert a day diary entry from the agenda view
>> (org-agenda-diary-entry) fails. Debug trace is attached.
>>
>> I cannot see what could be causing this problem. Any suggestions? I
>> can start trying to bisect on recent changes.
>>
>> Thanks,
>> eric
>
> Does the `diary.org' file already exist with at least one headline in
> it?
Sorry, I should maybe have given a few more details. My diary.org file
does exist, it has approximately 650 lines and uses a date tree
format. Plenty of headlines!
Inserting an entry from the agenda view is how I normally add dairy
appointments and I do this several times a day typically.
In any case, the problem has disappeared between this morning and now
(middle of the evening). I note that there have been several patches to
org-agenda.el and one looks very much like it addresses the problem I
had.
All's well! :-)
Thanks,
eric
--
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org 7.9.3e-1123-g33d362
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-19 20:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-19 9:39 [bug] org-agenda-diary-entry fails Eric S Fraga
2013-02-19 15:54 ` W. Greenhouse
2013-02-19 20:33 ` Eric S Fraga
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).