From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kosorukoff Subject: Re: [PATCH] Fix: Capture abort: (error: The mark is not set now, so there is no region) Date: Fri, 23 May 2014 09:37:48 -0700 Message-ID: References: <877g681jma.fsf@bzg.ath.cx> <87zji88vye.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1133c6cec09ff904fa13dad0 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49429) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnsTz-0005c5-Hs for emacs-orgmode@gnu.org; Fri, 23 May 2014 12:38:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnsTx-0001p4-0x for emacs-orgmode@gnu.org; Fri, 23 May 2014 12:38:11 -0400 In-Reply-To: <87zji88vye.fsf@bzg.ath.cx> 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: Bastien Cc: emacs-orgmode@gnu.org --001a1133c6cec09ff904fa13dad0 Content-Type: text/plain; charset=UTF-8 On Fri, May 23, 2014 at 5:03 AM, Bastien wrote: > Hi Alex, > > Alex Kosorukoff writes: > > > After I replaced my patch and merged Bastien's fix, I started seeing > > the error though less frequently than before. It didn't occur in the > > template I posted, but I started seeing it again in another template. > > > > ("w" "org-protocol tag" entry (file "~/org/bookmarks.org") > > "* %:description %(org-set-tags)\n %i\n\n %:link\n%? > > " > > :prepend t :empty-lines-after 1 :clock-in t > > :clock-resume t) > > If I may ask, why using %(org-set-tags) instead of %^g or %^G? > I am using org-set-tags to avoid autocompletion, both %^g and %^G take too much time because my org files have many tagged items. Capture should be fast to be effective. > I switched back to my initial patch that was checking if the mark was > > set before trying to access the region. This worked: the errors > > disappeared. > > I think the right fix is to exclude `mark-active' from the local > variable that are imported through `org-capture-steal-local-variables'. > I installed such a fix in maint, please update Org and let me know if > this works for you. > Excluding mark-active will work, the result will be the same as after my patch, except performance will not be the same. Excluding variable requires filtering the list of variables which takes O(n) whereas my patch takes O(1). Mark-active is nil before org-capture-steal-local-variables because this is a new buffer. It seems in this case setting it back to nil is faster than trying to preserve its original value nil. > Thanks, > > -- > Bastien > --001a1133c6cec09ff904fa13dad0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Fri, May 23, 2014 at 5:03 AM, Bastien <bzg@gnu.org> wrote:
Hi Alex,

Alex Kosorukoff <alex@3form.com>= ; writes:

> After I replaced my patch and merged Bastien'= ;s fix, I started seeing
> the error though less frequently than before. It didn't occur in t= he
> template I posted, but I started seeing it again in another template.<= br> >
> ("w" "org-protocol tag" entry (file "~/org/bookmarks.org") > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"* %:descr= iption %(org-set-tags)\n =C2=A0%i\n\n =C2=A0%:link\n%?
> "
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0:prepend t :emp= ty-lines-after 1 :clock-in t
> :clock-resume t)

If I may ask, why using %(org-set-tags) instead of %^g or %^G?

I am using org-set-tags to avoid autocompleti= on, both %^g and %^G take too much time because my org files have many tagg= ed items. Capture should be fast to be effective.

> I switched back to my initial patch that was checking = if the mark was
> set before trying to access the region. This worked: the errors
> disappeared.

I think the right fix is to exclude `mark-active' from the local<= br> variable that are imported through `org-capture-steal-local-variables'.=
I installed such a fix in maint, please update Org and let me know if
this works for you.

Excluding mark-acti= ve will work, the result will be the same as after my patch, except perform= ance will not be the same. Excluding variable requires filtering the list o= f variables which takes O(n) whereas my patch takes O(1). Mark-active is ni= l before org-capture-steal-local-variables because this is a new buffer. It= seems in this case setting it back to nil is faster than trying to preserv= e its original value nil.


Thanks,

--
=C2=A0Bastien

--001a1133c6cec09ff904fa13dad0--