unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers
@ 2014-12-10 13:00 Rasmus
  2015-01-08 22:14 ` Rasmus
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rasmus @ 2014-12-10 13:00 UTC (permalink / raw)
  To: 19335

[-- Attachment #1: Type: text/plain, Size: 681 bytes --]

Hi,

The docstring of ido-add-virtual-buffers-to-list reads:

"Add recently visited files, and bookmark files, to the buffer list.
This is to make them appear as if they were \"virtual buffers\"."

But bookmarked files (C-x r l) are not in fact included (at least on my
system, and if they are it's not obvious how).  Perhaps I'm misreading the
docstring (since it says "bookmark files").  In any case, it would be nice
to include bookmarked files as virtual files (they are bookmarked and
therefore important).

I can add a defcustom to not include bookmarked files, if that's better.

Thanks,
Rasmus

-- 
And when I’m finished thinking, I have to die a lot

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ido.el-Include-bookmark-files-as-virtual-buffers.patch --]
[-- Type: text/x-diff, Size: 1727 bytes --]

From da38e2da2c13eee221e2530514df842fb471465c Mon Sep 17 00:00:00 2001
From: rasmus <rasmus@gmx.us>
Date: Wed, 10 Dec 2014 13:49:42 +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 | 4 ++++
 lisp/ido.el    | 8 +++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 454ee00..6b2c7f7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
+2014-12-10  Rasmus Pank Roulund  <rasmus@pank.eu>
+
+	* ido.el (ido-add-virtual-buffers-to-list): Include bookmarked files.
+
 2014-12-10  Andreas Schwab  <schwab@suse.de>

 	* files.el (file-tree-walk): Use file-name-as-directory
diff --git a/lisp/ido.el b/lisp/ido.el
index 5f7637c..f7c3f5f 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -3482,7 +3482,13 @@ This is to make them appear as if they were \"virtual buffers\"."
   (unless recentf-mode (recentf-mode 1))
   (setq ido-virtual-buffers nil)
   (let (name)
-    (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))))
       (setq name (file-name-nondirectory head))
       ;; In case HEAD is a directory with trailing /.  See bug#14552.
       (when (equal name "")
--
2.1.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers
  2014-12-10 13:00 bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Rasmus
@ 2015-01-08 22:14 ` Rasmus
  2015-03-11 15:49 ` bug#19335: Patch review Rasmus
  2015-03-12 14:13 ` bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Stefan Monnier
  2 siblings, 0 replies; 6+ messages in thread
From: Rasmus @ 2015-01-08 22:14 UTC (permalink / raw)
  To: 19335

Hi,

In a recent thread on the devel list Eli said to "re-ping" if a bug had no
received any feedback.  Please let me know if I should keep working on
bug#19335 or not.

Thanks,
Rasmus

-- 
May contains speling mistake





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19335: Patch review
  2014-12-10 13:00 bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Rasmus
  2015-01-08 22:14 ` Rasmus
@ 2015-03-11 15:49 ` Rasmus
  2015-03-12 14:13 ` bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Stefan Monnier
  2 siblings, 0 replies; 6+ messages in thread
From: Rasmus @ 2015-03-11 15:49 UTC (permalink / raw)
  To: 19335

It would be great if somebody would indicate whether the patch can be
included or if it needs improvements to be included...

—Rasmus
-- 
There are known knowns; there are things we know that we know





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers
  2014-12-10 13:00 bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Rasmus
  2015-01-08 22:14 ` Rasmus
  2015-03-11 15:49 ` bug#19335: Patch review Rasmus
@ 2015-03-12 14:13 ` Stefan Monnier
  2015-03-12 14:45   ` Rasmus
  2 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-03-12 14:13 UTC (permalink / raw)
  To: Rasmus; +Cc: 19335

> -    (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).


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers
  2015-03-12 14:13 ` bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Stefan Monnier
@ 2015-03-12 14:45   ` Rasmus
  2015-03-12 19:03     ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Rasmus @ 2015-03-12 14:45 UTC (permalink / raw)
  To: monnier; +Cc: 19335

[-- Attachment #1: Type: text/plain, Size: 965 bytes --]

Stefan Monnier <monnier@iro.umontreal.ca> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ido.el-Include-bookmark-files-as-virtual-buffers.patch --]
[-- Type: text/x-diff, Size: 1832 bytes --]

From d949b576623dc88e8b2a641a93b81d5d435bd071 Mon Sep 17 00:00:00 2001
From: Rasmus <rasmus@gmx.us>
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  <emacs@pank.eu>
+
+	* ido.el (ido-add-virtual-buffers-to-list): Include bookmark-alist
+	files.
+
 2015-03-11  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers
  2015-03-12 14:45   ` Rasmus
@ 2015-03-12 19:03     ` Stefan Monnier
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2015-03-12 19:03 UTC (permalink / raw)
  To: Rasmus; +Cc: 19335-done

> The attached patch should merge against master.

Thanks, installed,


        Stefan





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-03-12 19:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-10 13:00 bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Rasmus
2015-01-08 22:14 ` Rasmus
2015-03-11 15:49 ` bug#19335: Patch review Rasmus
2015-03-12 14:13 ` bug#19335: 24.4.51; ido.el: Include bookmark-files as virtual buffers Stefan Monnier
2015-03-12 14:45   ` Rasmus
2015-03-12 19:03     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).