From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Witte Subject: Subtle bug with capture and refile Date: Thu, 21 Oct 2010 14:27:02 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1940123347==" Return-path: Received: from [140.186.70.92] (port=47500 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8uEc-0000dO-5A for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 08:27:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8uEa-0001ss-N0 for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 08:27:06 -0400 Received: from mail-yx0-f169.google.com ([209.85.213.169]:41205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8uEa-0001sb-JG for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 08:27:04 -0400 Received: by yxm34 with SMTP id 34so3000030yxm.0 for ; Thu, 21 Oct 2010 05:27:03 -0700 (PDT) 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: Org Mode --===============1940123347== Content-Type: multipart/alternative; boundary=00151750edbeaa4d0f04931fa442 --00151750edbeaa4d0f04931fa442 Content-Type: text/plain; charset=ISO-8859-1 The new org capture has been working great but I have just come across a subtle bug that has taken me a while to reliably reproduce. I have org set up to add TODO captures to the top of my organiser.org file. If you try and refile the capture TODO and the cursor is at the bottom of the capture buffer, it will refile the next item in organiser.org and not the capture TODO. Hmm, that doesn't sound too clear, let me try and give an example. My organiser.org looks like this: -----organiser.org----- * Home ** Home item 1 ** Home item 2 * Work ** Work item 1 I then make a capture TODO -----capture buffer----- * TODO report capture buffer bug ! with the cursor indicated by ! I press C-c C-w and refile to work. Instead of the capture note being refiled, Home get refiled so I end up with organiser.org looking like: -----organiser.org----- *TODO report capture buffer bug * Work ** Home *** Home item 1 *** Home item 2 ** Work item 1 if instead the cursor is on the TODO line when I refile, everything works as expect and I end up with: -----organiser.org----- * Home ** Home item 1 ** Home item 2 * Work ** TODO report capture buffer bug ** Work item 1 This has been causing me problems for a while now, but I could never work out why this only happened some of the time. I hope that explains the problem with sufficient clarity, let me know if it doesn't. Cheers Chris Witte. --00151750edbeaa4d0f04931fa442 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The new org capture has been working great but I have just come across a su= btle bug that has taken me a while to reliably reproduce.=A0 I have org set= up to add TODO captures to the top of my = organiser.org file.=A0 If you try and refile the capture TODO and the c= ursor is at the bottom of the capture buffer, it will refile the next item = in organiser.org and not the capture T= ODO.=A0 Hmm, that doesn't sound too clear, let me try and give an examp= le.=A0 My organiser.org looks like thi= s:

-----organiser.org-----
* Home
** Home item 1
** Home item 2* Work
** Work item 1

=A0
I then make a capture TODO
-----capture buffer-----
* TODO report capture buffer bug
!

with the cursor indicated by ! I press C-c C-w and refile to work.=A0 Inste= ad of the capture note being refiled, Home get refiled so I end up with organiser.org looking like:

-----o= rganiser.org-----
*TODO report capture buffer bug
* Work
** Home
*** Home item 1
*** Home item 2
** Work item 1

if instead the cursor is on the TODO line when I refile, everything wor= ks as expect and I end up with:

-----organiser.org-----
* Home
** Home item 1
** Home item 2
* Work
** TODO report capture buffer bug
** Work item 1

This has been causing me problems for a while now, but I could never wo= rk out why this only happened some of the time.=A0 I hope that explains the= problem with sufficient clarity, let me know if it doesn't.

