help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Clever way to do this?


From: Deniz Dogan
Subject: Clever way to do this?
Date: Thu, 28 Jul 2011 16:55:54 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0

I have a command like this:

(defun ftip-rate-movie (rating)
  (interactive
   (list
    (if (not ftip-movie-id)
        (error "Not viewing movie")
(completing-read "Rating: " '("1" "2" "3" "4" "5" "Remove rating") nil t))))
  (unless ftip-movie-id
    (error "Not viewing movie"))

  ;; ...code here
  )

Is there any more intelligent way to do this? I'm not too keen on the code duplication.

Thanks,
Deniz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]