From unknown Sat Jun 21 03:25:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7131: 24.0.50; `dired' with cons arg should not ignore arg if buffer exists Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Sep 2010 15:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 7131 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 7131@debbugs.gnu.org X-Debbugs-Original-To: Received: via spool by submit@debbugs.gnu.org id=B.128577430121651 (code B ref -1); Wed, 29 Sep 2010 15:32:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Sep 2010 15:31:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0ydA-0005dA-DF for submit@debbugs.gnu.org; Wed, 29 Sep 2010 11:31:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0yd7-0005d3-Oc for submit@debbugs.gnu.org; Wed, 29 Sep 2010 11:31:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0yfu-0005ks-1Z for submit@debbugs.gnu.org; Wed, 29 Sep 2010 11:34:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:40378) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0yft-0005ko-TR for submit@debbugs.gnu.org; Wed, 29 Sep 2010 11:34:30 -0400 Received: from [140.186.70.92] (port=41661 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0yfs-0001bj-OV for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2010 11:34:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0yfr-0005kQ-9A for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2010 11:34:28 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:45692) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0yfr-0005kH-26 for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2010 11:34:27 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8TFYO5p003193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Sep 2010 15:34:25 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8TBPp2o006956 for ; Wed, 29 Sep 2010 15:34:24 GMT Received: from abhmt003.oracle.com by acsmt354.oracle.com with ESMTP id 641193851285774458; Wed, 29 Sep 2010 08:34:18 -0700 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 29 Sep 2010 08:34:17 -0700 From: "Drew Adams" Date: Wed, 29 Sep 2010 08:34:17 -0700 Message-ID: <9165B8BF5E624AAA8F9551E7A82022AF@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Actf68cKnNMtyb09T/eNiFgFGZoP/A== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) (dired '("foo" "file1.c" "file2.c")) opens a Dired buffer named `foo' with only files file1.c and file2.c. This is a useful feature. The doc says only that if the arg is a cons then its first element is taken as the directory name and the rest are the files to list. But if "foo" is already the name of an existing Dired buffer then that existing buffer `foo' is simply displayed as it was. The explicit file-list argument is completely ignored. Buffer `foo' should instead be updated (its contents replaced) to list only the files to be included (files in the file-list arg). That is more useful, and it is anyway easy to recuperate the original Dired buffer if for some reason the buffer name were a mistake. The code in question is `dired-internal-noselect'. This code comment gives the behavior rationale for the case where the Dired buffer already exists: ;; If there is an existing dired buffer for DIRNAME, just leave ;; buffer as it is (don't even call dired-revert). ;; This saves time especially for deep trees or with ange-ftp. ;; The user can type `g' easily, and it is more consistent with find-file. ;; But if SWITCHES are given they are probably different from the ;; buffer's old value, so call dired-sort-other, which does ;; revert the buffer. A pity we can't possibly do "Directory has ;; changed - refresh? " like find-file does. (DIRNAME is a typo here BTW - the argument is actually called DIR-OR-LIST, and if it is a cons then the name is just its car.) Note the rationale: If SWITCHES are not given, that is, if there was no expressed intention to change the content of the listing, then just reuse an existing buffer. But if such an intention was expressed, then respect it. 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. Note that use of a cons as arg is not the typical use, and this use case has sometimes been forgotten/overlooked when coding, so that there have been several (recently fixed) bugs because of oversights. I mention this because I imagine that is the case here: it is not that we intentionally reuse the existing buffer and ignore the file list. We do that probably only because the coder wasn't thinking about the cons case. (The DIRNAME typo supports this supposition.) In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2010-09-20 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.4) --no-opt --cflags -Ic:/imagesupport/include' From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 11 20:19:44 2017 Received: (at control) by debbugs.gnu.org; 12 Jun 2017 00:19:44 +0000 Received: from localhost ([127.0.0.1]:41586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKD55-0004F7-A7 for submit@debbugs.gnu.org; Sun, 11 Jun 2017 20:19:43 -0400 Received: from mail-io0-f173.google.com ([209.85.223.173]:36179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKD53-0004Es-OT for control@debbugs.gnu.org; Sun, 11 Jun 2017 20:19:41 -0400 Received: by mail-io0-f173.google.com with SMTP id y77so49270609ioe.3 for ; Sun, 11 Jun 2017 17:19:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:mime-version; bh=mhu0UbewxcP9FqiBylCmFCxRLCr/LtCiQpKPHKQ2LUk=; b=GJyEL/pcSvHNXs3YKglHd6P5zmttUFmtvOX5NpIpXBZZ4RhO+lb5s33y+qjdXCTaze azHvo9486ugGc15zlkwgRdPpImADrlrzqNiy6EzMZkn11gTESxwIfNqS5UofDoxiMnAT J5wKZqBL24IYslMQUkygZQjftbPc3riRN8tMxrQzE0tE1C216VlJOxBuLiI9lEChshrz DcqTu6aCkkuo2+F6Q2xHk1Pl/pMuEAClC7XwS9J+r4P/QaenkxV+luj2D7xEzThZc7n4 IkGKDk9/KxK6TsWivzKVtyMwptFUArC7XWKiWPR6rQleNDhpbKjgNiXBLDkzSItpSP2l Htew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :mime-version; bh=mhu0UbewxcP9FqiBylCmFCxRLCr/LtCiQpKPHKQ2LUk=; b=Fm02EGBWp6h4pLVdFc29/RWNfYaa0gpUaa27MKBDOc3VegLmW82OU9KSUM4x8M6Zk+ 0nZUEcTvFoSTH7XmmlvoTQOuMl/GBHMS2tG9/Lh93zqMQ/y6JitS8S76W0ct25LTnCDd zuLromOtCVEsZXj0wyhxGc5sb6RZFySJD6qib1EE9pJyq20r+DjqJOcQXlKHPdQ3zY85 6cEkauEu3Pxdu7wM4u5+9sMpbJyDIOJJ6j/ih6jTebsRGYopJEPxyr1nh5TivAcgFbMh 50AA4Gz8/h6KdgUcYqflfCMeGl1iLY6ey2pmE0NZX9aCCQDycqRZhz490Ns5hCTOJvkr 6awQ== X-Gm-Message-State: AODbwcBW6Rwk5iupPCfeW2wQ8hMyQtWG35Zqo6A/g47rKxt2KTNpXp35 AHVIJ1BB7Vru5gH+ X-Received: by 10.107.164.219 with SMTP id d88mr40262701ioj.157.1497226776303; Sun, 11 Jun 2017 17:19:36 -0700 (PDT) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e12sm5508720itd.0.2017.06.11.17.19.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Jun 2017 17:19:35 -0700 (PDT) From: npostavs@users.sourceforge.net To: control@debbugs.gnu.org Subject: control message for bug #7131 Date: Sun, 11 Jun 2017 20:21:14 -0400 Message-ID: <878tkyukcl.fsf@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 7131 + easy severity 7131 minor quit From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 17 09:16:09 2017 Received: (at control) by debbugs.gnu.org; 17 Jul 2017 13:16:09 +0000 Received: from localhost ([127.0.0.1]:43401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX5sf-0003so-Ch for submit@debbugs.gnu.org; Mon, 17 Jul 2017 09:16:09 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34114) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dX5sd-0003rh-7a for control@debbugs.gnu.org; Mon, 17 Jul 2017 09:16:07 -0400 Received: by mail-pg0-f68.google.com with SMTP id v190so5712215pgv.1 for ; Mon, 17 Jul 2017 06:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:message-id:to:from:subject; bh=mHaU8n+fE0C2GT2W97Iu8KGV+lpRpRdJRTyTABrl6VU=; b=n3JpMz+7e5LIVEhNG4XX2+fWSNG67tSfXbZRWSJA6xWqG8XhZZiwrnqRIajxcM7C/T TVleBx1e3zd0kXzGvZrK+VvzG3pD0yX1b1NC80Ef8zK64ikbEOfjxzH7MXVza3V0FS+X zp5HtweO+l8Bwrh1+KoS/S90FYtVwvgjtefZAAs6RfD4YNWOHuC293c6iLmYS7ofu1rQ e40oFtXaKxQP6o2yQy6uo7ik89+BJWWPcINTOgordw5ViSLmMxc/TFVNn0jbcZdEBcCB xprB+CU+Efze8PVXrHR0WBy1OSf8dOBTyw5I0xErj13kCesvsPhYpgcQWLhH6c0rCZrr Gg3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:to:from:subject; bh=mHaU8n+fE0C2GT2W97Iu8KGV+lpRpRdJRTyTABrl6VU=; b=nrRRwDTYYGCyFotSoNa0zg4aslsNW3F8TrqTfcmOhKMz3HF51wN4qjhmkCHFGrHzeV HGI6YwxX5zBlZCflXVg5gULYYjjZlADubrrnCXOxxOUIK2eUc1nXkeA2MhqvNs+jqP1K VlBfeJqcYcGGyw06vb3ow1n6I8TlJ8jOhgLOPhmTGUtB8Do+3PMek5Hw1Yrxn6wcubSm cj9TdNfSHjDfIl8JbboFzcWWmr9PB3NYdeSThL9bRVsBfuradncpu/oJ9Z4OteG3IWqZ eKpGBA8+L40wC80Kbvbvj8Yg0Qv1eFm9+M/thqd4uh9maOnOfRMeUyfL2aNChPtyw/we l4kg== X-Gm-Message-State: AIVw111HKErSIXN2BNqhSvbgbQQxnJXupMfMt6sr8uo33ZV+I9/erEIz 8gOKXFEx/AXrVCz0 X-Received: by 10.98.138.204 with SMTP id o73mr11646006pfk.5.1500297361024; Mon, 17 Jul 2017 06:16:01 -0700 (PDT) Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id e11sm30360432pgn.23.2017.07.17.06.15.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jul 2017 06:16:00 -0700 (PDT) Date: Mon, 17 Jul 2017 22:15:46 +0900 Message-Id: <87fudvcigt.fsf@calancha-pc> To: control@debbugs.gnu.org From: Tino Calancha Subject: control message for bug #27633 X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) forcemerge 27633 7131 From unknown Sat Jun 21 03:25:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#7131: 24.0.50; `dired' with cons arg should not ignore arg if buffer exists Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Jul 2017 11:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7131 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: easy To: "Drew Adams" Cc: 7131@debbugs.gnu.org Received: via spool by 7131-submit@debbugs.gnu.org id=B7131.150037796530327 (code B ref 7131); Tue, 18 Jul 2017 11:40:01 +0000 Received: (at 7131) by debbugs.gnu.org; 18 Jul 2017 11:39:25 +0000 Received: from localhost ([127.0.0.1]:45405 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXQqZ-0007t3-4e for submit@debbugs.gnu.org; Tue, 18 Jul 2017 07:39:24 -0400 Received: from mail-pf0-f172.google.com ([209.85.192.172]:35595) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dXQqV-0007so-05 for 7131@debbugs.gnu.org; Tue, 18 Jul 2017 07:39:19 -0400 Received: by mail-pf0-f172.google.com with SMTP id e199so10236836pfh.2 for <7131@debbugs.gnu.org>; Tue, 18 Jul 2017 04:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=KKNvSb4GnzoXr31O2GL6MwQROe4RiCea5QNbpx132rQ=; b=iSSeANDolkClsdga7Pbmr7wAVbCOI+4puyScmR8tKy3GT4c+dkJthJC0821jv2pytB Hw0S+djqDPbx8aDCwIkMqC2jCdPRPcHXcsHw1tu+qYxZjUwV7XtKV5C+ZbCP+NQ62L8l cI2HaTDu0NcFk+VCgTw1/fKG5uRovGo7uJlz+XWWw27QVsAHOl1d3/UjYrytwuxhuK98 GR+yRI5U4unanYM4DGzOrr4ToRMExaJ5hAjTMq1cyZf104vaJKnrEq4xOck9EBZJHDRa MGaYO1lrBSzE3M1AVW/kujNipUHooxjkRvyMvhs+50F6eq2JmmZ7bkzzP7npfrWiIb0n mXkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=KKNvSb4GnzoXr31O2GL6MwQROe4RiCea5QNbpx132rQ=; b=ULGfYkvFji41CzVhdU4u6f1XaXhX99Ly85Msl0UBajXLhKCAbhalTKfiBBS93QTZK7 /9LrFa3Mqw+l7R17nV5wLmo51s7OnflRutShyh4+cxM++0hAvk8gWu7uwCgrkHe7gbvi 27aVfAdCc3cIxJC7pXoR6aBxAEJ972II7WMj+6qb7s5fFSPKCoKrjBCyuBYn7UcEgKJy JEuk7/nnBTc5H0hrRRc1/Hn4tcWY47zac/20n3oakdQXxz/YTCSZGablsGxmzeiIb+Ma WvVeApo69LpwoLK7Qh6X5zBf951VShPL4bFHa8Ra1gOQF0xrm13FtAK/vhrwpRR0kYah o8yw== X-Gm-Message-State: AIVw111aYj7kHRhU5TZH4pyYcct1Bd2rOFqve4qTzJVnk43aC8nsrbOU 8Jo4Pl0eJmiawBay X-Received: by 10.98.5.70 with SMTP id 67mr1237457pff.188.1500377952826; Tue, 18 Jul 2017 04:39:12 -0700 (PDT) Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id u62sm5125509pfa.18.2017.07.18.04.39.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Jul 2017 04:39:11 -0700 (PDT) From: Tino Calancha References: <9165B8BF5E624AAA8F9551E7A82022AF@us.oracle.com> Date: Tue, 18 Jul 2017 20:39:07 +0900 In-Reply-To: <9165B8BF5E624AAA8F9551E7A82022AF@us.oracle.com> (Drew Adams's message of "Wed, 29 Sep 2010 08:34:17 -0700") Message-ID: <871spe0yas.fsf@calancha-pc> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) "Drew Adams" writes: > (dired '("foo" "file1.c" "file2.c")) opens a Dired buffer named `foo' > with only files file1.c and file2.c. This is a useful feature. The doc > says only that if the arg is a cons then its first element is taken as > the directory name and the rest are the files to list. > > But if "foo" is already the name of an existing Dired buffer then that > existing buffer `foo' is simply displayed as it was. The explicit > file-list argument is completely ignored. > > Buffer `foo' should instead be updated (its contents replaced) to list > only the files to be included (files in the file-list arg). Agreed. > The code in question is `dired-internal-noselect'. This code comment > gives the behavior rationale for the case where the Dired buffer > already exists: > > ;; If there is an existing dired buffer for DIRNAME, just leave > ;; buffer as it is (don't even call dired-revert). > ;; This saves time especially for deep trees or with ange-ftp. > ;; The user can type `g' easily, and it is more consistent with find-file. > ;; But if SWITCHES are given they are probably different from the > ;; buffer's old value, so call dired-sort-other, which does > ;; revert the buffer. A pity we can't possibly do "Directory has > ;; changed - refresh? " like find-file does. > > (DIRNAME is a typo here BTW - the argument is actually called DIR-OR-LIST, > and if it is a cons then the name is just its car.) > > Note the rationale: If SWITCHES are not given, that is, if there was no > expressed intention to change the content of the listing, then just > reuse an existing buffer. But if such an intention was expressed, then > respect it. > > 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. I propose the following patch: --8<-----------------------------cut here---------------start------------->8--- commit a77e2a01ad3f903d877f2c71c31ed33b7bf9540c Author: Tino Calancha Date: Tue Jul 18 20:33:36 2017 +0900 dired: Revert buffer when DIRNAME is a cons * lisp/dired.el (dired-internal-noselect): Revert buffer if DIR-OR-LIST is a cons, or dired-directory is a cons and DIR-OR-LIST a string (Bug#7131). Update the comments. diff --git a/lisp/dired.el b/lisp/dired.el index 4fb4fe78f8..9d500a9f52 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -872,13 +872,15 @@ dired-auto-revert-buffer :version "23.2") (defun dired-internal-noselect (dir-or-list &optional switches mode) - ;; If there is an existing dired buffer for DIRNAME, just leave - ;; buffer as it is (don't even call dired-revert). + ;; If DIR-OR-LIST is a string and there is an existing dired buffer + ;; for it, just leave buffer as it is (don't even call dired-revert). ;; This saves time especially for deep trees or with ange-ftp. ;; The user can type `g' easily, and it is more consistent with find-file. ;; But if SWITCHES are given they are probably different from the ;; buffer's old value, so call dired-sort-other, which does ;; revert the buffer. + ;; Revert the buffer if DIR-OR-LIST is a cons or `dired-directory' + ;; is a cons and DIR-OR-LIST is a string. ;; A pity we can't possibly do "Directory has changed - refresh? " ;; like find-file does. ;; Optional argument MODE is passed to dired-find-buffer-nocreate, @@ -898,6 +900,11 @@ dired-internal-noselect (setq dired-directory dir-or-list) ;; this calls dired-revert (dired-sort-other switches)) + ;; Always revert when `dir-or-list' is a cons. Also revert + ;; if `dired-directory' is a cons but `dir-or-list' is not. + ((or (consp dir-or-list) (consp dired-directory)) + (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-18 Repository revision: a2ee81911bdf0f37b992989a9d36bb4d2ba14052 From unknown Sat Jun 21 03:25:54 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Drew Adams" Subject: bug#7131: closed (Re: bug#7131: 24.0.50; `dired' with cons arg should not ignore arg if buffer exists) Message-ID: References: <87inimh0dp.fsf@calancha-pc> <9165B8BF5E624AAA8F9551E7A82022AF@us.oracle.com> X-Gnu-PR-Message: they-closed 7131 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: easy Reply-To: 7131@debbugs.gnu.org Date: Fri, 21 Jul 2017 04:37:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1500611822-20854-1" This is a multi-part message in MIME format... ------------=_1500611822-20854-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #7131: 24.0.50; `dired' with cons arg should not ignore arg if buffer exists 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 7131@debbugs.gnu.org. --=20 7131: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7131 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1500611822-20854-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 7131-done) by debbugs.gnu.org; 21 Jul 2017 04:36:48 +0000 Received: from localhost ([127.0.0.1]:50247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYPgG-0005Px-BF for submit@debbugs.gnu.org; Fri, 21 Jul 2017 00:36:48 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:35815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYPgE-0005Pl-C1 for 7131-done@debbugs.gnu.org; Fri, 21 Jul 2017 00:36:46 -0400 Received: by mail-pf0-f170.google.com with SMTP id r76so2658611pfj.2 for <7131-done@debbugs.gnu.org>; Thu, 20 Jul 2017 21:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=7b2RrFodo86iMwMU+rWx1Gmg3286yRbzBHuWN6+OB+w=; b=X+Z2Oow4b0YUYV3oCW+xXXlWCnITivfu+rKwe5dNxyQKWRKoQeLPkGLKz/sNYud7QY 08x3boqPck6PRStGGaglSP6ec0RvIRQjWv+3OEo2YQYKTzo9xPjM068pnz5i00S/seBS fxhWKDC9A80UWdrLCPlWIJAt0en+J1hmHvda7FXn4oAnB57io76EhsmCxwrSaMebJJ7Q HLAJZeQVlo8xKR9Ey2aYMv2LIoDwcVZlUr7vJQ+QIBlrzMqVa4gImm1BAtMLGsBmMFOA VQKTgHBWa7BytlpQP4Fztog5t8sIpCQhoZ+qugemJBQUQzBc1hIaCMIRG5oCjli6jbTR OG9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7b2RrFodo86iMwMU+rWx1Gmg3286yRbzBHuWN6+OB+w=; b=bZy4NMZPGUiOb7c4FvDgbKOOHrPQVSAOLAGO24igJeA3w0KveDhwwYVg8U0Zy2IBS8 PxbDHRy6FsWgSCuSK4eWm7FHrHr9+0KoTvFyxRROQum5LOUw1AUE+NRki71FiL+04xK9 FqT67iwkpiwY5E6pt6DuseiuCZawQ33q4hDbTahQ9w3xp8oDEel0n8aZ6PQIcfzI5qih BDse2hi+bTkQUZ4YoNahotw+u0dqy0uBUMt2eEqLyDwBb9TdtjyVqaCmV0q+TR3gc1ge lVh4KTwqNA2F7Nfw9JKbxYJMZDtzeh/KPcbpDfEFVJZ4a/G120QbF5yS6xhRjEegcEu1 SDQQ== X-Gm-Message-State: AIVw110YdFc/uk2NWYfmq+Ui5fBjaTtTyl+IQFq2GMQMsff+2fffxtmc ROgsxIrtxvSzOERs X-Received: by 10.84.204.133 with SMTP id b5mr6685608ple.124.1500611798802; Thu, 20 Jul 2017 21:36:38 -0700 (PDT) Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id f15sm6813450pga.5.2017.07.20.21.36.37 for <7131-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Jul 2017 21:36:38 -0700 (PDT) From: Tino Calancha To: 7131-done@debbugs.gnu.org Subject: Re: bug#7131: 24.0.50; `dired' with cons arg should not ignore arg if buffer exists References: <9165B8BF5E624AAA8F9551E7A82022AF@us.oracle.com> <871spe0yas.fsf@calancha-pc> Date: Fri, 21 Jul 2017 13:36:34 +0900 In-Reply-To: <871spe0yas.fsf@calancha-pc> (Tino Calancha's message of "Tue, 18 Jul 2017 20:39:07 +0900") Message-ID: <87inimh0dp.fsf@calancha-pc> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 7131-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) >> 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 ------------=_1500611822-20854-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 29 Sep 2010 15:31:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0ydA-0005dA-DF for submit@debbugs.gnu.org; Wed, 29 Sep 2010 11:31:40 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0yd7-0005d3-Oc for submit@debbugs.gnu.org; Wed, 29 Sep 2010 11:31:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0yfu-0005ks-1Z for submit@debbugs.gnu.org; Wed, 29 Sep 2010 11:34:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:40378) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0yft-0005ko-TR for submit@debbugs.gnu.org; Wed, 29 Sep 2010 11:34:30 -0400 Received: from [140.186.70.92] (port=41661 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P0yfs-0001bj-OV for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2010 11:34:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P0yfr-0005kQ-9A for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2010 11:34:28 -0400 Received: from rcsinet10.oracle.com ([148.87.113.121]:45692) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P0yfr-0005kH-26 for bug-gnu-emacs@gnu.org; Wed, 29 Sep 2010 11:34:27 -0400 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o8TFYO5p003193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 29 Sep 2010 15:34:25 GMT Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o8TBPp2o006956 for ; Wed, 29 Sep 2010 15:34:24 GMT Received: from abhmt003.oracle.com by acsmt354.oracle.com with ESMTP id 641193851285774458; Wed, 29 Sep 2010 08:34:18 -0700 Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 29 Sep 2010 08:34:17 -0700 From: "Drew Adams" To: Subject: 24.0.50; `dired' with cons arg should not ignore arg if buffer exists Date: Wed, 29 Sep 2010 08:34:17 -0700 Message-ID: <9165B8BF5E624AAA8F9551E7A82022AF@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Actf68cKnNMtyb09T/eNiFgFGZoP/A== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) (dired '("foo" "file1.c" "file2.c")) opens a Dired buffer named `foo' with only files file1.c and file2.c. This is a useful feature. The doc says only that if the arg is a cons then its first element is taken as the directory name and the rest are the files to list. But if "foo" is already the name of an existing Dired buffer then that existing buffer `foo' is simply displayed as it was. The explicit file-list argument is completely ignored. Buffer `foo' should instead be updated (its contents replaced) to list only the files to be included (files in the file-list arg). That is more useful, and it is anyway easy to recuperate the original Dired buffer if for some reason the buffer name were a mistake. The code in question is `dired-internal-noselect'. This code comment gives the behavior rationale for the case where the Dired buffer already exists: ;; If there is an existing dired buffer for DIRNAME, just leave ;; buffer as it is (don't even call dired-revert). ;; This saves time especially for deep trees or with ange-ftp. ;; The user can type `g' easily, and it is more consistent with find-file. ;; But if SWITCHES are given they are probably different from the ;; buffer's old value, so call dired-sort-other, which does ;; revert the buffer. A pity we can't possibly do "Directory has ;; changed - refresh? " like find-file does. (DIRNAME is a typo here BTW - the argument is actually called DIR-OR-LIST, and if it is a cons then the name is just its car.) Note the rationale: If SWITCHES are not given, that is, if there was no expressed intention to change the content of the listing, then just reuse an existing buffer. But if such an intention was expressed, then respect it. 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. Note that use of a cons as arg is not the typical use, and this use case has sometimes been forgotten/overlooked when coding, so that there have been several (recently fixed) bugs because of oversights. I mention this because I imagine that is the case here: it is not that we intentionally reuse the existing buffer and ignore the file list. We do that probably only because the coder wasn't thinking about the cons case. (The DIRNAME typo supports this supposition.) In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600) of 2010-09-20 on 3249CTO Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.4) --no-opt --cflags -Ic:/imagesupport/include' ------------=_1500611822-20854-1-- From unknown Sat Jun 21 03:25:54 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Tino Calancha Subject: bug#27633: closed (Re: bug#7131: 24.0.50; `dired' with cons arg should not ignore arg if buffer exists) Message-ID: References: <87inimh0dp.fsf@calancha-pc> <87a84dm1tz.fsf@calancha-pc> X-Gnu-PR-Message: they-closed 27633 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: easy Reply-To: 27633@debbugs.gnu.org Date: Fri, 21 Jul 2017 04:37:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1500611822-20854-3" This is a multi-part message in MIME format... ------------=_1500611822-20854-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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@debbugs.gnu.org. --=20 7131: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D7131 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1500611822-20854-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 7131-done) by debbugs.gnu.org; 21 Jul 2017 04:36:48 +0000 Received: from localhost ([127.0.0.1]:50247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYPgG-0005Px-BF for submit@debbugs.gnu.org; Fri, 21 Jul 2017 00:36:48 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:35815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dYPgE-0005Pl-C1 for 7131-done@debbugs.gnu.org; Fri, 21 Jul 2017 00:36:46 -0400 Received: by mail-pf0-f170.google.com with SMTP id r76so2658611pfj.2 for <7131-done@debbugs.gnu.org>; Thu, 20 Jul 2017 21:36:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=7b2RrFodo86iMwMU+rWx1Gmg3286yRbzBHuWN6+OB+w=; b=X+Z2Oow4b0YUYV3oCW+xXXlWCnITivfu+rKwe5dNxyQKWRKoQeLPkGLKz/sNYud7QY 08x3boqPck6PRStGGaglSP6ec0RvIRQjWv+3OEo2YQYKTzo9xPjM068pnz5i00S/seBS fxhWKDC9A80UWdrLCPlWIJAt0en+J1hmHvda7FXn4oAnB57io76EhsmCxwrSaMebJJ7Q HLAJZeQVlo8xKR9Ey2aYMv2LIoDwcVZlUr7vJQ+QIBlrzMqVa4gImm1BAtMLGsBmMFOA VQKTgHBWa7BytlpQP4Fztog5t8sIpCQhoZ+qugemJBQUQzBc1hIaCMIRG5oCjli6jbTR OG9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=7b2RrFodo86iMwMU+rWx1Gmg3286yRbzBHuWN6+OB+w=; b=bZy4NMZPGUiOb7c4FvDgbKOOHrPQVSAOLAGO24igJeA3w0KveDhwwYVg8U0Zy2IBS8 PxbDHRy6FsWgSCuSK4eWm7FHrHr9+0KoTvFyxRROQum5LOUw1AUE+NRki71FiL+04xK9 FqT67iwkpiwY5E6pt6DuseiuCZawQ33q4hDbTahQ9w3xp8oDEel0n8aZ6PQIcfzI5qih BDse2hi+bTkQUZ4YoNahotw+u0dqy0uBUMt2eEqLyDwBb9TdtjyVqaCmV0q+TR3gc1ge lVh4KTwqNA2F7Nfw9JKbxYJMZDtzeh/KPcbpDfEFVJZ4a/G120QbF5yS6xhRjEegcEu1 SDQQ== X-Gm-Message-State: AIVw110YdFc/uk2NWYfmq+Ui5fBjaTtTyl+IQFq2GMQMsff+2fffxtmc ROgsxIrtxvSzOERs X-Received: by 10.84.204.133 with SMTP id b5mr6685608ple.124.1500611798802; Thu, 20 Jul 2017 21:36:38 -0700 (PDT) Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id f15sm6813450pga.5.2017.07.20.21.36.37 for <7131-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Jul 2017 21:36:38 -0700 (PDT) From: Tino Calancha To: 7131-done@debbugs.gnu.org Subject: Re: bug#7131: 24.0.50; `dired' with cons arg should not ignore arg if buffer exists References: <9165B8BF5E624AAA8F9551E7A82022AF@us.oracle.com> <871spe0yas.fsf@calancha-pc> Date: Fri, 21 Jul 2017 13:36:34 +0900 In-Reply-To: <871spe0yas.fsf@calancha-pc> (Tino Calancha's message of "Tue, 18 Jul 2017 20:39:07 +0900") Message-ID: <87inimh0dp.fsf@calancha-pc> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 7131-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) >> 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 ------------=_1500611822-20854-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 10 Jul 2017 03:02:34 +0000 Received: from localhost ([127.0.0.1]:59413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUOy2-0006LB-B1 for submit@debbugs.gnu.org; Sun, 09 Jul 2017 23:02:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUOy0-0006Kw-CV for submit@debbugs.gnu.org; Sun, 09 Jul 2017 23:02:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUOxu-0001km-9b for submit@debbugs.gnu.org; Sun, 09 Jul 2017 23:02:27 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37911) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUOxu-0001kh-66 for submit@debbugs.gnu.org; Sun, 09 Jul 2017 23:02:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUOxt-0000jL-0q for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2017 23:02:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUOxp-0001j9-Um for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2017 23:02:25 -0400 Received: from mail-pg0-x234.google.com ([2607:f8b0:400e:c05::234]:33832) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUOxp-0001iu-Ox for bug-gnu-emacs@gnu.org; Sun, 09 Jul 2017 23:02:21 -0400 Received: by mail-pg0-x234.google.com with SMTP id t186so42239156pgb.1 for ; Sun, 09 Jul 2017 20:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=OIu7TIpxcT+UO/DShXcMWyk/dl9+bAON3gFTM8/tcls=; b=elVdIOhft542RXQI+VZ+Z++17WpOlPVMz6zh4YLcZZpu3d6wAaTrRq7IA8t1x0DY1S MxrmvG2Pt2bzsrOzF89mOHfdgqN5M0YkWWA8awBix8dRDvQgsVgweMb2Tb0Y10Gii6eN hiiCHxdynFSunDbHZD0KvX+apS8RcsksGC5kaXf91tFQlZd72SuMjw4VP8avYw500W4p zNY7mENVnVXI2s8jPpQYfs5rDnBm5vhqf2XM60YemZNNF2Un5R9fe2Pf/BVlp2koNfSv lc9U1GB7334q+4bskZkgaJKrgwScYYmgqaYaOcyB0G6xJdzgtkdNYG5WXt3BRXJj0/QD v/Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=OIu7TIpxcT+UO/DShXcMWyk/dl9+bAON3gFTM8/tcls=; b=CoduNRP1aM6Cp1LB83yYYdqzcdbRdJgzKWewyXNh6F4vrgTHJtZAsRuzx6rzI34tl4 NO3Qx4gGDkar0wno9oVIuW1pfaGoJlWQEkp1R4Q192dZyxU+p0cvNFrfyDFX3Z1ZVukB Mv4OHP49fVWQxYKOMQYb40285fSCPr2AnZkqyHn+4FoeXsnq5tw4Hrw0+OJXy0CLGcAl bDtzMeVWhbANpcAaHAafwF2fpG1utWeXt57kMETz5ltj1LU95VsrZpt6L0HKrGdh2Epe 7tYI25tUn5X/tabZ0U0haEX8eGm+l9wsbn6jdhKBuUbYy/2v/ISarEr39HgQnPWZsvyn GKnw== X-Gm-Message-State: AIVw110kXzLdP4jZKIUN1mCD9JVz7ZXyAoQJhpa1OMXvCWI25sigpmfu I42YNsaDb6FkTySn X-Received: by 10.84.129.71 with SMTP id 65mr16090610plb.183.1499655740494; Sun, 09 Jul 2017 20:02:20 -0700 (PDT) Received: from calancha-pc (170.224.128.101.dy.bbexcite.jp. [101.128.224.170]) by smtp.gmail.com with ESMTPSA id j29sm18566227pfj.68.2017.07.09.20.02.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 09 Jul 2017 20:02:20 -0700 (PDT) From: Tino Calancha To: bug-gnu-emacs@gnu.org Subject: 26.0.50; Dired doesn't update buffer when wildcards have changed Date: Mon, 10 Jul 2017 12:02:16 +0900 Message-ID: <87a84dm1tz.fsf@calancha-pc> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) 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 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 ------------=_1500611822-20854-3--