Cheers
Chris Witte.
--00151750edbeaa4d0f04931fa442-- --===============1940123347== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1940123347==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Rakestraw Subject: Re: Subtle bug with capture and refile Date: Thu, 21 Oct 2010 12:05:07 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=57688 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8xck-0001aC-9T for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 12:04:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8xci-000873-Ma for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 12:04:14 -0400 Received: from uis-ipmx-2.pdc.uis.georgetown.edu ([141.161.2.141]:24977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8xci-00086s-Io for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 12:04:12 -0400 In-Reply-To: (Christopher Witte's message of "Thu, 21 Oct 2010 14:27:02 +0200") 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: Christopher Witte Cc: Org Mode Hi, list -- On Thu, 21 Oct 2010, Christopher Witte wrote: > The new org capture has been working great but I have just come across a > subtle bug that has taken me a while to reliably reproduce. I have org set > up to add TODO captures to the top of my organiser.org file. If you try and > refile the capture TODO and the cursor is at the bottom of the capture > buffer, it will refile the next item in organiser.org and not the capture > TODO. Two points -- - First, thanks to Christopher for diagnosing this bug, which has been biting me, but only occasionally (and now I see why) - Second, to add the additional data point that if I'm trying to refile to the item following the point where the new captures are added, I get the error message "Cannot refile to position inside the tree or region." Thanks -- -- John Rakestraw From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Subtle bug with capture and refile Date: Thu, 21 Oct 2010 19:38:20 +0200 Message-ID: References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=41650 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8z66-0001Kg-0l for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 13:38:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8z5x-00066O-7n for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 13:38:30 -0400 Received: from mail-ew0-f41.google.com ([209.85.215.41]:49350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8z5x-00062Q-1t for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 13:38:29 -0400 Received: by mail-ew0-f41.google.com with SMTP id 25so348557ewy.0 for ; Thu, 21 Oct 2010 10:38:28 -0700 (PDT) In-Reply-To: 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: Christopher Witte Cc: Org Mode Hi Christopher, thank you for taking the time to isolate this bug. Could you please try the following patch? Thanks. - Carsten Modified lisp/org-capture.el diff --git a/lisp/org-capture.el b/lisp/org-capture.el index 7915f7f..537f1a4 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -548,6 +548,7 @@ already gone." (unless (eq (org-capture-get :type 'local) 'entry) (error "Refiling from a capture buffer makes only sense for `entry'- type templates")) + (if (and (bolp) (eobp)) (backward-char 1)) (let ((pos (point)) (base (buffer-base-buffer (current-buffer))) (org-refile-for-capture t)) On Oct 21, 2010, at 2:27 PM, Christopher Witte wrote: > The new org capture has been working great but I have just come > across a subtle bug that has taken me a while to reliably > reproduce. I have org set up to add TODO captures to the top of my > organiser.org file. If you try and refile the capture TODO and the > cursor is at the bottom of the capture buffer, it will refile the > next item in organiser.org and not the capture TODO. Hmm, that > doesn't sound too clear, let me try and give an example. My > organiser.org looks like this: > > -----organiser.org----- > * Home > ** Home item 1 > ** Home item 2 > * Work > ** Work item 1 > > > I then make a capture TODO > > -----capture buffer----- > * TODO report capture buffer bug > ! > > with the cursor indicated by ! I press C-c C-w and refile to work. > Instead of the capture note being refiled, Home get refiled so I end > up with organiser.org looking like: > > -----organiser.org----- > *TODO report capture buffer bug > * Work > ** Home > *** Home item 1 > *** Home item 2 > ** Work item 1 > > if instead the cursor is on the TODO line when I refile, everything > works as expect and I end up with: > > -----organiser.org----- > * Home > ** Home item 1 > ** Home item 2 > * Work > ** TODO report capture buffer bug > ** Work item 1 > > This has been causing me problems for a while now, but I could never > work out why this only happened some of the time. I hope that > explains the problem with sufficient clarity, let me know if it > doesn't. > > Cheers > Chris Witte. > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Rakestraw Subject: Re: Subtle bug with capture and refile Date: Thu, 21 Oct 2010 14:29:51 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=49517 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8zso-00085W-92 for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 14:28:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8zsm-0002rm-JY for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 14:28:58 -0400 Received: from uis-ipmx-2.pdc.uis.georgetown.edu ([141.161.2.141]:12846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8zsm-0002rc-Hb for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 14:28:56 -0400 In-Reply-To: (Carsten Dominik's message of "Thu, 21 Oct 2010 19:38:20 +0200") 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: Carsten Dominik Cc: emacs-orgmode Hi, Carsten -- On Thu, 21 Oct 2010, Carsten Dominik wrote: > Hi Christopher, > > thank you for taking the time to isolate this bug. Could > you please try the following patch? > Your patch seems to fix the problem. Thanks -- John > Thanks. > > - Carsten > > Modified lisp/org-capture.el > diff --git a/lisp/org-capture.el b/lisp/org-capture.el > index 7915f7f..537f1a4 100644 > --- a/lisp/org-capture.el > +++ b/lisp/org-capture.el > @@ -548,6 +548,7 @@ already gone." > (unless (eq (org-capture-get :type 'local) 'entry) > (error > "Refiling from a capture buffer makes only sense for `entry'- > type templates")) > + (if (and (bolp) (eobp)) (backward-char 1)) > (let ((pos (point)) > (base (buffer-base-buffer (current-buffer))) > (org-refile-for-capture t)) > -- John Rakestraw From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Subtle bug with capture and refile Date: Thu, 21 Oct 2010 22:27:08 +0200 Message-ID: <4E22A80F-74F6-409F-8BEA-282933F223D0@gmail.com> References: Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=34383 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P91jD-0001sV-Hd for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 16:27:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P91jC-00040U-CJ for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 16:27:11 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:48676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P91jC-00040P-6c for emacs-orgmode@gnu.org; Thu, 21 Oct 2010 16:27:10 -0400 Received: by eydd26 with SMTP id d26so4568eyd.0 for ; Thu, 21 Oct 2010 13:27:09 -0700 (PDT) In-Reply-To: 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: John Rakestraw Cc: emacs-orgmode Thanks for doing the testing. - Carsten On Oct 21, 2010, at 8:29 PM, John Rakestraw wrote: > Hi, Carsten -- > > On Thu, 21 Oct 2010, Carsten Dominik wrote: >> Hi Christopher, >> >> thank you for taking the time to isolate this bug. Could >> you please try the following patch? >> > > Your patch seems to fix the problem. > > Thanks -- > > John > >> Thanks. >> >> - Carsten >> >> Modified lisp/org-capture.el >> diff --git a/lisp/org-capture.el b/lisp/org-capture.el >> index 7915f7f..537f1a4 100644 >> --- a/lisp/org-capture.el >> +++ b/lisp/org-capture.el >> @@ -548,6 +548,7 @@ already gone." >> (unless (eq (org-capture-get :type 'local) 'entry) >> (error >> "Refiling from a capture buffer makes only sense for `entry'- >> type templates")) >> + (if (and (bolp) (eobp)) (backward-char 1)) >> (let ((pos (point)) >> (base (buffer-base-buffer (current-buffer))) >> (org-refile-for-capture t)) >> > > -- > John Rakestraw From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Witte Subject: Re: Subtle bug with capture and refile Date: Fri, 22 Oct 2010 16:13:01 +0200 Message-ID: References: <4E22A80F-74F6-409F-8BEA-282933F223D0@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1770626428==" Return-path: Received: from [140.186.70.92] (port=56103 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9IMh-0000IC-Up for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 10:13:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9IMg-0003zJ-RR for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 10:13:03 -0400 Received: from mail-gw0-f41.google.com ([74.125.83.41]:42335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9IMg-0003yt-N9 for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 10:13:02 -0400 Received: by gwb19 with SMTP id 19so820098gwb.0 for ; Fri, 22 Oct 2010 07:13:01 -0700 (PDT) In-Reply-To: <4E22A80F-74F6-409F-8BEA-282933F223D0@gmail.com> 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: Carsten Dominik Cc: emacs-orgmode --===============1770626428== Content-Type: multipart/alternative; boundary=000e0cd298d27fc4dd0493353dba --000e0cd298d27fc4dd0493353dba Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Work for me too, thanks for the quick fix! Cheers Chris. On 21 October 2010 22:27, Carsten Dominik wrote= : > Thanks for doing the testing. > > - Carsten > > > On Oct 21, 2010, at 8:29 PM, John Rakestraw wrote: > > Hi, Carsten -- >> >> On Thu, 21 Oct 2010, Carsten Dominik wrote: >> >>> Hi Christopher, >>> >>> thank you for taking the time to isolate this bug. Could >>> you please try the following patch? >>> >>> >> Your patch seems to fix the problem. >> >> Thanks -- >> >> John >> >> Thanks. >>> >>> - Carsten >>> >>> Modified lisp/org-capture.el >>> diff --git a/lisp/org-capture.el b/lisp/org-capture.el >>> index 7915f7f..537f1a4 100644 >>> --- a/lisp/org-capture.el >>> +++ b/lisp/org-capture.el >>> @@ -548,6 +548,7 @@ already gone." >>> (unless (eq (org-capture-get :type 'local) 'entry) >>> (error >>> "Refiling from a capture buffer makes only sense for `entry'- >>> type templates")) >>> + (if (and (bolp) (eobp)) (backward-char 1)) >>> (let ((pos (point)) >>> (base (buffer-base-buffer (current-buffer))) >>> (org-refile-for-capture t)) >>> >>> >> -- >> John Rakestraw >> > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > --=20 Postdoctoral Research Fellow Molecular Imaging Group Leibniz-Institut f=FCr Molekulare Pharmakologie (FMP) Campus Berlin-Buch Robert-Roessle-Str. 10 13125 Berlin, Germany Phone: 00493094793-279 --000e0cd298d27fc4dd0493353dba Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Work for me too, thanks for the quick fix!

Cheers
Chris.

<= div class=3D"gmail_quote">On 21 October 2010 22:27, Carsten Dominik <carsten.dominik= @gmail.com> wrote:
Thanks for doing = the testing.

- Carsten


On Oct 21, 2010, at 8:29 PM, John Rakestraw wrote:

Hi, Carsten --

On Thu, 21 Oct 2010, Carsten Dominik wrote:
Hi Christopher,

thank you for taking the time to isolate this bug. =A0Could
you please try the following patch?


Your patch seems to fix the problem.

Thanks --

John

Thanks.

- Carsten

=A0 =A0 =A0 =A0Modified lisp/org-capture.el
diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 7915f7f..537f1a4 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -548,6 +548,7 @@ already gone."
=A0(unless (eq (org-capture-get :type 'local) 'entry)
=A0 (error
=A0 =A0"Refiling from a capture buffer makes only sense for `entry= 9;-
type templates"))
+ =A0(if (and (bolp) (eobp)) (backward-char 1))
=A0(let ((pos (point))
=A0 =A0 =A0 =A0(base (buffer-base-buffer (current-buffer)))
=A0 =A0 =A0 =A0(org-refile-for-capture t))


--
John Rakestraw


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gn= u.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode



--
Postdoctoral Researc= h Fellow
Molecular Imaging Group
Leibniz-Ins= titut f=FCr Molekulare Pharmakologie (FMP)
Campus Berlin-Buch
Robert-Roessle-Str. 1013125 Berlin, Germany
= Phone: 00493094793-279

--000e0cd298d27fc4dd0493353dba-- --===============1770626428== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1770626428==--