From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Counting SLOC in Emacs Date: Wed, 31 Dec 2014 14:25:13 +0100 Message-ID: <87h9wcne86.fsf@wmi.amu.edu.pl> References: <877fyfk1qn.fsf@wmi.amu.edu.pl> <8761dzjvcl.fsf@wmi.amu.edu.pl> <874mtjjt31.fsf@wmi.amu.edu.pl> <874mterueo.fsf@lifelogs.com> <87a9354jr9.fsf@gmail.com> <87oaqlnshc.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1420032340 9329 80.91.229.3 (31 Dec 2014 13:25:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 31 Dec 2014 13:25:40 +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 31 14:25:34 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Y6JHK-00086j-7F for geh-help-gnu-emacs@m.gmane.org; Wed, 31 Dec 2014 14:25:34 +0100 Original-Received: from localhost ([::1]:40201 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6JHJ-0004bi-LS for geh-help-gnu-emacs@m.gmane.org; Wed, 31 Dec 2014 08:25:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6JH5-0004bd-Jc for help-gnu-emacs@gnu.org; Wed, 31 Dec 2014 08:25:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y6JH1-0005Ob-JC for help-gnu-emacs@gnu.org; Wed, 31 Dec 2014 08:25:19 -0500 Original-Received: from msg.wmi.amu.edu.pl ([150.254.78.50]:51244) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y6JH1-0005OX-Ct for help-gnu-emacs@gnu.org; Wed, 31 Dec 2014 08:25:15 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id E3E41414AF for ; Wed, 31 Dec 2014 14:25:14 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xlP1JlXipw2O for ; Wed, 31 Dec 2014 14:25:14 +0100 (CET) Original-Received: from localhost (117-116.echostar.pl [213.156.117.116]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 8C82F42061 for ; Wed, 31 Dec 2014 14:25:14 +0100 (CET) In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 150.254.78.50 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:101792 Archived-At: On 2014-12-31, at 12:50, Leo Liu wrote: > On 2014-12-31 01:05 +1100, Marcin Borkowski wrote: >> I finally had some time to look into the code. Could you tell me why >> this? >> >> (unless (looking-at-p "^\\s-*$") > > It ignores blank lines as the doc-string says. Ah, my bad: it's \s- that matches whitespace, not \s. >> (line 46 in sloc.el)? If I get it correctly, it ignores blank lines >> /ending in any number of hyphens/ (possibly zero). Why? >> >> Also, this >> >> (let ((beg (min beg end)) >> (end (max beg end)) >> >> is probably not necessary, or do I miss something? > > Either I was being defensive or there were some cases that could have > end < beg. I guess that would not be possible, but I might be mistaken. > HTH, > Leo Yes, thanks! -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University