emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] Fix: Capture abort: (error: The mark is not set now, so


From: Alex Kosorukoff
Subject: Re: [O] [PATCH] Fix: Capture abort: (error: The mark is not set now, so there is no region)
Date: Fri, 23 May 2014 10:56:50 -0700

In fact, there is some performance issue. The steal function copies a lot of variables as I can tell. Do you know where those variables are used? I replaced the steal function with an advice like this

(defadvice org-capture-steal-local-variables (around do-not-steal activate))

My capture became very fast after that and I didn't notice any adverse effects so far (using this for more than a week). The only reason I didn't propose a patch like this is that I am still testing it for possible regressions.



On Fri, May 23, 2014 at 10:28 AM, Bastien <address@hidden> wrote:
Hi Alex,

Alex Kosorukoff <address@hidden> writes:

> 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.

I see what you mean but there is no performance issue here and not
copying the value of mark-active is cleaner than setting it back to
nil -- we never want to copy the value of the mark at all.

--
 Bastien


reply via email to

[Prev in Thread] Current Thread [Next in Thread]