From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Friendlier dired experience [CODE INCLUDED] Date: Fri, 06 Nov 2020 09:14:25 -0500 Message-ID: References: <20201103104340.q34kqfita55w2u7h@E15-2016.optimum.net> <20201104183228.xf7w4yf3fw3427y5@E15-2016.optimum.net> <20201105092232.fk4r5dexnay3eyln@E15-2016.optimum.net> <20201105143800.7vt5jfr4gg2wigyb@E15-2016.optimum.net> <20201106091525.mzkxrssm7o43jvff@E15-2016.optimum.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8742"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Arthur Miller , Emacs-Devel List To: Boruch Baum Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 06 15:15:19 2020 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 1kb2WN-00028A-7P for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Nov 2020 15:15:19 +0100 Original-Received: from localhost ([::1]:55346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb2WL-0003Ch-UY for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Nov 2020 09:15:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb2Vc-0002m9-Dt for emacs-devel@gnu.org; Fri, 06 Nov 2020 09:14:32 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:26503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb2VZ-0008Nw-64 for emacs-devel@gnu.org; Fri, 06 Nov 2020 09:14:31 -0500 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AF62980B46; Fri, 6 Nov 2020 09:14:27 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 45E6380724; Fri, 6 Nov 2020 09:14:26 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1604672066; bh=eY7B/M8Vye8/iZcgjBTjYJHNW5texLuO7jA1mvpK0bU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Kv6BGTeilDCU9NCQ0RBxYzr+EHYWJwZkXElVYlNNglwMFwsLJKWeslzXKDuSi37Gu OosW/wCpEE4eRMhEoGtQOxkWsTS1KTy0AzqiLu6ox/Z3z02OB0MyXQVRB2IhDIlfqV P0T0MLjTSOE9u7j3dwKSfLozE8Mx+mZ8Co+/dxJ7Ioala28KPH/AHyR2311R9qnkXd u3kgkp1t/WSc2Z8LIpy7FMyAprCHKVhcttLeelFUPSvIP/0Ve8KUes49IRqCGbV0X+ f3RSuT96IBLkEJ+el3JYyILkdzMiAbpts/h2GmXIXeqvZTt0poogQyliqNmLBLxMHr byf4yg+Xj9Y3Q== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 16EC912039E; Fri, 6 Nov 2020 09:14:26 -0500 (EST) In-Reply-To: <20201106091525.mzkxrssm7o43jvff@E15-2016.optimum.net> (Boruch Baum's message of "Fri, 6 Nov 2020 04:15:25 -0500") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/06 08:56:47 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:258817 Archived-At: > Hmm. I'm looking at the code for bookmarks and the variable > bookmark-alist, and what I see is that directory bookmarks have a NIL > handler, ie. function bookmark-default-handler, which runs function > find-file-noselect, which is directly or indirectly called by > "everyone", including diredc. So, I suppose a way to 'hijack' the > bookmark process would be to advise around function > bookmark-default-handler checking for the current buffer's major-mode, > the state of variable diredc-mode and whether the bookmark is a > directory. Sounds about right, yes. > The ugly part of the 'hijack' is keeping the code of the > advice in sync with the underlying function. Your code doesn't need to depend on the code of `bookmark-default-handler`: It only depends on the name of that function, on the fact that it is called for the entries in which you're interested (and on the fact that it is called in exactly the same way as any other bookmark handler). So as far as advice go, it should be pretty stable. > What about the case of diredc-mode being enabled, but the current-frame > isn't the diredc frame (ie. the user is not currently using dired)? You > wouldn't want to jump to that frame and open the directory in one of its > windows? Your advice gets to decide which behavior you get. Stefan