error in unless



Hello,

I'm a beginner in lisp & programming, which explains why I'm not
seeing the mistake in the following bit of code:

I would like to add this to my .gnus:

(defun audacious-now-playing ()
"Insert the title of the song I'm currently listening to."
(let ((track (shell-command-to-string "audtool --current-song")))
(unless (string-equal "no song playing." track)
(save-excursion
(goto-char (point-min))
(re-search-forward "^--text follows this line--")
(forward-line 0)
(insert "X-Now-Playing: " track)))))

(add-hook 'message-setup-hook 'audacious-now-playing)

The way I adapted this existing bit of code, the unless condition does
not work like intended and I end up with a "X-Now-Playing: No song
playing." x-header in emails.

I would appreciate it if someone could point out what I'm doing
wrong.

Thx

Gijs






--
Homer: Someday you'll thank me for this, son.
Bart: Not bloody likely.
-- "Itchy and Scratchy: The Movie"
.



Relevant Pages

  • Re: Advice to absolute beginner.
    ... the highest level general purpose programming language ... MV> easier to learn for the beginner. ... but lisp interactivity is very nice for beginners - they can try different ...
    (comp.programming)
  • Re: Stop thinking in C
    ... >> Programming does just that. ... I teaches Lisp by applying it to some ... > and start out with very simple CLOS usage instead. ... a beginner to lose their objects at the end of a session. ...
    (comp.lang.lisp)
  • Re: LISPPA
    ... > memory resources. ... do in Common Lisp with code that runs about as fast. ... >> comparing Lisp with languages like C, Pascal and Basic, ... If by "visual programming" you mean the sort of ...
    (comp.lang.lisp)
  • Re: How Common Lisp sucks
    ... I could list some web servers written in Common Lisp. ... If a programming infrastructure fails ... underpinning than the p* languages. ...
    (comp.lang.lisp)
  • Re: LISPPA
    ... >> memory resources. ... > do in Common Lisp with code that runs about as fast. ... in "weaks languages": iteration instead of recursion and "local" ... I'm programming in Pascal since 1990 year, ...
    (comp.lang.lisp)