From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#35385: 27.0.50; Make dired-dwim-target aware of other frames Date: Wed, 13 Nov 2019 23:41:16 +0200 Organization: LINKOV.NET Message-ID: <87h837jvyb.fsf@mail.linkov.net> References: <87k1fl3e6z.fsf@tcd.ie> <87zhj4osjw.fsf@gnus.org> <877e67x6ny.fsf@mail.linkov.net> <87impp1djl.fsf@mail.linkov.net> <138859c1-a7e0-f40d-4623-635826decd90@gmx.at> <87y2yknhja.fsf@mail.linkov.net> <875zkbrt4j.fsf@mail.linkov.net> <87zhhb1n52.fsf@web.de> <8736f29dsv.fsf@mail.linkov.net> <87y2wqrxju.fsf@web.de> <87zhh31u55.fsf@mail.linkov.net> <87mud0kcyv.fsf@mail.linkov.net> <87ftir94l8.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="263728"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: "Basil L. Contovounesios" , Lars Ingebrigtsen , 35385@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 13 22:51:59 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iV0YR-00161l-5K for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Nov 2019 22:51:59 +0100 Original-Received: from localhost ([::1]:51442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iV0YQ-0004Ic-0C for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Nov 2019 16:51:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48497) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iV0XY-0003LP-Rn for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2019 16:51:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iV0XX-0006vE-No for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2019 16:51:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iV0XW-0006uk-MB for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2019 16:51:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iV0XW-0007sm-Jn for bug-gnu-emacs@gnu.org; Wed, 13 Nov 2019 16:51:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Nov 2019 21:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 35385-submit@debbugs.gnu.org id=B35385.157368182730249 (code B ref 35385); Wed, 13 Nov 2019 21:51:02 +0000 Original-Received: (at 35385) by debbugs.gnu.org; 13 Nov 2019 21:50:27 +0000 Original-Received: from localhost ([127.0.0.1]:60280 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iV0Wx-0007ro-4d for submit@debbugs.gnu.org; Wed, 13 Nov 2019 16:50:27 -0500 Original-Received: from dog.birch.relay.mailchannels.net ([23.83.209.48]:43183) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iV0Wv-0007rh-QJ for 35385@debbugs.gnu.org; Wed, 13 Nov 2019 16:50:26 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id CE1D0340316; Wed, 13 Nov 2019 21:50:24 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a44.g.dreamhost.com (100-96-187-103.trex.outbound.svc.cluster.local [100.96.187.103]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 2860C34136F; Wed, 13 Nov 2019 21:50:24 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a44.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Wed, 13 Nov 2019 21:50:24 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Inform-Gusty: 0dbade6d5c8b2c63_1573681824428_3530575602 X-MC-Loop-Signature: 1573681824428:684902068 X-MC-Ingress-Time: 1573681824428 Original-Received: from pdx1-sub0-mail-a44.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a44.g.dreamhost.com (Postfix) with ESMTP id D869F85226; Wed, 13 Nov 2019 13:50:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=Azw2mtZo7oNZKxMLb6E3QMLAeUA=; b= uC7WElWPxvxaRaeAXfzCUpd7y6alHYuAQoIIJ9L1k2ASr1gbqoGwIgMsRydoyzv4 27MXNGNrtU/2f0BuuCzuHVWycSj5WVa7PcnxEFXDXErNcwj2STIUfG/zBP4tVfKT 1KO2goBQYilEgIO57v5wflrYR0V1lla8GZJccM76srk= Original-Received: from mail.jurta.org (m91-129-102-1.cust.tele2.ee [91.129.102.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a44.g.dreamhost.com (Postfix) with ESMTPSA id 13C6485225; Wed, 13 Nov 2019 13:50:15 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a44 In-Reply-To: <87ftir94l8.fsf@web.de> (Michael Heerdegen's message of "Wed, 13 Nov 2019 16:30:11 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:171511 Archived-At: > I think we should add that the non-nil value can be a function, and that > in this case that function will be called with zero arguments and is > expected to return a list of directories which will be used as defaults > (i.e. default target and "future history") (though, > `dired-dwim-target-defaults' might modify it a bit). > > The sentence "You can customize it to prefer either the next window with > a Dired buffer, or the most recently used window with a Dired buffer." > could get appended "or something else". Do you think this is good enough? diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi index 8fab508dea..d1863510d4 100644 --- a/doc/emacs/dired.texi +++ b/doc/emacs/dired.texi @@ -659,7 +659,10 @@ Operating on Files some window, that other buffer's directory is suggested instead. You can customize @code{dired-dwim-target} to prefer either the next window with a Dired buffer, or the most recently used window with -a Dired buffer. +a Dired buffer, or to use any other function. When the value is +a function, it will be called with no arguments and is expected to +return a list of directories which will be used as defaults +(i.e. default target and ``future history''). Here are the file-manipulating Dired commands that operate on files. diff --git a/lisp/dired.el b/lisp/dired.el index 009018fafe..15286cc9b0 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -190,7 +190,11 @@ dired-dwim-target current directory. You can customize it to prefer either the next window with a Dired buffer, -or the most recently used window with a Dired buffer. +or the most recently used window with a Dired buffer, or to use any other +function. When the value is a function, it will be called with no +arguments and is expected to return a list of directories which will +be used as defaults (i.e. default target and \"future history\") +(though, `dired-dwim-target-defaults' might modify it a bit). The target is used in the prompt for file copy, rename etc." :type '(choice