From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.bugs Subject: bug#74700: [PATCH] Revert Dired buffer when clicking on last segment of directory name Date: Wed, 25 Dec 2024 10:17:59 +0530 Message-ID: <87r05w9xmo.fsf@gmail.com> References: <874j3iodzb.fsf@gmail.com> <86ttbiy5na.fsf@gnu.org> <87zflamt6j.fsf@gmail.com> <8634it19cc.fsf@gnu.org> <87msgmozm3.fsf@web.de> <874j2tbw9j.fsf@gmail.com> <875xn8mz1d.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34924"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: eliz@gnu.org, 74700@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 25 05:50:13 2024 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 1tQJLY-0008vM-QD for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 25 Dec 2024 05:50:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQJLQ-0006nA-JB; Tue, 24 Dec 2024 23:50:04 -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 1tQJLO-0006lo-R1 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 23:50:02 -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 1tQJLO-00038m-Bd for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 23:50:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=l1UUav3gP0oZey7xysmjN81ynGG0evY+I4XZn66T0x0=; b=iPx73cB9WJ4rVBqAy8V+FElNjKM11/UTa/4XRltbaJJx40NV8NOK79rMTsIwVML8xzIPXEu0wpK1g8lysRzXpo4xRMDlFUqN7lqEAW2jtgSgQn+DaO9ine5oi8yS118vgLji2YAfEJOy3uWY+ETYfQU+ctxaE3ubtZJ7XyXP9HJC3kS+nlZIwT4Hif/fay8TSumxY+cXLdotuPHD48xVDyp9EEaW8tL16iRwOkz37ON4JH4hjf4M53nzTZmcLHdV7T2Tyhzz0MQa/Y7oWbugoittE4ZhglRX7GEkrq57svDDzUMiYbbjQBtJ25lCwOU4DhXGniwlfyjGXgTCKdikSw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tQJLO-0004Da-70 for bug-gnu-emacs@gnu.org; Tue, 24 Dec 2024 23:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Visuwesh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 25 Dec 2024 04:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74700 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74700-submit@debbugs.gnu.org id=B74700.173510214816134 (code B ref 74700); Wed, 25 Dec 2024 04:50:02 +0000 Original-Received: (at 74700) by debbugs.gnu.org; 25 Dec 2024 04:49:08 +0000 Original-Received: from localhost ([127.0.0.1]:35788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQJKV-0004C9-IB for submit@debbugs.gnu.org; Tue, 24 Dec 2024 23:49:07 -0500 Original-Received: from mail-pj1-f68.google.com ([209.85.216.68]:59724) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tQJKT-0004C0-Im for 74700@debbugs.gnu.org; Tue, 24 Dec 2024 23:49:06 -0500 Original-Received: by mail-pj1-f68.google.com with SMTP id 98e67ed59e1d1-2ef72924e53so5954708a91.3 for <74700@debbugs.gnu.org>; Tue, 24 Dec 2024 20:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735102084; x=1735706884; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=l1UUav3gP0oZey7xysmjN81ynGG0evY+I4XZn66T0x0=; b=mgag4+B2b+Jz+7/Z6RNp86U5OrHGov6+H7CiqM2mst99kieBWfocgFfBA0B104CdM0 DkF+eaDA+EtApKMayQ2wXjH2VfNX8ECHzJ5qQ2nlAI+FbS87BCsIGdkE16n9KBGCVu4x nOVN4fk35RQNn8Oh2j2LLlODA6ecqgmrOjDt/QtD6H4evxQdWsAnVd8ANCP9hfLJ6o/Y kV90pYg2QHbSAkNynp2nLOFxMdgAgn9O3CIFF9W7BLkgaHVnnbBv85oQuiOmFsFE7jGd RFTuTqFE1O4ieIFIcCr952lCsnCmxq1J5r0gxfh+S5pm7ju7nNWQvFH8dw+OU66NCVA8 rLhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735102084; x=1735706884; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=l1UUav3gP0oZey7xysmjN81ynGG0evY+I4XZn66T0x0=; b=mG4RYz/BBn58YXyZffLEqxT50sdH/FuLwt4cRwMjeoO16rp7wqH3i+F4805d4S0cF9 BLXjvHE+rohHq4Z19rQojvmGMppZmcjcPMacm3Zi8Cu360wFo7/NV5XQqTOE1W8T8RUD 2L/63GNRrhJh3YXguybnbZfrI6Mg4NEqT3FGnKGev/UznI4Q2ALPmyf+iNOe/20Fq/UJ W2pPAtGNHSj7C43mqw9+729hlsS/3PALezJQsgpxl/P+wF6opjBLeq4HQ2GQn4FB9+mX Zx9J/flYX1aTV/aB5v3B+Vs3nGpVwTxAd74hEsL8tekw4ukqAGucYTJFfXywRl+sYCja +Uuw== X-Gm-Message-State: AOJu0YxlWNW/ovaqFLmxEUJSHTbFT+pLi5JO5aMbebHp5TUSKpfZdsHI VAV0LD6gfvm2rW9lSgDwys0LSK8aoMy4mIhSKgDi0R+oduoocmbx X-Gm-Gg: ASbGnctM7q4LRlF+4iw157CT409VBA8QIJC0sxc6J9pcXtGDd9sWq5rGXwmsSBwoTue bDfvQKnPjv6akzVbHBD10fQYNNIxrbrLljGR13+za4juhT+ZrdU9J0CwxzWWiBIulsOVL8oX3Qu C2LO2z/2LsAvhZ+CJ/jOCToJYUBCnz37S2pDtTlNrYcb3nzolYaXWrXw4cLOy6ZOL5la6hyjfuv 0h7xwWyiVCsCOBadysQAeiTtBxodwO70WkQoikFfCnBOaMPyp72UA== X-Google-Smtp-Source: AGHT+IE/UH8DnPrulFoQO6seXteFtVhxV8vp+e0Tw/YD0IMAEwF2CEg4hYBt/pthbjMGMA54b2w3sw== X-Received: by 2002:a17:90a:e18f:b0:2ee:c291:765a with SMTP id 98e67ed59e1d1-2f452debd4fmr32305419a91.8.1735102084588; Tue, 24 Dec 2024 20:48:04 -0800 (PST) Original-Received: from localhost ([49.204.119.117]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f4478aa37esm11271814a91.46.2024.12.24.20.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 20:48:04 -0800 (PST) In-Reply-To: <875xn8mz1d.fsf@web.de> (Michael Heerdegen's message of "Wed, 25 Dec 2024 00:39:10 +0100") 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:297712 Archived-At: [=E0=AE=AA=E0=AF=81=E0=AE=A4=E0=AE=A9=E0=AF=8D =E0=AE=9F=E0=AE=BF=E0=AE=9A= =E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 25, 2024] Michael Heerdegen w= rote: >> However, using mouse-1 still moves the point to bob. I believe we >> could fix it by directly binding mouse-1 but I would like to respect >> mouse-1-click-follows-link like the rest of the code in the function. >> I cannot tell how to prevent mouse-1 from moving point reading the >> Info nodes (info "(elisp) Clickable Text") and (info "(emacs) Mouse >> References"). I tried >> >> (with-selected-window (posn-window (event-start e)) ...) >> >> to no avail. > > Was that code line the attempt to fix the problem that the buffer in the > wrong window was being reverted, or the attempt to fix the mouse-1 > problem? It was an attempt to fix the mouse-1 problem. The former issue is fixed with the following patch. >> This goes beyond my level of knowledge so someone else will have to >> take care of this. But please install the following patch because >> without it using mouse-2 on the base name tries to revert the >> current-buffer instead of the dired buffer when the dired buffer is >> not shown in the selected window. > >> +++ # >> @@ -2089,8 +2089,10 @@ >> `( mouse-face highlight >> help-echo "mouse-1: revert this buffer" >> keymap ,(define-keymap >> - "" #'revert-buffer >> - "" 'follow-link >> + "" (lambda (_) >> + (interactive "@e") >> + (revert-buffer)) >> + "" 'mouse-face > > I don't know how to fix the mouse-1 problem in a sensible way either. > Does anyone? > > (And I think in this version the "e" code in `interactive' isn't > significant - but let's first see if we can improve the behavior even > more.) Indeed, I thought @ had to go with e _always_.