From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] change dired--find-possibly-alternative-file behaviour. Date: Sun, 26 Feb 2023 08:29:09 +0200 Message-ID: <83h6v9j5xm.fsf@gnu.org> References: <87mt51o5bu.fsf@web.de> <83ttz9j8up.fsf@gnu.org> <87y1olgdca.fsf@web.de> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26504"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Felix Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 26 07:29:50 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pWAXe-0006lM-0k for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Feb 2023 07:29:50 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWAWy-0004CI-1n; Sun, 26 Feb 2023 01:29:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWAWw-0004Bw-6F for emacs-devel@gnu.org; Sun, 26 Feb 2023 01:29:06 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWAWv-0004WI-UD; Sun, 26 Feb 2023 01:29:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=3KdFL0XkekVfpiSysAwRovED8AYL3/V16mCPwxEQLi4=; b=mq4igL6KifuI j1igEYMIIet0qPmeStwM298Yb9bhhL+TqJbVdXVnp058ThI1Ip3P2eXMd49AiFewj990myuObHkIV kVPUtWywRC5cX8ZvnJ3SV6G2LS6MV9//+luKxp9WHhlBmScUZYgH2HEwXMiwY8GJlDRLkVi5zcicY 0147RvqP9IwdDCTJYHJLe44En5QgkU5ZhTOld4vOtVo1+BnPCrbARQNHSk+qLf5bgLz2lKzusytaR s2gsCKbBUtCPlXBX3En1E3qhva7Kw4S2hfkKqrDD8Dr9ePdpXQi/gahNzgyrwfeGGk5shDsNlgixt Ds0RSp7U8NyXJ/RVTQcvXA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWAWu-0008GD-DL; Sun, 26 Feb 2023 01:29:05 -0500 In-Reply-To: <87y1olgdca.fsf@web.de> (message from Felix on Sun, 26 Feb 2023 07:07:10 +0100) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303812 Archived-At: > From: Felix > Cc: emacs-devel@gnu.org > Date: Sun, 26 Feb 2023 07:07:10 +0100 > > > Eli Zaretskii writes: > > >> From: Felix > >> Date: Sat, 25 Feb 2023 20:43:57 +0100 > >> > >> diff --git a/lisp/dired.el b/lisp/dired.el > >> index 76499d0f520..620508bef4f 100644 > >> --- a/lisp/dired.el > >> +++ b/lisp/dired.el > >> @@ -2728,7 +2728,8 @@ dired-find-file > >> (defun dired--find-possibly-alternative-file (file) > >> "Find FILE, but respect `dired-kill-when-opening-new-dired-buffer'." > >> (if (and dired-kill-when-opening-new-dired-buffer > >> - (file-directory-p file)) > >> + (file-directory-p file) > >> + (= (length (get-buffer-window-list)) 1)) > >> (progn > >> (set-buffer-modified-p nil) > >> (dired--find-file #'find-alternate-file file)) > > > > What if get-buffer-window-list returns nil? > > The optional argument BUFFER-OR-NAME of get-buffer-window-list defaults > to the current buffer, shouldn't that garantee that it never returns > nil? Only if the current buffer is displayed in some window.