From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: How to make a thread version of dired-do-copy Date: Sun, 10 Jun 2018 18:13:41 +0300 Message-ID: <83602qsmhm.fsf@gnu.org> References: NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1528643520 26059 195.159.176.226 (10 Jun 2018 15:12:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Jun 2018 15:12:00 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 10 17:11:56 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fS20a-0006gv-1O for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Jun 2018 17:11:56 +0200 Original-Received: from localhost ([::1]:44379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS22h-0008BG-4f for geh-help-gnu-emacs@m.gmane.org; Sun, 10 Jun 2018 11:14:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS22F-0008B1-NH for help-gnu-emacs@gnu.org; Sun, 10 Jun 2018 11:13:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fS22C-0001lJ-IS for help-gnu-emacs@gnu.org; Sun, 10 Jun 2018 11:13:39 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fS22C-0001lC-En for help-gnu-emacs@gnu.org; Sun, 10 Jun 2018 11:13:36 -0400 Original-Received: from [176.228.60.248] (port=4384 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fS22B-0000Vb-Js for help-gnu-emacs@gnu.org; Sun, 10 Jun 2018 11:13:36 -0400 In-reply-to: (message from Shuguang Sun on Sun, 10 Jun 2018 16:07:50 +0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117085 Archived-At: > From: Shuguang Sun > 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.