From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.help Subject: Clever way to do this? Date: Thu, 28 Jul 2011 16:55:54 +0200 Message-ID: <4E31787A.6080604@dogan.se> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1311864995 23381 80.91.229.12 (28 Jul 2011 14:56:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 28 Jul 2011 14:56:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 28 16:56:32 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QmS0k-0002vO-Qh for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jul 2011 16:56:30 +0200 Original-Received: from localhost ([::1]:50948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmS0k-00023D-6B for geh-help-gnu-emacs@m.gmane.org; Thu, 28 Jul 2011 10:56:30 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmS0f-00022y-7H for help-gnu-emacs@gnu.org; Thu, 28 Jul 2011 10:56:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QmS0d-0001bR-Qo for help-gnu-emacs@gnu.org; Thu, 28 Jul 2011 10:56:24 -0400 Original-Received: from ch-smtp04.sth.basefarm.net ([80.76.153.5]:41835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmS0d-0001aF-Iq for help-gnu-emacs@gnu.org; Thu, 28 Jul 2011 10:56:23 -0400 Original-Received: from c80-216-105-155.bredband.comhem.se ([80.216.105.155]:54881 helo=[192.168.0.10]) by ch-smtp04.sth.basefarm.net with esmtp (Exim 4.76) (envelope-from ) id 1QmS0P-0004Jc-Dh for help-gnu-emacs@gnu.org; Thu, 28 Jul 2011 16:56:10 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 X-Originating-IP: 80.216.105.155 X-Scan-Result: No virus found in message 1QmS0P-0004Jc-Dh. X-Scan-Signature: ch-smtp04.sth.basefarm.net 1QmS0P-0004Jc-Dh 5db67796ce392c0b36d85b921d94e9c8 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.76.153.5 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81840 Archived-At: 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