From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: whda@csua.berkeley.edu Newsgroups: gmane.emacs.devel Subject: Re: dired "dwim" mode seems to fail now Date: Sun, 19 Jun 2011 16:58:59 -0700 Message-ID: References: <010001cc29eb$fc806cb0$f5814610$@cs.ua.edu> <87vcw9ksdd.fsf@uwakimon.sk.tsukuba.ac.jp> <87hb7rlmjt.fsf@uwakimon.sk.tsukuba.ac.jp> <87boxxlpkf.fsf@uwakimon.sk.tsukuba.ac.jp> <87wrgl3cxx.fsf@fencepost.gnu.org> <861uyp4n1v.fsf_-_@red.stonehenge.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1308527961 18134 80.91.229.12 (19 Jun 2011 23:59:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 19 Jun 2011 23:59:21 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 20 01:59:17 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QYRta-0000R2-AR for ged-emacs-devel@m.gmane.org; Mon, 20 Jun 2011 01:59:14 +0200 Original-Received: from localhost ([::1]:55860 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYRtZ-00069G-8J for ged-emacs-devel@m.gmane.org; Sun, 19 Jun 2011 19:59:13 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYRtL-00069A-U3 for emacs-devel@gnu.org; Sun, 19 Jun 2011 19:59:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYRtL-0006eH-0a for emacs-devel@gnu.org; Sun, 19 Jun 2011 19:58:59 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:39409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYRtK-0006e9-Mx for emacs-devel@gnu.org; Sun, 19 Jun 2011 19:58:58 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QYRtJ-0000Me-0K for emacs-devel@gnu.org; Mon, 20 Jun 2011 01:58:57 +0200 Original-Received: from c-71-198-6-115.hsd1.ca.comcast.net ([71.198.6.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Jun 2011 01:58:56 +0200 Original-Received: from whda by c-71-198-6-115.hsd1.ca.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Jun 2011 01:58:56 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-198-6-115.hsd1.ca.comcast.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:tuqVipLTFptP4WGh/7Pp+vZde0g= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:140693 Archived-At: > Some time in the past few weeks, dired-dwim-target mode seems to have > forgotten how to work (it's not offering the directory of the other > buffer in the same window as a prefix). I haven't had a chance to > narrow the commit down, but if that rings a bell for anyone, consider > this a nudge. I didn't look at commits, but it seems `dired-dwim-target-directory' calls `get-window-with-predicate' in such a way that the first window returned is possibly the current window itself. It seems the (unspecified?) order in which `get-window-with-predicate' tests windows may have changed. I think the solution is to exclude from consideration dired buffers that have the same current directory as the current window. This seems most consistent with the current (23.2) stable emacs. The real problem might be with window.el though. dired-aux.el hasn't changed recently. Patch: === modified file 'lisp/dired-aux.el' *** lisp/dired-aux.el 2011-05-21 02:07:25 +0000 --- lisp/dired-aux.el 2011-06-19 23:33:36 +0000 *************** Optional arg HOW-TO determiness how to t *** 1583,1589 **** (let* ((other-win (get-window-with-predicate (lambda (window) (with-current-buffer (window-buffer window) ! (eq major-mode 'dired-mode))))) (other-dir (and other-win (with-current-buffer (window-buffer other-win) (and (eq major-mode 'dired-mode) --- 1583,1591 ---- (let* ((other-win (get-window-with-predicate (lambda (window) (with-current-buffer (window-buffer window) ! (and (eq major-mode 'dired-mode) ! (not (eq (dired-current-directory) ! this-dir))))))) (other-dir (and other-win (with-current-buffer (window-buffer other-win) (and (eq major-mode 'dired-mode)