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

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

Re: Counting SLOC in Emacs


From: Phillip Lord
Subject: Re: Counting SLOC in Emacs
Date: Fri, 28 Nov 2014 16:46:20 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

My own m-buffer.el was designed (partly) for this form of 
manipulation. So, it would be something like...

(- 
 (length (m-buffer-match-line (current-buffer)))
 (length (m-buffer-match-empty-line (current-buffer))))

I haven't written a "match-comment" function yet, but will probably add
it now that you mention it. It's easy enough to do.

Phil


Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Hello,
>
> there is count-lines-region, but I'd like to exclude empty lines and
> lines with only comments.  Is there anything like that?  (If not, I'll
> try to hack it myself and share.)
>
> TIA,

-- 
Phillip Lord,                           Phone: +44 (0) 191 208 7827
Lecturer in Bioinformatics,             Email: phillip.lord@newcastle.ac.uk
School of Computing Science,            
http://homepages.cs.ncl.ac.uk/phillip.lord
Room 914 Claremont Tower,               skype: russet_apples
Newcastle University,                   twitter: phillord
NE1 7RU                                 



reply via email to

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