From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rasmus Newsgroups: gmane.emacs.bugs Subject: bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Date: Thu, 12 Mar 2015 15:45:53 +0100 Message-ID: <87egougtpa.fsf@gmx.us> References: <87oarbfyly.fsf@gmx.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1426171651 6383 80.91.229.3 (12 Mar 2015 14:47:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Mar 2015 14:47:31 +0000 (UTC) Cc: 19335@debbugs.gnu.org To: monnier@iro.umontreal.ca Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 12 15:47:20 2015 Return-path: Envelope-to: geb-bug-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 1YW4OK-0001zD-Kx for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Mar 2015 15:47:17 +0100 Original-Received: from localhost ([::1]:60448 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW4OE-0007Pl-Ql for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Mar 2015 10:47:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW4OA-0007M8-Px for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 10:47:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YW4O6-0007C2-Og for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 10:47:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW4O6-0007Bw-Kh for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 10:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YW4O6-0008Kk-CZ for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 10:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rasmus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Mar 2015 14:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19335 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19335-submit@debbugs.gnu.org id=B19335.142617157031965 (code B ref 19335); Thu, 12 Mar 2015 14:47:02 +0000 Original-Received: (at 19335) by debbugs.gnu.org; 12 Mar 2015 14:46:10 +0000 Original-Received: from localhost ([127.0.0.1]:44064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YW4NF-0008JV-DS for submit@debbugs.gnu.org; Thu, 12 Mar 2015 10:46:09 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:56056) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YW4NC-0008In-MH for 19335@debbugs.gnu.org; Thu, 12 Mar 2015 10:46:07 -0400 Original-Received: from W530 ([109.201.154.191]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MI8iw-1YZvBq1zLC-003us4; Thu, 12 Mar 2015 15:45:56 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAmJLR0QA/4ePzL8AAAAJcEhZ cwAAAEgAAABIAEbJaz4AAAHPSURBVEjHjZbJlQMxCAU7AKKsuCo3UpkDaOnNPX2wn22VPqAP8hH/ flDh+FgUAUSAmqn+BgBVVDO/ACIQ1FDT1C8FQCiZVAU/cyBCKigiPpOu6sD6dDzvewb2D8fTMk4E yfrB43nfDcF0g08hAaP0a9cw3YI61v59pIyKTGAUCJgATVAmqN9mTPWFmjmThiDGOdFiG2GbKadC CVBFH8HVRrQrdACsR6VcJC0MZmZmmmaXtQUcGh3VeBtONfOq4J4GVLb09gvoBETXKzjg3J6R9La/ ZWTKpESFpDegDc9Yv86jiBMQM+YuYEcz7TSJCTijGc3FNIR5B9p0Q0DQPuN5CneABYjEUHyo0shi CTAzxlegQqJz3tz6CMSmsNwNgfITyL0d0Ew2lfPUmMe19Vtm+bZrdQWmvzfZ8lod3nWQ4d7wc5gs Q3FXYDmlR2X1kGbeZ+tsnJFK93+f9MMwno3qqdCt4MP0rkWnL2YyGnkHyndjYKyCmQB3YJbQ66mD j0BEQJrpYgpM8Q3oqWXuxlPe7ri+1NLcjeqrQqzG2BSquC933Bo2aypVmG+XoosY66t4b0CbYwup Z+z7tTvH60kgv/5r9HqJDu7rn0ARgt1zfwjk8VmXGaNCAAAAAElFTkSuQmCC In-Reply-To: (Stefan Monnier's message of "Thu, 12 Mar 2015 10:13:27 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:y0FFWFD0n2Oaf/8mmGhiVJ+4LcbR/EVGCf+abBGDD4+3xUu+FtF sn53Xeiz+Qp0R308LLiNK76BNk8fJxEdhHJkDEMk2ySPZ/6dD1Vdrd9VcFFQfWAkP/dwGFj FZrpGOTTD8RGhjn1oIyhJzqIt1v9PVagbFQBEcTO/jDKR8b+8QKO5J4td4FtZsThtVq1R/h ISH2iZJAzb30vOEyT3Dzg== X-UI-Out-Filterresults: notjunk:1; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100407 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier writes: >> - (dolist (head recentf-list) >> + (dolist (head (append recentf-list > >> + (and (boundp 'bookmark-alist) >> + bookmark-alist >> + (mapcar >> + (lambda (bookmark) >> + (cdr-safe (assoc 'filename bookmark))) >> + bookmark-alist)))) > > Looks OK, tho you should probably filter out nil elements in case > a bookmark entry doesn't have a `filename' (and OTOH I think `cdr-safe' > can be replaced by `cdr' because `assoc' can only return a cons or nil). You are right. I'd come to same conclusion earlier, but I hadn't updated the patch. The formatting is still not the prettiest, but I don't know how to make it better... The attached patch should merge against master. Thanks, Rasmus -- It was you, Jezebel, it was you --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ido.el-Include-bookmark-files-as-virtual-buffers.patch >From d949b576623dc88e8b2a641a93b81d5d435bd071 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Thu, 12 Mar 2015 15:42:13 +0100 Subject: [PATCH] ido.el: Include bookmark-files as virtual buffers * ido.el (ido-add-virtual-buffers-to-list): Include bookmarked files. The docstring of ido-add-virtual-buffers-to-list suggests that bookmarked files should include, but this does not in fact seem to happen. --- lisp/ChangeLog | 5 +++++ lisp/ido.el | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 35689c1..1d4c8cf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-12 Rasmus Pank Roulund + + * ido.el (ido-add-virtual-buffers-to-list): Include bookmark-alist + files. + 2015-03-11 Stefan Monnier * international/quail.el (quail-input-method): diff --git a/lisp/ido.el b/lisp/ido.el index 1f4e3fa..0291765 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -3480,8 +3480,16 @@ This is to make them appear as if they were \"virtual buffers\"." ;; the file which the user might thought was still open. (unless recentf-mode (recentf-mode 1)) (setq ido-virtual-buffers nil) - (let (name) - (dolist (head recentf-list) + (let ((bookmarks (and (boundp 'bookmark-alist) + bookmark-alist)) + name) + (dolist + (head (append + recentf-list + (and bookmarks + (delq nil (mapcar (lambda (bookmark) + (cdr (assoc 'filename bookmark))) + bookmarks))))) (setq name (file-name-nondirectory head)) ;; In case HEAD is a directory with trailing /. See bug#14552. (when (equal name "") -- 2.3.2 --=-=-=--