emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* long delay after selecting capture template
@ 2016-03-17 17:10 Allan Streib
  2016-03-17 23:53 ` Eric Abrahamsen
  0 siblings, 1 reply; 8+ messages in thread
From: Allan Streib @ 2016-03-17 17:10 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

When I want to capture a task I hit C-c c and then t to select the task
template.

Between striking the t key and seeing the template rendered, there is a
delay of several seconds (sometimes up to 10 seconds). No errors are
logged and the template eventually displays and everything is normal.

As the whole point of capturing is to quickly log task items and get
back to the primary work at hand, this delay can be annoying. Any
suggestions at where to look to resolve this?

GNU Emacs 24.5.1 (x86_64-unknown-openbsd, X toolkit, Xaw3d scroll bars) of 2015-10-19

Org-mode version 8.2.10 (release_8.2.10 @ /usr/local/share/emacs/24.5/lisp/org/)  

Thanks,

Allan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: long delay after selecting capture template
  2016-03-17 17:10 long delay after selecting capture template Allan Streib
@ 2016-03-17 23:53 ` Eric Abrahamsen
  2016-03-18 18:09   ` Allan Streib
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2016-03-17 23:53 UTC (permalink / raw)
  To: emacs-orgmode

Allan Streib <astreib@indiana.edu> writes:

> Hi,
>
> When I want to capture a task I hit C-c c and then t to select the task
> template.
>
> Between striking the t key and seeing the template rendered, there is a
> delay of several seconds (sometimes up to 10 seconds). No errors are
> logged and the template eventually displays and everything is normal.
>
> As the whole point of capturing is to quickly log task items and get
> back to the primary work at hand, this delay can be annoying. Any
> suggestions at where to look to resolve this?

I guess I would `toggle-debug-on-quit', then call capture, and while
you're waiting for it to return, hit "C-g". That ought to pop up a
backtrace, and you can see what code was being executed during the
delay. It might be obvious what's wrong, or you can post the backtrace
here.

Yours,
Eric

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: long delay after selecting capture template
  2016-03-17 23:53 ` Eric Abrahamsen
@ 2016-03-18 18:09   ` Allan Streib
  2016-03-19 13:38     ` Eric Abrahamsen
  0 siblings, 1 reply; 8+ messages in thread
From: Allan Streib @ 2016-03-18 18:09 UTC (permalink / raw)
  To: emacs-orgmode

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I guess I would `toggle-debug-on-quit', then call capture, and while
> you're waiting for it to return, hit "C-g". That ought to pop up a
> backtrace, and you can see what code was being executed during the
> delay. It might be obvious what's wrong, or you can post the backtrace
> here.

I tried this but get no backtrace. Messages buffer contains:


Debug on Quit enabled globally
Template key: 
byte-code: Capture abort: (quit)


At the "Template key:" prompt, I had typed t, then C-g

Allan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: long delay after selecting capture template
  2016-03-18 18:09   ` Allan Streib
@ 2016-03-19 13:38     ` Eric Abrahamsen
  2016-03-24 13:27       ` Allan Streib
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Abrahamsen @ 2016-03-19 13:38 UTC (permalink / raw)
  To: emacs-orgmode

Allan Streib <astreib@indiana.edu> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> I guess I would `toggle-debug-on-quit', then call capture, and while
>> you're waiting for it to return, hit "C-g". That ought to pop up a
>> backtrace, and you can see what code was being executed during the
>> delay. It might be obvious what's wrong, or you can post the backtrace
>> here.
>
> I tried this but get no backtrace. Messages buffer contains:
>
>
> Debug on Quit enabled globally
> Template key: 
> byte-code: Capture abort: (quit)

Ah, the org-capture code condition-cases quit. At least we know that the
problem is in `org-capture-fill-template'!

I can't remember off the top of my head if there's a way to tell emacs
to actually debug on quit, even if quit is handled by `condition-case'.

Another thing you can try is edebugging `org-capture-fill-template' and
stepping through it, and just see if anything weird happens. See the
Elisp manual for how to edebug, if you haven't before.

Does it only happen for the "t" template? What's the "t" template look
like?

Eric

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: long delay after selecting capture template
  2016-03-19 13:38     ` Eric Abrahamsen
@ 2016-03-24 13:27       ` Allan Streib
  2016-03-24 13:40         ` Eric Abrahamsen
  2016-03-24 14:07         ` Eric S Fraga
  0 siblings, 2 replies; 8+ messages in thread
From: Allan Streib @ 2016-03-24 13:27 UTC (permalink / raw)
  To: Eric Abrahamsen, emacs-orgmode

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Another thing you can try is edebugging `org-capture-fill-template' and
> stepping through it, and just see if anything weird happens. See the
> Elisp manual for how to edebug, if you haven't before.
>
> Does it only happen for the "t" template? What's the "t" template look
> like?

I've really just started with org mode and task capture; so far I've
only used the default "todo" (t) template.

