From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#25983: 25.2; set dired-directory in vc-dir mode Date: Tue, 15 Sep 2020 17:51:22 +0200 Message-ID: <871rj36nt1.fsf@gnus.org> References: <87r32b1ud2.fsf@tromey.com> <87h9371d9f.fsf@tromey.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4596"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Glenn Morris , 25983@debbugs.gnu.org To: Tom Tromey Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 15 17:54:00 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIDHM-000167-Tu for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Sep 2020 17:54:00 +0200 Original-Received: from localhost ([::1]:52650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIDHL-0003EA-RU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Sep 2020 11:53:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIDFS-0001sJ-N5 for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2020 11:52:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIDFS-00076B-E5 for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2020 11:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kIDFS-0006Gz-CJ for bug-gnu-emacs@gnu.org; Tue, 15 Sep 2020 11:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Sep 2020 15:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25983 X-GNU-PR-Package: emacs Original-Received: via spool by 25983-submit@debbugs.gnu.org id=B25983.160018509624065 (code B ref 25983); Tue, 15 Sep 2020 15:52:02 +0000 Original-Received: (at 25983) by debbugs.gnu.org; 15 Sep 2020 15:51:36 +0000 Original-Received: from localhost ([127.0.0.1]:60352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIDF1-0006G4-TO for submit@debbugs.gnu.org; Tue, 15 Sep 2020 11:51:36 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:46866) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIDEz-0006Fn-9N for 25983@debbugs.gnu.org; Tue, 15 Sep 2020 11:51:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ePLGDHLeYPWsQ3je6BQ1fdh8L396M2LIk8NrV2P0gAY=; b=tAtq5TXAKtLg1KdOUiHyE0OSSI bIviuHm7QfS1QLnjnrfIR9vNO89GbUosuDua/nCDckUNobNjUfOb5J24mBYFlyMzyIttHpZ7FIzGr +grbDit+4y9ACVMvBk55Qw2x5Zn8Lo2vSsr96ZueGeun9/ucwi9sSKj4Iotq1wBwgJx8=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIDEq-0001ya-08; Tue, 15 Sep 2020 17:51:26 +0200 X-Now-Playing: Saito Koji's _433-1_: "433_056" In-Reply-To: <87h9371d9f.fsf@tromey.com> (Tom Tromey's message of "Sun, 05 Mar 2017 17:04:44 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:188134 Archived-At: Tom Tromey writes: >>>>>> "GM" == Glenn Morris writes: > > GM> Is dired-directory not basically an internal dired variable that should > GM> only be set in Dired mode, and modes derived from it, which vc-dir is not? > > Various bits of code (and some other code I have seen, not part of > Emacs) seem to examine it. And vc-dir seems dired-like. Hm... Well, there's a bunch of buffers that are kinda-sorta dired-like (like `M-x grep'), so adding this just to vc-dir seems a bit odd to me. > The backstory for this bug is that I have this handy bit of code I got > from someone on #emacs: > > ;; From fledermaus > (defun kill-buffers-under (under) [...] > (and dired-directory > (expand-file-name dired-directory)) )) )) [...] > ... and I'd rather not add a special hack just for vc-dir, and then for > whatever other modes crop up. > > I guess I'm being a bit lazy trying to avoid introducing a new variable. > But maybe I should? All buffers have a default-directory, but you want to make a function that kills are buffers that are "like" dired (in that they display a buffer pointing to a directory, and there are things you can do there)? I don't think you'll be able to find a definition of what's "like" dired enough that this would make sense... especially when the use case doesn't seem that ... comprehensible? That is, I think only the user that writes a function like this knows what buffer types they want to consider killing. Finding a general solution here doesn't seem very likely, so I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no