From mboxrd@z Thu Jan 1 00:00:00 1970 From: Giovanni Ridolfi Subject: Re: Bug: capture with PROPERTIES [7.4 commit-4760c3b94...] Date: Mon, 13 Dec 2010 16:34:10 +0100 Message-ID: <8362ux1ybx.fsf@yahoo.it> References: <83zksdhlqg.fsf@yahoo.it> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=42308 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSAP1-0007mX-R1 for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 10:33:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSAP0-0004uk-5D for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 10:33:27 -0500 Received: from nm18-vm0.bullet.mail.ukl.yahoo.com ([217.146.183.95]:36332) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PSAOz-0004u7-OA for emacs-orgmode@gnu.org; Mon, 13 Dec 2010 10:33:26 -0500 In-Reply-To: <83zksdhlqg.fsf@yahoo.it> (Giovanni Ridolfi's message of "Fri, 10 Dec 2010 13:10:31 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Giovanni Ridolfi writes: - sorry for the double post of Friday - > Emacs : GNU Emacs 23.2.1 (i386-mingw-nt5.1.2600) > of 2010-05-08 on G41R2F1 I can confirm the bug in 7.4 commit 4760c3b9482cfeda02d24590e2fb7c70a9c1d0cd As the debug-on-error gave me not error :-(=20 I put some (debug) calls in org-capture.el: --- org-capture.el 2010-12-13 16:14:39.086099200 +0100 +++ org-capture-2.el 2010-12-13 16:14:23.443606400 +0100 @@ -1225,9 +1225,14 @@ (when plist-p (goto-char (point-min)) +;=20 + (debug) (while (re-search-forward "%\\(:[-a-zA-Z]+\\)" nil t) (unless (org-capture-escaped-%) (and (setq x (or (plist-get org-store-link-plist (intern (match-string 1))) "")) - (replace-match x t t))))) + (replace-match x t t)))) +;=20 + (debug) +) =20 ;; Turn on org-mode in temp buffer, set local variables @@ -1292,4 +1297,6 @@ ((prop (org-substring-no-properties prompt)) (pall (concat prop "_ALL")) +;=20 + (debug) (allowed (with-current-buffer @@ -1311,5 +1318,11 @@ existing nil nil "" nil "")))) - (org-set-property prop val))) + (org-set-property prop val) +;=20 + (debug) +) +;=20 + (debug) +) (char ;; These are the date/time related ones -------------------------------- And calling "my capture template", /repetita iuvant/: ------------------------ test.org FILE: ------------------ -*- mode: org; -*- (setq org-capture-templates '( ("q" "element" entry (file+headline "test.org" "capture") "*** %^{prompt} \= n :PROPERTIES:\n :ID: lab \n %^{Element}p \n %^{Number}p \n %^{Type}p \n := Feeling: %? \n :Comment: \n :END:" ) )) * capture :PROPERTIES: :Element_ALL: H He Li Na Hg :Number_ALL: 1 2 3 4 80 :Type_ALL: gas solid liquid :END: ----------------------------------- The capture process stops=20 after the insertion of the first PROPERTY with this *backtrace*: --------------------------- *backtrace* --------- Debugger entered: nil (let* ((prop ...) (pall ...) (debug) (allowed ...) (existing ...) (proppr= ompt ...) (val ...)) (org-set-property prop val) (debug)) (cond ((member char ...) (let* ... ... ...)) ((equal char "C") (cond ... = ...)) ((equal char "L") (cond ... ...)) ((equal char "p") (let* ... ... ...= ) (debug)) (char (setq org-time-was-given ...) (setq time ...) (if ... ...)= (org-insert-time-stamp time org-time-was-given ... nil nil ...)) (t (let .= .. ...))) (if (org-capture-escaped-%) nil (setq char (if ... ...) prompt (if ... ..= .)) (goto-char (match-beginning 0)) (replace-match "") (setq completions ni= l default nil) (when prompt (setq completions ... prompt ... default ... hi= stvar ... completions ...)) (unless (boundp histvar) (set histvar nil)) (co= nd (... ...) (... ...) (... ...) (... ... ...) (char ... ... ... ...) (t ..= .))) (unless (org-capture-escaped-%) (setq char (if ... ...) prompt (if ... ..= .)) (goto-char (match-beginning 0)) (replace-match "") (setq completions ni= l default nil) (when prompt (setq completions ... prompt ... default ... hi= stvar ... completions ...)) (unless (boundp histvar) (set histvar nil)) (co= nd (... ...) (... ...) (... ...) (... ... ...) (char ... ... ... ...) (t ..= .))) (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([gGtTuUCLp]\\)?" nil = t) (unless (org-capture-escaped-%) (setq char ... prompt ...) (goto-char ..= .) (replace-match "") (setq completions nil default nil) (when prompt ...) = (unless ... ...) (cond ... ... ... ... ... ...))) (save-window-excursion (delete-other-windows) (switch-to-buffer (get-buff= er-create "*Capture*")) (erase-buffer) (insert template) (goto-char (point-= min)) (org-capture-steal-local-variables buffer) (setq buffer-file-name nil= ) (goto-char (point-min)) (while (re-search-forward "%\\[\\(.+\\)\\]" nil t= ) (unless ... ...)) (goto-char (point-min)) (while (re-search-forward "%\\(= (.+)\\)" nil t) (unless ... ... ...)) (goto-char (point-min)) (while (re-se= arch-forward "%\\([tTuUaiAcxkKI]\\)" nil t) (unless ... ... ...)) (when pli= st-p (goto-char ...) (debug) (while ... ...) (debug)) (let (...) (org-mode)= ) (goto-char (point-min)) (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?= \\([gGtTuUCLp]\\)?" nil t) (unless ... ... ... ... ... ... ... ...)) (goto-= char (point-min)) (while (looking-at "[ ]*\n") (replace-match "")) (if (re= -search-forward "[ \n]*\\'" nil t) (replace-match "\n")) (untabify (point-= min) (point-max)) (set-buffer-modified-p nil) (prog1 (buffer-string) (kill-= buffer ...))) (let* ((buffer ...) (file ...) (ct ...) (dct ...) (ct1 ...) (plist-p ...)= (v-c ...) (v-x ...) (v-t ...) (v-T ...) (v-u ...) (v-U ...) (v-i ...) (v-a= ...) (v-a ...) (clipboards ...) (v-A ...) (v-n user-full-name) (v-k ...) (= v-K ...) v-I (org-startup-folded nil) (org-inhibit-startup t) org-time-was-= given org-end-time-was-given x prompt completions char time pos default his= tvar) (setq org-store-link-plist (plist-put org-store-link-plist :annotatio= n v-a) org-store-link-plist (plist-put org-store-link-plist :initial v-i)) = (setq initial v-i) (unless template (setq template "") (message "No templat= e") (ding) (sit-for 1)) (save-window-excursion (delete-other-windows) (swit= ch-to-buffer ...) (erase-buffer) (insert template) (goto-char ...) (org-cap= ture-steal-local-variables buffer) (setq buffer-file-name nil) (goto-char .= ..) (while ... ...) (goto-char ...) (while ... ...) (goto-char ...) (while = ... ...) (when plist-p ... ... ... ...) (let ... ...) (goto-char ...) (whil= e ... ...) (goto-char ...) (while ... ...) (if ... ...) (untabify ... ...) = (set-buffer-modified-p nil) (prog1 ... ...))) org-capture-fill-template() -------------------------- (org-capture-put :template (org-capture-fill-template)) ---------------- (condition-case error (org-capture-put :template (org-capture-fill-templa= te)) ((error quit) (if ... ...) (error "Capture abort: %s" error))) (cond ((equal entry "C") (customize-variable ...)) ((equal entry "q") (er= ror "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (= org-capture-put :original-buffer orig-buf :annotation annotation :initial i= nitial) (org-capture-put :default-time ...) (org-capture-set-target-locatio= n) (condition-case error ... ...) (if ... ... ... ...))) (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...)) (when (= stringp initial) (remove-text-properties 0 ... ... initial)) (when (stringp= annotation) (remove-text-properties 0 ... ... annotation)) (cond (... ...)= (... ...) (t ... ... ... ... ... ... ...))) (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...) (org= -capture-goto-last-stored)) (t (let* ... ... ... ...))) org-capture(nil) ----------- call-interactively(org-capture nil nil) recursive-edit() byte-code("\306=10 @\307=3D\203!=00\310\311\312\"\210\313\311!\211=1AA@)\= 242\314=3D\203!=00\310\315\312\"\210\316=0B!\210\317 \210\320 !\210\f\203d= =00\321ed\"=0DV\203W=00eb\210\322=0D\245y\210`=1E=1Bdb\210\322=0D\245=0DZy\= 210=0E=1B`|\210)\323c\210eb\210\324\325\326 \"\210\327\306!\210\324\330!\21= 0\331\312=1E=1C=1E=1D\324\330!\210\212\332 \210+\331\207" [unread-command-c= har debugger-args x debugger-buffer noninteractive debugger-batch-max-lines= -1 debug backtrace-debug 4 t backtrace-frame lambda 5 pop-to-buffer debugg= er-mode debugger-setup-buffer count-lines 2 "...\n" message "%s" buffer-str= ing kill-emacs "" nil recursive-edit middlestart buffer-read-only standard-= output] 4) ---------------------------------------------------- there are some "Non-printable characters" in the last line And this is capture buffer: ------------------- *Capture* - buffer----------------- *** test 4760c3b :PROPERTIES: :ID: lab=20 =20=20=20 %^{Number}p=20 %^{Type}p=20 :Feeling: %?=20 :Comment:=20=20 :Element: He :END: -------------------------------------------------------- hth with debugging cheers, Giovanni