emacs-devel
[Top][All Lists]
Advanced

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

Re: cperl-mode instead of perl-mode? (was Re: perl-mode indent bug)


From: Stuart D. Herring
Subject: Re: cperl-mode instead of perl-mode? (was Re: perl-mode indent bug)
Date: Wed, 12 Apr 2006 08:16:35 -0700 (PDT)
User-agent: SquirrelMail/1.4.3a-11.EL3

> 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.

How is that vestigial?  If you've run out of hits, pm will be nil, but
because you're still inside the let, the while can't exit.  So you need to
test pm, use it if it's not nil, and evaluate to nil if it is so the loop
will exit.  So what you have is fine, although I might recommend

(let (pm)
  (while (setq pm (rassoc ...))
    (setcdr pm ...)))

Davis

-- 
This product is sold by volume, not by mass.  If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.




reply via email to

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