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 <bzg@gnu.org> wrote:
Hi Alex,

Alex Kosorukoff <alex@3form.com> 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