Re: how can I display the current song of bongo player (emacs) in RP's bar?

Memnon Anon <gegendosenfleisch-gM/[email protected]>
Newsgroups gmane.comp.window-managers.ratpoison.devel
Message-ID <[email protected]>
"CSM 'illovae' Seldon" <[email protected]> writes:

> So i tried to hack bongo.el but my skills in elisp are near 0... so it
> doesn't work at all. Here's what I made.

I am at the same level, but I gave it a try.

> The trick is I decided to use the function bongo-show which is used to
> display in the minibuffer the title of the song while you actually play
> it. When you play foobar, it display /foobar/ in minibuffer so why add
> something to display /foobar/ too in my RP's bar ?

I don't think it is a good idea to modify bongo-show directly.
Next time the code gets updated, you'll have to do it all over again.
AFAIK, thats what hooks are for: Modifying the program at certain well
defined points. 

I do not use bongo, but I downloaded it and played around a bit.
This is what I came up with:

--8<---------------cut here---------------start------------->8---
(add-hook 'bongo-player-started-hook
     (lambda ()
       (let (message command))
	 (with-bongo-playlist-buffer
	   (setq my-message (bongo-format-infoset (bongo-player-infoset player)))
	   (setq command (concat "ratpoison -c 'echo " message "'")) 
	   (start-process-shell-command "FixMe" nil command))))
--8<---------------cut here---------------end--------------->8---

Just start bongo, eval this in your *scratch* buffer and give it a try.
I only did some quick testing, it can very well not work as you
expected.

But it might give you a point to start from ...

Memnon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.