GNU bug report logs - #7131
24.0.50; `dired' with cons arg should not ignore arg if buffer exists

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Wed, 29 Sep 2010 15:32:02 UTC

Severity: minor

Tags: easy

Merged with 27633

Found in versions 24.0.50, 26.0.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Tino Calancha <tino.calancha <at> gmail.com>
Subject: bug#27633: closed (Re: bug#7131: 24.0.50; `dired' with cons arg
 should not ignore arg if buffer exists)
Date: Fri, 21 Jul 2017 04:37:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#7131: 26.0.50; Dired doesn't update buffer when wildcards have changed

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 27633 <at> debbugs.gnu.org.

-- 
7131: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=7131
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: 7131-done <at> debbugs.gnu.org
Subject: Re: bug#7131: 24.0.50;
 `dired' with cons arg should not ignore arg if buffer exists
Date: Fri, 21 Jul 2017 13:36:34 +0900
  
>> Following that rationale, the behavior for a cons arg should be to
>> respect the explicit file list passed, not to simply ignore it and reuse
>> an existing buffer.
>>  
>> And since it would be problematic to test the file list for differences
>> from the existing listing (whether or not it came from a cons arg
>> previously), we should always just update the buffer to reflect the
>> file-list that is passed.  IOW, with an explicit file list, never reuse
>> an existing Dired buffer of the same name.
> IMO, if `dired-directory' is a cons and DIR-OR-LIST is a string then we
> must update the buffer as well: in this case, the user want to see the
> full listing of that directory.
Fixed in master branch as commit 1d559e384b467b3f74e8b78695f124b561c884d9

[Message part 3 (message/rfc822, inline)]
From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.0.50; Dired doesn't update buffer when wildcards have changed
Date: Mon, 10 Jul 2017 12:02:16 +0900
A 2nd Dired call on the same directory must update
the buffer when the wildcards have changed.

emacs -Q -l dired -eval '(dired (expand-file-name "lisp" source-directory))'
M-: (dired (list default-directory "simple.el")) RET
;; Same Dired buffer.
C-x k RET ; kill the buffer.

;; Show Dired buffer with just 'simple.el':
M-: (dired (list (expand-file-name "lisp" source-directory) "simple.el")) RET
C-x d RET ; Same Dired buffer.

--8<-----------------------------cut here---------------start------------->8---
commit 8772e1bede02b1509fccef0445238e1ec9227a53
Author: Tino Calancha <tino.calancha <at> gmail.com>
Date:   Mon Jul 10 12:00:53 2017 +0900

    Revert Dired buffer if wildcards have change
    
    A 2nd Dired call in the same directory must update
    the buffer if the wildcards have changed (Bug#27633).
    * lisp/dired.el (dired-internal-noselect):
    Revert Dired buffer if wildcards change.

diff --git a/lisp/dired.el b/lisp/dired.el
index 0c1f3e4af6..667cf7fba6 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -898,6 +898,10 @@ dired-internal-noselect
 	       (setq dired-directory dir-or-list)
 	       ;; this calls dired-revert
 	       (dired-sort-other switches))
+	      ;; wildcards have changed.
+	      ((not (equal dired-directory dir-or-list))
+	       (setq dired-directory dir-or-list)
+	       (revert-buffer))
 	      ;; Always revert regardless of whether it has changed or not.
 	      ((eq dired-auto-revert-buffer t)
 	       (revert-buffer))
--8<-----------------------------cut here---------------end--------------->8---
In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
 of 2017-07-09 built
Repository revision: 273f4bde39af5d87f10fd58f35b666dfa8a996a3



This bug report was last modified 7 years and 308 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.