From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24089: 25.1; Dired: diff error on = if the file has a backup inside .~/ Date: Thu, 28 Jul 2016 18:05:12 +0300 Message-ID: <83popxrefr.fsf@gnu.org> References: <1469644946.16323.9.camel@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1469720570 29553 80.91.229.3 (28 Jul 2016 15:42:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2016 15:42:50 +0000 (UTC) Cc: 24089@debbugs.gnu.org To: Jorge Peixoto de Morais Neto Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 28 17:42:39 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bSnSI-0000oa-G6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 17:42:38 +0200 Original-Received: from localhost ([::1]:54046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSnSH-000263-Mg for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Jul 2016 11:42:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSmt2-00013c-5L for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2016 11:06:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSmss-0007G7-La for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2016 11:06:11 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSmss-0007G2-Hj for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2016 11:06:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bSmss-0003KY-AZ for bug-gnu-emacs@gnu.org; Thu, 28 Jul 2016 11:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Jul 2016 15:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24089 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24089-submit@debbugs.gnu.org id=B24089.146971833312762 (code B ref 24089); Thu, 28 Jul 2016 15:06:02 +0000 Original-Received: (at 24089) by debbugs.gnu.org; 28 Jul 2016 15:05:33 +0000 Original-Received: from localhost ([127.0.0.1]:49398 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSmsO-0003Jm-Jo for submit@debbugs.gnu.org; Thu, 28 Jul 2016 11:05:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55971) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bSmsM-0003JX-Qn for 24089@debbugs.gnu.org; Thu, 28 Jul 2016 11:05:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSmsC-0007Bz-Qm for 24089@debbugs.gnu.org; Thu, 28 Jul 2016 11:05:25 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSmsC-0007BA-N9; Thu, 28 Jul 2016 11:05:20 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4019 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bSmsA-0004A3-Rl; Thu, 28 Jul 2016 11:05:19 -0400 In-reply-to: <1469644946.16323.9.camel@gmail.com> (message from Jorge Peixoto de Morais Neto on Wed, 27 Jul 2016 15:42:26 -0300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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: 208.118.235.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:121623 Archived-At: > From: Jorge Peixoto de Morais Neto > Date: Wed, 27 Jul 2016 15:42:26 -0300 > > Please extract the attached gzipped tarball into ~. > > Inside ~, start Emacs with an init file containing the following: > --8<---------------cut here---------------start------------->8--- > (custom-set-variables >  ;; custom-set-variables was added by Custom. >  ;; If you edit it by hand, you could mess it up, so be careful. >  ;; Your init file should contain only one such instance. >  ;; If there is more than one, they won't work right. >  '(backup-directory-alist (quote (("." . ".~")))) > ) > > (custom-set-faces >  ;; custom-set-faces was added by Custom. >  ;; If you edit it by hand, you could mess it up, so be careful. >  ;; Your init file should contain only one such instance. >  ;; If there is more than one, they won't work right. >  ) > --8<---------------cut here---------------end--------------->8--- > > Perform the following steps: > 1. C-x d ~/dired-diff-bug-1 > 2. j dummy > 3. =  > I expected (according to the documentation of dired-diff) to see the > diff of dummy with its backup.  Instead a diff error occurs.  I have > saved the diff error buffer to diff-error-dummy.txt and attached it. > > Now perform the following steps: > 1. C-x d ~/dired-diff-bug-1/.~ > 2. j dummy~ > 3. = . > A similar diff error occurs. It is also unexpected.  I have saved the > diff error buffer in diff-error-dummy~.txt and attached it. Thanks. It seems dired-diff was not prepared to deal with the situation where the backup file is in another directory. Does the patch below produce good results? --- lisp/dired-aux.el~0 2016-05-08 07:05:52.000000000 +0300 +++ lisp/dired-aux.el 2016-07-28 18:01:02.437091400 +0300 @@ -78,8 +78,14 @@ (file-at-mark (if (and transient-mark-mode mark-active) (save-excursion (goto-char (mark t)) (dired-get-filename t t)))) + (separate-dir (and oldf + (not (equal (file-name-directory oldf) + (dired-current-directory))))) (default-file (or file-at-mark - (and oldf (file-name-nondirectory oldf)))) + (and oldf + (if separate-dir + oldf + (file-name-nondirectory oldf))))) ;; Use it as default if it's not the same as the current file, ;; and the target dir is current or there is a default file. (default (if (and (not (equal default-file current)) @@ -88,7 +94,9 @@ default-file)) default-file)) (target-dir (if default - (dired-current-directory) + (if separate-dir + (file-name-directory default) + (dired-current-directory)) (dired-dwim-target-directory))) (defaults (dired-dwim-target-defaults (list current) target-dir))) (list