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: Marcin Borkowski
Subject: Re: Counting SLOC in Emacs
Date: Tue, 02 Dec 2014 23:10:13 +0100

On 2014-12-02, at 21:43, Robert Thorpe wrote:

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
>
>>>      (* foo bar
>>>       * baz *)
>>>
>>> will count as 1 lines, IIUC.  And similarly
>>>
>>>      printf ("toto\n"); (* foo bar
>>>                          * baz *)
>>>
>>> will count as 2 lines.  You might want to try something like:
>>
>> Hm.  Didn't think of this.  (I'm not really accustomed to multi-line
>> comments, I guess.)
>
> I think for practical purposes it's best to use script like David
> Wheeler's SLOCount called from Emacs.

Not really: Elisp-only solution has a few benefits:

1. portability
2. it adapts itself automatically to langauges which can be parsed by
Emacs modes.
3. maybe speed (C might be faster, but with Elisp you don't have to
start a process - this might require some measurement, though).

> Re-writing it in Elisp is an interesting exercise though.

4. Exactly, a good way to learn/teach something about how Emacs (and its
language modes) work.

> BR,
> Robert Thorpe

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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