From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Re[2]: How to open dired bookmarks in the same window Date: Sun, 28 Oct 2012 10:19:36 -0700 Message-ID: <93FCAA847D3A4F94B0014975DEB58B56@us.oracle.com> References: <406504998.20121028132549@gmail.com> <95564EC5677841AEA165A840AF006ED8@us.oracle.com> <1477041223.20121028201017@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1351444800 32163 80.91.229.3 (28 Oct 2012 17:20:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 28 Oct 2012 17:20:00 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "'Ivanov Dmitry'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 28 18:20:09 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TSWWs-00078X-1q for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Oct 2012 18:20:06 +0100 Original-Received: from localhost ([::1]:58597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSWWj-00055w-TS for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Oct 2012 13:19:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSWWe-00055f-99 for help-gnu-emacs@gnu.org; Sun, 28 Oct 2012 13:19:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TSWWd-00048o-9p for help-gnu-emacs@gnu.org; Sun, 28 Oct 2012 13:19:52 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:30068) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TSWWd-00048h-32 for help-gnu-emacs@gnu.org; Sun, 28 Oct 2012 13:19:51 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q9SHJlbg026178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 28 Oct 2012 17:19:47 GMT Original-Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q9SHJkII017041 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 28 Oct 2012 17:19:47 GMT Original-Received: from abhmt114.oracle.com (abhmt114.oracle.com [141.146.116.66]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q9SHJk8v005461; Sun, 28 Oct 2012 12:19:46 -0500 Original-Received: from dradamslap1 (/71.202.147.44) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 28 Oct 2012 10:19:46 -0700 X-Mailer: Microsoft Office Outlook 11 In-reply-to: <1477041223.20121028201017@gmail.com> Thread-Index: Ac21JoUY4ZJi2rOKTN+w0Nfp/I9+4gAAMLLA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:87466 Archived-At: > I installed bookmark+ and tried bmkp-dired-jump. But it still > opens the directory in a new buffer. Of course it does. `dired' always does that. And `bmkp-dired-jump' invokes `dired'. Your request was that jumping to the bookmark open the dir in the same _window_. Is that not what you see with `bmkp-dired-jump'? It works for me. If you want the opened Dired buffer to replace the _buffer_ that was current when you asked to jump to the bookmark, then add a function that kills that buffer to `bookmark-after-jump-hook'. It's not clear what you want. Be aware BTW that in Dired, even when you use `find-alternate-file' to visit a subdir in the listing, that does not change how the command `dired' works. For example, if you use Dired+ and you choose to reuse Dired buffers, so that when you hit RET on a subdir name in Dired the new Dired buffer replaces the one where you hit RET, that simply makes use of `find-alternate-file' - it does not invoke command `dired'. That Dired+ config choice does not change the behavior of command `dired'. So for example, if you use `C-x d some-dir', the Dired buffer for `some-dir' does _not_ replace the buffer that was current when you did `C-x d'. With that Dired+ config choice, RET in Dired does replace the current Dired buffer with the one for the subdir you hit RET on - but that's not the same thing as invoking `dired' on it. Do you really want to kill the current buffer - whatever it might be - when you jump to a Dired bookmark? If so, then try doing what I suggested above: use `bookmark-after-jump-hook'. For example, try this command (with Bookmark+): (defun foo (bookmark) (interactive (let ((alist (bmkp-dired-alist-only))) (list (bookmark-get-bookmark (bmkp-read-bookmark-for-type "Dired" alist nil nil 'bmkp-dired-history))))) (let ((this-buf (current-buffer))) (add-hook 'bookmark-after-jump-hook `(lambda () (kill-buffer ,this-buf))) (bmkp-jump-1 bookmark 'switch-to-buffer nil) (remove-hook 'bookmark-after-jump-hook `(lambda () (kill-buffer ,this-buf))))) HTH. I expect that you have enough info now to come up with whatever it is you really want. If not, look in bookmark+-1.el (and perhaps dired+.el) for more info.