Debugging the function, the "stall" happens on the indicated line below,
the call to org-get-x-clipboard with the value 'SECONDARY

     [...]
     
	 ;; Is the link empty?  Then we do not want it...
	 (v-a (if (equal v-a "[[]]") "" v-a))
	 (clipboards (remove nil (list v-i
				       (org-get-x-clipboard 'PRIMARY)
				       (org-get-x-clipboard 'CLIPBOARD)
				 >>>   (org-get-x-clipboard 'SECONDARY)  <<<
				       v-c)))

     [...]

I've heard of primary and clipboard X11 selections, but not secondary. I
found a web post[1] suggesting it's a "near-extinct" feature.

If I comment out that line the delay vanishes.


Footnotes: 
[1]  https://sjohannes.wordpress.com/2010/02/28/what-is-the-x11-secondary-selection/

Allan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: long delay after selecting capture template
  2016-03-24 13:27       ` Allan Streib
@ 2016-03-24 13:40         ` Eric Abrahamsen
  2016-03-24 14:07         ` Eric S Fraga
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Abrahamsen @ 2016-03-24 13:40 UTC (permalink / raw)
  To: emacs-orgmode

Allan Streib <astreib@indiana.edu> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Another thing you can try is edebugging `org-capture-fill-template' and
>> stepping through it, and just see if anything weird happens. See the
>> Elisp manual for how to edebug, if you haven't before.
>>
>> Does it only happen for the "t" template? What's the "t" template look
>> like?
>
> I've really just started with org mode and task capture; so far I've
> only used the default "todo" (t) template.
>
> Debugging the function, the "stall" happens on the indicated line below,
> the call to org-get-x-clipboard with the value 'SECONDARY
>
>      [...]
>      
> 	 ;; Is the link empty?  Then we do not want it...
> 	 (v-a (if (equal v-a "[[]]") "" v-a))
> 	 (clipboards (remove nil (list v-i
> 				       (org-get-x-clipboard 'PRIMARY)
> 				       (org-get-x-clipboard 'CLIPBOARD)
> 				 >>>   (org-get-x-clipboard 'SECONDARY)  <<<
> 				       v-c)))
>
>      [...]
>
> I've heard of primary and clipboard X11 selections, but not secondary. I
> found a web post[1] suggesting it's a "near-extinct" feature.
>
> If I comment out that line the delay vanishes.

Well that's some fairly successful sleuthing. The bad news is you know
now as much as (or more than) I do about your problem, and I don't know
what to tell you from here. I'd say tell the list what system you're
using, and what desktop environment, and hope someone has some wisdom to
bestow.

Otherwise... just comment that line out.

E

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: long delay after selecting capture template
  2016-03-24 13:27       ` Allan Streib
  2016-03-24 13:40         ` Eric Abrahamsen
@ 2016-03-24 14:07         ` Eric S Fraga
  2016-03-24 14:36           ` Allan Streib
  1 sibling, 1 reply; 8+ messages in thread
From: Eric S Fraga @ 2016-03-24 14:07 UTC (permalink / raw)
  To: Allan Streib; +Cc: emacs-orgmode

On Thursday, 24 Mar 2016 at 09:27, Allan Streib wrote:

[...]

> Debugging the function, the "stall" happens on the indicated line below,
> the call to org-get-x-clipboard with the value 'SECONDARY

[...]

> I've heard of primary and clipboard X11 selections, but not secondary. I
> found a web post[1] suggesting it's a "near-extinct" feature.
>
> If I comment out that line the delay vanishes.

I've had this problem in the past. I found that setting this variable helps:

,----[ C-h v x-selection-timeout RET ]
| x-selection-timeout is a variable defined in ‘C source code’.
| Its value is 10
| 
| Documentation:
| Number of milliseconds to wait for a selection reply.
| If the selection owner doesn’t reply in this time, we give up.
| A value of 0 means wait as long as necessary.  This is initialized from the
| "*selectionTimeout" resource.
`----

For me, a value of 10 works well in most cases.  Sometimes this means
that the selection from another application (e.g. the browser) is not
found but at least it doesn't stall.

HTH,
eric

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-668-g809a83

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: long delay after selecting capture template
  2016-03-24 14:07         ` Eric S Fraga
@ 2016-03-24 14:36           ` Allan Streib
  0 siblings, 0 replies; 8+ messages in thread
From: Allan Streib @ 2016-03-24 14:36 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> I've had this problem in the past. I found that setting this variable helps:
>
> ,----[ C-h v x-selection-timeout RET ]
> | x-selection-timeout is a variable defined in ‘C source code’.
> | Its value is 10
> | 
> | Documentation:
> | Number of milliseconds to wait for a selection reply.
> | If the selection owner doesn’t reply in this time, we give up.
> | A value of 0 means wait as long as necessary.  This is initialized from the
> | "*selectionTimeout" resource.
> `----
>
> For me, a value of 10 works well in most cases.  Sometimes this means
> that the selection from another application (e.g. the browser) is not
> found but at least it doesn't stall.

Thanks, mine was set to 5000. Seems like I've seen it stall for longer
than 5 seconds, but perhaps in those cases one of the primary or
clipboard selections timed out as well.

I'm on OpenBSD by the way.

-- 
Allan Streib
Indiana University School of Informatics and Computing
Digital Science Center :: Community Grids Lab :: FutureSystems

Allan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-24 14:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-17 17:10 long delay after selecting capture template Allan Streib
2016-03-17 23:53 ` Eric Abrahamsen
2016-03-18 18:09   ` Allan Streib
2016-03-19 13:38     ` Eric Abrahamsen
2016-03-24 13:27       ` Allan Streib
2016-03-24 13:40         ` Eric Abrahamsen
2016-03-24 14:07         ` Eric S Fraga
2016-03-24 14:36           ` Allan Streib

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).