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

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

Re: cperl-mode


From: LanX
Subject: Re: cperl-mode
Date: Wed, 08 Dec 2010 15:10:04 -0000
User-agent: G2/1.0

Hi Ilya

> I'll gladly accept well-coded patches.  (This is a recurring request
> from the users.)


talking about "well coded", I'm still a beginner in elisp and
sometimes wondering about your code.

You use and handle around quite often array like lists where every
index represents something specific which needs to be documented each
time you access it.

for instance in the posted code:
-----------
 ((eq 'in-parens (elt i 0))
...
 (goto-char (elt i 2))            ; old-indent-point
...
 (if (and (elt i 3)         ; is-brace
-----------
where i is the return value from  cperl-sniff-for-indent'

So why don't you use alists or even hashes instead of documenting each
numerical index?

http://www.gnu.org/s/emacs/manual/html_node/elisp/Association-Lists.html

Are there technical reasons for avoiding alists?

And wouldn't calling the variable something like "sniff"  improve the
readability?

Cheers
  Rolf


reply via email to

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