From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: merlyn@stonehenge.com (Randal L. Schwartz) Newsgroups: gmane.emacs.devel Subject: Re: cperl-mode instead of perl-mode? (was Re: perl-mode indent bug) Date: 12 Apr 2006 08:21:06 -0700 Message-ID: <86irpeyg4d.fsf@blue.stonehenge.com> References: <86d5fn0xue.fsf@blue.stonehenge.com> <86odz7ylrz.fsf@blue.stonehenge.com> <40741.128.165.123.132.1144854995.squirrel@webmail.lanl.gov> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1144855354 15492 80.91.229.2 (12 Apr 2006 15:22:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 12 Apr 2006 15:22:34 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 12 17:22:31 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FThA2-0002HX-VW for ged-emacs-devel@m.gmane.org; Wed, 12 Apr 2006 17:21:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FThA2-00036C-85 for ged-emacs-devel@m.gmane.org; Wed, 12 Apr 2006 11:21:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FTh9b-0002zX-34 for emacs-devel@gnu.org; Wed, 12 Apr 2006 11:21:11 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FTh9Y-0002yK-LU for emacs-devel@gnu.org; Wed, 12 Apr 2006 11:21:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FTh9Y-0002yF-H8 for emacs-devel@gnu.org; Wed, 12 Apr 2006 11:21:08 -0400 Original-Received: from [209.223.236.162] (helo=blue.stonehenge.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FThEf-0004eH-Lj for emacs-devel@gnu.org; Wed, 12 Apr 2006 11:26:25 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by blue.stonehenge.com (Postfix) with ESMTP id 0AA928EB97; Wed, 12 Apr 2006 08:21:07 -0700 (PDT) Original-Received: from blue.stonehenge.com ([127.0.0.1]) by localhost (blue.stonehenge.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 13316-01-41; Wed, 12 Apr 2006 08:21:06 -0700 (PDT) Original-Received: by blue.stonehenge.com (Postfix, from userid 1001) id 49E928EBA2; Wed, 12 Apr 2006 08:21:06 -0700 (PDT) Original-To: herring@lanl.gov x-mayan-date: Long count = 12.19.13.3.15; tzolkin = 3 Men; haab = 8 Pop In-Reply-To: <40741.128.165.123.132.1144854995.squirrel@webmail.lanl.gov> Original-Lines: 28 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52770 Archived-At: >>>>> "Stuart" == Stuart D Herring writes: Randal> (while (let ((pm (rassoc 'perl-mode interpreter-mode-alist))) Randal> (and pm (setcdr pm 'cperl-mode)))) >> >> Heh. Just realized the (and ..) in there is vestigial. Nothing like >> posting >> code to force you to do a code-review about 20 seconds too late. Stuart> How is that vestigial? If you've run out of hits, pm will be nil, but Stuart> because you're still inside the let, the while can't exit. So you need to Stuart> test pm, use it if it's not nil, and evaluate to nil if it is so the loop Stuart> will exit. So what you have is fine, although I might recommend Stuart> (let (pm) Stuart> (while (setq pm (rassoc ...)) Stuart> (setcdr pm ...))) It's vestigial because my brain has parts that aren't linked to anything else. Thanks for explaining what I probably figured out originally. :) -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!