From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: [bug] org-agenda-diary-entry fails Date: Tue, 19 Feb 2013 09:39:14 +0000 Message-ID: <87bobgtzgd.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7kCj-0006dl-Hn for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 05:13:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7kCf-0001UG-A2 for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 05:13:41 -0500 Received: from co1ehsobe003.messaging.microsoft.com ([216.32.180.186]:3167 helo=co1outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7jlo-0002xN-FJ for emacs-orgmode@gnu.org; Tue, 19 Feb 2013 04:45:52 -0500 Received: from mail35-co1 (localhost [127.0.0.1]) by mail35-co1-R.bigfish.com (Postfix) with ESMTP id 2E1E35C0254 for ; Tue, 19 Feb 2013 09:45:42 +0000 (UTC) Received: from CO1EHSMHS027.bigfish.com (unknown [10.243.78.203]) by mail35-co1.bigfish.com (Postfix) with ESMTP id 52663402EB for ; Tue, 19 Feb 2013 09:45:16 +0000 (UTC) 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 --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename="debug-trace.txt" Content-Transfer-Encoding: quoted-printable Debugger entered--Lisp error: (error "Before first headline at position 1 i= n 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 #) (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 or= g-complex-heading-regexp) (progn (setq rtn (cons (org-match-string-no-prope= rties 4) rtn))))) rtn) (save-excursion (save-restriction (widen) (while (org-up-heading-safe) (i= f (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) (wh= ile (org-up-heading-safe) (if (looking-at org-complex-heading-regexp) (prog= n (setq rtn (cons ... rtn))))) rtn))) (if fastp (progn (if (> level 19) (error "Outline path failure, more than= 19 levels")) (progn (let* ((i level)) (while (<=3D 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-compl= ex-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-ba= se-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-stri= ng 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) "" (co= ncat s "->"))) (save-excursion (goto-char (or --mpom (point))) (let ((s (org-display-out= line-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-outl= ine-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-amp= m " "))) (s1 (concat (org-agenda-time-of-day-to-ampm-maybe s1) (if org-agen= da-timegrid-use-ampm "........ " "......"))) (t "")) extra (or (and (not ha= bitp) extra) "") breadcrumbs (let ((--mpom (org-get-at-bol (quote org-marke= r)))) (save-excursion (if (markerp --mpom) (set-buffer (marker-buffer --mpo= m))) (save-excursion (goto-char (or --mpom (point))) (let ((s (org-display-= outline-path nil nil "->" t))) (if (eq "" s) "" (concat s "->")))))) catego= ry (if (symbolp category) (symbol-name category) category) thecategory (cop= y-sequence category) level (or level "")) (let* ((category (or category (if (stringp org-category) org-category (an= d 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-i= con (propertize " " (quote display) category-icon) "")) (tag (if tags (nth = (1- (length tags)) tags) "")) time effort neffort (ts (if dotime (concat (i= f (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 s= 2 rtn srp l duration thecategory breadcrumbs) (and (derived-mode-p (quote o= rg-mode)) buffer-file-name (add-to-list (quote org-agenda-contributing-file= s) buffer-file-name)) (if (and dotime time-of-day) (progn (if (or (setq sta= mp (string-match org-stamp-time-of-day-regexp ts)) (setq plain (string-matc= h org-plain-time-of-day-regexp ts))) (progn (setq s0 (match-string 0 ts) sr= p (and stamp (match-end 3)) s1 (match-string (if plain 1 2) ts) s2 (match-s= tring (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 (o= rg-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) (i= f (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-ha= s-tag)) (setq txt (replace-match "" t t txt)) (setq txt (replace-match (con= cat (make-string ... 32) (match-string 2 txt)) t t txt))))) (if (derived-mo= de-p (quote org-mode)) (progn (setq effort (condition-case nil (progn (get-= text-property 0 (quote org-effort) txt)) (error nil))) (if effort (setq nef= fort (org-duration-string-to-minutes effort) effort (setq effort (concat "[= " effort "]"))) (setq effort "")))) (if remove-re (progn (while (string-mat= ch remove-re txt) (setq txt (replace-match "" t t txt))))) (add-text-proper= ties 0 (length txt) (quote (org-heading t)) txt) (setq time (cond (s2 (conc= at (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-ag= enda-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 (m= arkerp --mpom) (set-buffer (marker-buffer --mpom))) (save-excursion (goto-c= har (or --mpom (point))) (let ((s ...)) (if (eq "" s) "" (concat s "->"))))= )) category (if (symbolp category) (symbol-name category) category) thecate= gory (copy-sequence category) level (or level "")) (if (string-match org-br= acket-link-regexp category) (progn (setq l (if (match-end 3) (- (match-end = 3) (match-beginning 3)) (- (match-end 1) (match-beginning 1)))) (if (< l (o= r org-prefix-category-length 0)) (progn (setq category (copy-sequence categ= ory)) (org-add-props category nil (quote extra-space) (make-string (- org-p= refix-category-length l 1) 32))))) (if (and org-prefix-category-max-length = (>=3D (length category) org-prefix-category-max-length)) (setq category (su= bstring category 0 (1- org-prefix-category-max-length))))) (setq rtn (conca= t (eval formatter) txt)) (remove-text-properties 0 (length rtn) (quote (lin= e-prefix t wrap-prefix t)) rtn) (org-add-props rtn nil (quote org-category)= (if thecategory (downcase thecategory) category) (quote tags) (mapcar (quo= te 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 le= vel) 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 (p= ropertize " " (quote display) category-icon) "")) (tag (if tags (nth (1- (l= ength tags)) tags) "")) time effort neffort (ts (if dotime (concat (if (str= ingp dotime) dotime "") (and org-agenda-search-headline-for-time txt)))) (t= ime-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-mod= e)) buffer-file-name (add-to-list (quote org-agenda-contributing-files) buf= fer-file-name)) (if (and dotime time-of-day) (progn (if (or (setq stamp (st= ring-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 ... ... ... ...) (s= etq 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-app= ointment-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-mi= nutes effort) effort (setq effort (concat "[" effort "]"))) (setq effort ""= )))) (if remove-re (progn (while (string-match remove-re txt) (setq txt (re= place-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-a= mpm-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 (mar= ker-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 (s= tring-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 (c= opy-sequence category)) (org-add-props category nil (quote extra-space) (ma= ke-string ... 32))))) (if (and org-prefix-category-max-length (>=3D (length= category) org-prefix-category-max-length)) (setq category (substring categ= ory 0 (1- org-prefix-category-max-length))))) (setq rtn (concat (eval forma= tter) txt)) (remove-text-properties 0 (length rtn) (quote (line-prefix t wr= ap-prefix t)) rtn) (org-add-props rtn nil (quote org-category) (if thecateg= ory (downcase thecategory) category) (quote tags) (mapcar (quote org-downca= se-keep-props) tags) (quote org-highest-priority) org-highest-priority (quo= te org-lowest-priority) org-lowest-priority (quote time-of-day) time-of-day= (quote duration) duration (quote effort) effort (quote effort-minutes) nef= fort (quote breadcrumbs) breadcrumbs (quote txt) txt (quote level) level (q= uote time) time (quote extra) extra (quote format) org-prefix-format-compil= ed (quote dotime) dotime))) (unwind-protect (progn (setq txt (org-trim txt)) (setq txt (org-agenda-fi= x-displayed-tags txt tags org-agenda-show-inherited-tags org-agenda-hide-ta= gs-regexp)) (let* ((category (or category (if (stringp org-category) org-ca= tegory (and org-category ...)) (if buffer-file-name (file-name-sans-extensi= on ...) ""))) (category-icon (org-agenda-get-category-icon category)) (cate= gory-icon (if category-icon (propertize " " (quote display) category-icon) = "")) (tag (if tags (nth (1- ...) tags) "")) time effort neffort (ts (if dot= ime (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-fil= es) buffer-file-name)) (if (and dotime time-of-day) (progn (if (or (setq st= amp ...) (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-duratio= ns) (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 ...) (erro= r nil))) (if effort (setq neffort (org-duration-string-to-minutes effort) e= ffort (setq effort ...)) (setq effort "")))) (if remove-re (progn (while (s= tring-match remove-re txt) (setq txt (replace-match "" t t txt))))) (add-te= xt-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 (conca= t (org-agenda-time-of-day-to-ampm-maybe s1) (if org-agenda-timegrid-use-amp= m "........ " "......"))) (t "")) extra (or (and (not habitp) extra) "") br= eadcrumbs (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) thecatego= ry (copy-sequence category) level (or level "")) (if (string-match org-brac= ket-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 (>=3D (length category) org-prefix-category-max-length)) (setq c= ategory (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 or= g-category) (if thecategory (downcase thecategory) category) (quote tags) (= mapcar (quote org-downcase-keep-props) tags) (quote org-highest-priority) o= rg-highest-priority (quote org-lowest-priority) org-lowest-priority (quote = time-of-day) time-of-day (quote duration) duration (quote effort) effort (q= uote effort-minutes) neffort (quote breadcrumbs) breadcrumbs (quote txt) tx= t (quote level) level (quote time) time (quote extra) extra (quote format) = org-prefix-format-compiled (quote dotime) dotime))) (set-match-data save-ma= tch-data-internal (quote evaporate))) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (se= tq txt (org-trim txt)) (setq txt (org-agenda-fix-displayed-tags txt tags or= g-agenda-show-inherited-tags org-agenda-hide-tags-regexp)) (let* ((category= (or category (if ... org-category ...) (if buffer-file-name ... ""))) (cat= egory-icon (org-agenda-get-category-icon category)) (category-icon (if cate= gory-icon (propertize " " ... category-icon) "")) (tag (if tags (nth ... ta= gs) "")) 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 dura= tion thecategory breadcrumbs) (and (derived-mode-p (quote org-mode)) buffer= -file-name (add-to-list (quote org-agenda-contributing-files) buffer-file-n= ame)) (if (and dotime time-of-day) (progn (if (or ... ...) (progn ... ...))= (if s1 (setq s1 ...)) (if s2 (setq s2 ...)) (let (org-time-clocksum-use-ef= fort-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 (se= tq 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-h= eading t)) txt) (setq time (cond (s2 (concat ... "-" ... ...)) (s1 (concat = ... ...)) (t "")) extra (or (and (not habitp) extra) "") breadcrumbs (let (= (--mpom ...)) (save-excursion (if ... ...) (save-excursion ... ...))) categ= ory (if (symbolp category) (symbol-name category) category) thecategory (co= py-sequence category) level (or level "")) (if (string-match org-bracket-li= nk-regexp category) (progn (setq l (if ... ... ...)) (if (< l ...) (progn .= .. ...))) (if (and org-prefix-category-max-length (>=3D ... org-prefix-cate= gory-max-length)) (setq category (substring category 0 ...)))) (setq rtn (c= oncat (eval formatter) txt)) (remove-text-properties 0 (length rtn) (quote = (line-prefix t wrap-prefix t)) rtn) (org-add-props rtn nil (quote org-categ= ory) (if thecategory (downcase thecategory) category) (quote tags) (mapcar = (quote org-downcase-keep-props) tags) (quote org-highest-priority) org-high= est-priority (quote org-lowest-priority) org-lowest-priority (quote time-of= -day) time-of-day (quote duration) duration (quote effort) effort (quote ef= fort-minutes) neffort (quote breadcrumbs) breadcrumbs (quote txt) txt (quot= e level) level (quote time) time (quote extra) extra (quote format) org-pre= fix-format-compiled (quote dotime) dotime))) (set-match-data save-match-dat= a-internal (quote evaporate)))) (let* ((bindings (car org-prefix-format-compiled)) (formatter (cadr org-p= refix-format-compiled))) (progn (let* ((--cl-var-- bindings) (--cl-var-- ni= l) (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 cat= egory ... ...)) (category-icon (org-agenda-get-category-icon category)) (ca= tegory-icon (if category-icon ... "")) (tag (if tags ... "")) time effort n= effort (ts (if dotime ...)) (time-of-day (and dotime ...)) stamp plain s0 s= 1 s2 rtn srp l duration thecategory breadcrumbs) (and (derived-mode-p (quot= e org-mode)) buffer-file-name (add-to-list (quote org-agenda-contributing-f= iles) 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) thec= ategory (copy-sequence category) level (or level "")) (if (string-match org= -bracket-link-regexp category) (progn (setq l ...) (if ... ...)) (if (and o= rg-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-pr= iority (quote org-lowest-priority) org-lowest-priority (quote time-of-day) = time-of-day (quote duration) duration (quote effort) effort (quote effort-m= inutes) neffort (quote breadcrumbs) breadcrumbs (quote txt) txt (quote leve= l) level (quote time) time (quote extra) extra (quote format) org-prefix-fo= rmat-compiled (quote dotime) dotime))) (set-match-data save-match-data-inte= rnal (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-ite= m 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 t= ime2) (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) t= ime2 (if (> (length time) 0) (concat " " (car (split-string time "\\."))) n= il) 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 tex= t) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-a= genda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-f= rom-absolute (calendar-absolute-from-gregorian d1)) nil nil nil nil time2)) (cond ((eq type (quote anniversary)) (or (re-search-forward "^*[ ]+Anniv= ersaries" nil t) (progn (or (org-at-heading-p t) (progn (outline-next-headi= ng) (insert "* Anniversaries\n\n") (beginning-of-line -1))))) (outline-next= -heading) (org-back-over-empty-lines) (backward-char 1) (insert "\n") (inse= rt (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-agen= da-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-t= ext-property 0 (quote time) fmt) time2 (if (> (length time) 0) (concat " " = (car ...)) nil) text (get-text-property 0 (quote txt) fmt))) (if (eq org-ag= enda-insert-diary-strategy (quote top-level)) (org-agenda-insert-diary-as-t= op-level text) (require (quote org-datetree)) (org-datetree-find-date-creat= e 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-abs= olute-from-gregorian d1) (calendar-absolute-from-gregorian d2)) (setq d1 (p= rog1 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-da= tetree)) (org-datetree-find-date-create d1) (org-agenda-insert-diary-make-n= ew-entry text)) (org-insert-time-stamp (org-time-from-absolute (calendar-ab= solute-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-wi= ndow (find-file-noselect org-agenda-diary-file)) (widen) (goto-char (point-= min)) (cond ((eq type (quote anniversary)) (or (re-search-forward "^*[ ]+A= nniversaries" nil t) (progn (or (org-at-heading-p t) (progn (outline-next-h= eading) (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) (n= th 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-ext= ract-time (setq fmt (org-agenda-format-item nil text nil nil nil t) time (g= et-text-property 0 (quote time) fmt) time2 (if (> ... 0) (concat " " ...) n= il) 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 tex= t) (require (quote org-datetree)) (org-datetree-find-date-create d1) (org-a= genda-insert-diary-make-new-entry text)) (org-insert-time-stamp (org-time-f= rom-absolute (calendar-absolute-from-gregorian d1)) nil nil nil nil time2))= (end-of-line 0)) ((eq type (quote block)) (if (> (calendar-absolute-from-g= regorian d1) (calendar-absolute-from-gregorian d2)) (setq d1 (prog1 d2 (set= q d2 d1)))) (if (eq org-agenda-insert-diary-strategy (quote top-level)) (or= g-agenda-insert-diary-as-top-level text) (require (quote org-datetree)) (or= g-datetree-find-date-create d1) (org-agenda-insert-diary-make-new-entry tex= t)) (org-insert-time-stamp (org-time-from-absolute (calendar-absolute-from-= gregorian d1))) (insert "--") (org-insert-time-stamp (org-time-from-absolut= e (calendar-absolute-from-gregorian d2))) (end-of-line 0))) (if (string-mat= ch "\\S-" text) (progn (set-window-configuration cw) (message "%s entry add= ed 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-agen= da-add-entry-to-org-agenda-diary-file (quote day) text d1) (and (equal (buf= fer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char 97) (set= q 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 anni= versary) text d1) (and (equal (buffer-name) org-agenda-buffer-name) (org-ag= enda-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) (an= d (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 d= p1 (get-text-property (point-at-bol) (quote day))) (if dp1 nil (error "No d= ate defined in current line")) (setq d1 (calendar-gregorian-from-absolute d= p1) 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-age= nda-add-entry-to-org-agenda-diary-file (quote day) text d1) (and (equal (bu= ffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal char 97) (se= tq 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 ann= iversary) text d1) (and (equal (buffer-name) org-agenda-buffer-name) (org-a= genda-redo))) ((equal char 98) (setq text (read-string "Block entry: ")) (i= f (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) (a= nd (equal (buffer-name) org-agenda-buffer-name) (org-agenda-redo))) ((equal= char 106) (org-switch-to-buffer-other-window (find-file-noselect org-agend= a-diary-file)) (require (quote org-datetree)) (org-datetree-find-date-creat= e 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 (messag= e "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 comm= and associated with <%c>" char)) (if (and (get-text-property point (quote d= ay)) (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-prot= ect (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) --=-=-=--