[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bongo-devel] Re: Bongo wishlist #5: visual seek
From: |
Romain Francoise |
Subject: |
[bongo-devel] Re: Bongo wishlist #5: visual seek |
Date: |
Sun, 03 Dec 2006 12:54:54 +0100 |
[ A few weeks ago, during a conversation with Daniel, I said ... ]
> I'd like `j' to do what it does in Ibuffer, i.e. jump to a line with
> ido-like completion if ido is enabled. That's also what it does in
> XMMS/BMP.
So I finally prototyped this. The command itself is very useful, but
building the completion list is somewhat slow: 1.317678 seconds in my
usual playlist, which has approximately 1300 tracks.
Is there a more efficient alternative to my code below?
Also, note that this function adds both headers and tracks to the
completions, on purpose: this allows the user to jump to a header line
or a track line with the same interface.
(defun ore-bongo-jump ()
"Prompt for a track and go to the corresponding line in the
playlist buffer."
(interactive)
(let (tracks)
(save-excursion
;; Go through the buffer, collecting infosets and positions.
(with-bongo-library-buffer
(goto-char (point-max))
(while (bongo-previous-object-line t)
(push (list (bongo-format-infoset (bongo-line-infoset)) (point))
tracks))))
(goto-char
(cadr (assoc (ido-completing-read "Jump to track: " tracks nil t)
tracks)))))
(define-key bongo-mode-map (kbd "j") 'ore-bongo-jump)
--
Romain Francoise <address@hidden> | The sea! the sea! the open
it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the
| ever free! --Bryan W. Procter
- [bongo-devel] Re: Bongo wishlist #5: visual seek,
Romain Francoise <=