all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to make a thread version of dired-do-copy
@ 2018-06-10  8:07 Shuguang Sun
  2018-06-10 15:13 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Shuguang Sun @ 2018-06-10  8:07 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

I try to make a thread version of dired-do-copy as below

(defun foo-dired-do-copy ()
  (interactive)
  (make-thread #'dired-do-copy))

However, it doesn't works very well:
1. if ido-everywhere is t, then I can't input the target directory with
error
funcall-interactively: Symbol's value as variable is void: ido-require-match
funcall-interactively: Symbol's value as variable is void: ido-cur-item
funcall-interactively: Symbol's value as variable is void:
ido-pre-merge-state [3 times]

2. if disable ido-everywhere, it raised a GUI window (in Windows 7) to ask
the target directory instead of the minibuffer. How could I still use the
minibuffer to input the targe directory?


GNU Emacs 27.0.50 (build 2, x86_64-w64-mingw32) of 2018-06-04
Windows 7

Best Regards,
Shuguang


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

* Re: How to make a thread version of dired-do-copy
  2018-06-10  8:07 How to make a thread version of dired-do-copy Shuguang Sun
@ 2018-06-10 15:13 ` Eli Zaretskii
  0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2018-06-10 15:13 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Shuguang Sun <shuguang@gmail.com>
> Date: Sun, 10 Jun 2018 16:07:50 +0800
> 
> I try to make a thread version of dired-do-copy as below
> 
> (defun foo-dired-do-copy ()
>   (interactive)
>   (make-thread #'dired-do-copy))

It makes little sense to run dired-do-copy in a separate thread,
because the primitive functions it invokes don't run asynchronously,
and therefore the new thread will not yield to the main thread.  The
result will be that the main thread will be suspended for the entire
time dired-do-copy runs, I think.  Which is not what you want.

> 2. if disable ido-everywhere, it raised a GUI window (in Windows 7) to ask
> the target directory instead of the minibuffer. How could I still use the
> minibuffer to input the targe directory?

Ask the user for the directory before starting the thread, then wrap
dired-do-copy in a function which fetches the directory input by the
user from some variable.



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

* Re: How to make a thread version of dired-do-copy
@ 2018-06-11  8:50 Shuguang Sun
  0 siblings, 0 replies; 3+ messages in thread
From: Shuguang Sun @ 2018-06-11  8:50 UTC (permalink / raw)
  To: eliz; +Cc: help-gnu-emacs

Got it. Thanks.


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

end of thread, other threads:[~2018-06-11  8:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-10  8:07 How to make a thread version of dired-do-copy Shuguang Sun
2018-06-10 15:13 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2018-06-11  8:50 Shuguang Sun

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.