From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jared Finder via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67856: Dired navigation via directory line does not respect dired-kill-when-opening-new-dired-buffer Date: Sat, 16 Dec 2023 12:35:10 -0800 Message-ID: <08113bf5fecdaaffc112749f230a5c0b@finder.org> Reply-To: Jared Finder Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_f24fb6a93b56ace6d78abbc7d7938497" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4011"; mail-complaints-to="usenet@ciao.gmane.io" To: 67856@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 16 21:36:21 2023 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 1rEbOU-0000mn-BN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 16 Dec 2023 21:36:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rEbOE-0000EG-Pa; Sat, 16 Dec 2023 15:36:02 -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 1rEbOD-0000E6-9W for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 15:36:01 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rEbOD-0002iI-1H for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 15:36:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rEbOD-0008N6-Om for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 15:36:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jared Finder Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 Dec 2023 20:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67856 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Bug-gnu Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.170275892732137 (code B ref -1); Sat, 16 Dec 2023 20:36:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Dec 2023 20:35:27 +0000 Original-Received: from localhost ([127.0.0.1]:56148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEbNe-0008MG-Jn for submit@debbugs.gnu.org; Sat, 16 Dec 2023 15:35:27 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:47616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rEbNa-0008M0-5S for submit@debbugs.gnu.org; Sat, 16 Dec 2023 15:35:24 -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 1rEbNT-0000Az-Os for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 15:35:15 -0500 Original-Received: from greenhill.hpalace.com ([192.155.80.58]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rEbNR-0001Sd-IY for bug-gnu-emacs@gnu.org; Sat, 16 Dec 2023 15:35:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=finder.org; s=2018; t=1702758910; bh=loHW2DSnP17WjvyTd+EhqdVtAYSy8QsydiwQilWp46o=; h=Date:From:To:Subject:From; b=bNz4S9nZW2/Yjz0TdL/wWjFXfWcTrBOt/8SROWuJpZHcCbENIv0P3Dd5hPiM/gFV5 fxfODnSTz0cM4vENQ3MZxwsRArhIoeVT64vBePwGYjb0z36yPIhnKFczZkBw5IVqkf dsLg+eff6TaF6ePF72iVcTJFi/2WXWttk3Es9+ot6HXAOKSogMBiLab8+sqsV5P4sg 0nk+AtL0MhYHrSe6FwgyJwcO4JWPRM7HaIIak+QZmBleSBQCiIkm7yHeA+xzjf2V0C 7p2UNUOHMiaEDQYegq52ny9Wc/IXkZuRq7b6JrpJ6veFC7GImfQuu2Vv8W1VC4TGZN 8eMf4uP0RLtiw== Original-Received: from mail.finder.org (unknown [192.155.80.58]) by greenhill.hpalace.com (Postfix) with ESMTPSA id B229D430 for ; Sat, 16 Dec 2023 20:35:10 +0000 (UTC) X-Sender: jared@finder.org Received-SPF: pass client-ip=192.155.80.58; envelope-from=jared@finder.org; helo=greenhill.hpalace.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276383 Archived-At: --=_f24fb6a93b56ace6d78abbc7d7938497 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed The option dired-kill-when-opening-new-dired-buffer is not respected when clicking on parent directories in the directory line at the top of dired buffers. This can be fixed by calling dired--find-possibly-alternate-file instead of dired in the callback, as my attached patch does. I believe changing to dired--find-possibly-alternate-file is safe because from playing around with dired, the directory being clicked on must be a directory and can not contain wildcards at this point. Therefore, at this point it is known that the directory is just a plain directory (no wildcards) and so going through find-file machinery will have the intended result. Steps to reproduce: emacs -Q M-x load-library RET dired RET M-x set-variable RET dired-kill-when-opening-new-dired-buffer RET t RET C-x d ~/ RET Click something in the directory line like "home" in "/home/jared" for myself. C-x C-b See that there are two directory buffers instead of just one. In GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) of 2023-09-11, modified by Debian built on melete System Description: Debian GNU/Linux 12 (bookworm) Configured using: 'configure --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/libexec --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-native-compilation --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/libexec --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-libsystemd --with-pop=yes --enable-locallisppath=/etc/emacs:/usr/local/share/emacs/29.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/29.1/site-lisp:/usr/share/emacs/site-lisp --with-sound=alsa --without-gconf --with-mailutils --with-native-compilation --with-pgtk 'CFLAGS=-g -O2 -ffile-prefix-map=/build/emacs-N816CI/emacs-29.1+1=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Dired by name Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils mule-util display-line-numbers dired-aux cus-edit pp cus-start cus-load wid-edit help-fns radix-tree dired dired-loaddefs thingatpt cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib find-func rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 105919 13638) (symbols 48 9060 0) (strings 32 24805 2351) (string-bytes 1 725024) (vectors 16 17316) (vector-slots 8 354985 19128) (floats 8 37 33) (intervals 56 711 0) (buffers 984 14)) --=_f24fb6a93b56ace6d78abbc7d7938497 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Clicks-on-directory-line-kill-prev-buffer-if-option-.patch Content-Disposition: attachment; filename=0001-Clicks-on-directory-line-kill-prev-buffer-if-option-.patch; size=1225 RnJvbSA0NWQyNjAxYTgyMTllZjM5MmJiMDE5MTY5M2I1Nzg1MTYwZDIyM2ZjIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKYXJlZCBGaW5kZXIgPGphcmVkQGZpbmRlci5vcmc+CkRhdGU6 IFNhdCwgMTYgRGVjIDIwMjMgMTI6MTA6MDMgLTA4MDAKU3ViamVjdDogW1BBVENIXSBDbGlja3Mg b24gZGlyZWN0b3J5IGxpbmUga2lsbCBwcmV2IGJ1ZmZlciBpZiBvcHRpb24gaXMgc2V0CgpUaGUg b3B0aW9uIGRpcmVkLWtpbGwtd2hlbi1vcGVuaW5nLW5ldy1kaXJlZC1idWZmZXIgc2hvdWxkIGJl IGNoZWNrZWQKaW4gdGhpcyBjb2RlIHBhdGggYXMgd2VsbC4KCiogbGlzcC9kaXJlZC5lbCAoZGly ZWQtLW1ha2UtZGlyZWN0b3J5LWNsaWNrYWJsZSk6IENhbGwKZGlyZWQtLWZpbmQtcG9zc2libHkt YWx0ZXJuYXRpdmUtZmlsZSBpbnN0ZWFkIG9mIGRpcmVkIGluIGNsaWNrCmNhbGxiYWNrLgotLS0K IGxpc3AvZGlyZWQuZWwgfCAyICstCiAxIGZpbGUgY2hhbmdlZCwgMSBpbnNlcnRpb24oKyksIDEg ZGVsZXRpb24oLSkKCmRpZmYgLS1naXQgYS9saXNwL2RpcmVkLmVsIGIvbGlzcC9kaXJlZC5lbApp bmRleCAzM2UzOGVkMmMxYy4uMDNmNjczYzVlMjIgMTAwNjQ0Ci0tLSBhL2xpc3AvZGlyZWQuZWwK KysrIGIvbGlzcC9kaXJlZC5lbApAQCAtMjAxMiw3ICsyMDEyLDcgQEAgZGlyZWQtLW1ha2UtZGly ZWN0b3J5LWNsaWNrYWJsZQogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAo aW50ZXJhY3RpdmUpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpZiAo YXNzb2MgY3VycmVudC1kaXIgZGlyZWQtc3ViZGlyLWFsaXN0KQogICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgKGRpcmVkLWdvdG8tc3ViZGlyIGN1cnJlbnQtZGlyKQot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkaXJlZCBjdXJyZW50LWRp cikpKSkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRpcmVkLS1m aW5kLXBvc3NpYmx5LWFsdGVybmF0aXZlLWZpbGUgY3VycmVudC1kaXIpKSkpKQogICAgICAgICAg ICAgICAgICAgICAgICAgKGRlZmluZS1rZXltYXAKICAgICAgICAgICAgICAgICAgICAgICAgICAg Ijxtb3VzZS0yPiIgY2xpY2sKICAgICAgICAgICAgICAgICAgICAgICAgICAgIjxmb2xsb3ctbGlu az4iICdtb3VzZS1mYWNlCi0tIAoyLjM5LjIKCg== --=_f24fb6a93b56ace6d78abbc7d7938497--