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: Tue, 30 Dec 2014 15:05:03 +0100 Message-ID: <87oaqlnshc.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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1419948367 3719 80.91.229.3 (30 Dec 2014 14:06:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 30 Dec 2014 14:06:07 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Leo Liu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 30 15:05:58 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 1Y5xQq-0001Xp-Gw for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Dec 2014 15:05:56 +0100 Original-Received: from localhost ([::1]:37028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5xQp-0007NY-O2 for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Dec 2014 09:05:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5xQa-0007NT-Ms for help-gnu-emacs@gnu.org; Tue, 30 Dec 2014 09:05:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y5xQV-0001Kg-Tw for help-gnu-emacs@gnu.org; Tue, 30 Dec 2014 09:05:40 -0500 Original-Received: from msg.wmi.amu.edu.pl ([150.254.78.50]:40992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y5xQV-0001Ai-Bn for help-gnu-emacs@gnu.org; Tue, 30 Dec 2014 09:05:35 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 76F1A414A4; Tue, 30 Dec 2014 15:05:12 +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 uWk5fplgGfYN; Tue, 30 Dec 2014 15:05:12 +0100 (CET) Original-Received: from localhost (unknown [IPv6:2001:808:114:6:30dd:1b8a:cd0d:5911]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id 530D542061; Tue, 30 Dec 2014 15:05:12 +0100 (CET) In-reply-to: <87a9354jr9.fsf@gmail.com> 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:101769 Archived-At: On 2014-12-03, at 02:14, Leo Liu wrote: > On 2014-12-02 09:35 -0500, Ted Zlatanov wrote: >> This is useful. >> >> Could we have this added to `count-lines-region' with an optional >> parameter, or provided by `prog-mode' specifically? It even merits a >> modeline indicator that users can enable, I think. >> >> Ted > > I had such need last year but only used it a few days and then totally > forgotten (never needed again). The code is still here > https://github.com/leoliu/sloc.el/blob/master/sloc.el Hi, I finally had some time to look into the code. Could you tell me why this? (unless (looking-at-p "^\\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? > Leo Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University