From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: LanX Newsgroups: gmane.emacs.help Subject: Re: cperl-mode Date: Wed, 26 May 2010 05:41:24 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2a0a7047-053d-4298-bcc8-c692a833c1fc@i31g2000vbt.googlegroups.com> References: <874ohy7yy1.fsf@castleamber.com> <0964e194-b8a7-4588-b686-d5e4c501262a@b21g2000vbh.googlegroups.com> <87d3wl3ut4.fsf@castleamber.com> <88d2f588-6826-447b-9a14-8ea1d827c44e@o15g2000vbb.googlegroups.com> <87iq6dc5ln.fsf@castleamber.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1291823060 30419 80.91.229.12 (8 Dec 2010 15:44:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 8 Dec 2010 15:44:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 08 16:44:16 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQMBg-0004C9-9L for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 16:44:12 +0100 Original-Received: from localhost ([127.0.0.1]:50126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQMBf-0001np-Lm for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 10:44:11 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!i31g2000vbt.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Original-NNTP-Posting-Host: 89.247.174.216 Original-X-Trace: posting.google.com 1274877684 6826 127.0.0.1 (26 May 2010 12:41:24 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 26 May 2010 12:41:24 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i31g2000vbt.googlegroups.com; posting-host=89.247.174.216; posting-account=W9fpQwoAAADZYmkl-8sXk1VPxG3rq-Pd User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.19) Gecko/2010040118 Ubuntu/8.10 (intrepid) Firefox/3.0.19,gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:178426 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:75552 Archived-At: 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