[Top][All Lists]

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

Re: bug#21072: Brave new mark-defun (and a testing tool)

From: Marcin Borkowski
Subject: Re: bug#21072: Brave new mark-defun (and a testing tool)
Date: Wed, 15 Feb 2017 20:18:07 +0100
User-agent: mu4e 0.9.19; emacs

On 2017-02-15, at 08:56, Stefan Monnier <address@hidden> wrote:

>>>> Why?  It seems to me that it may be of general use.
>>> If you want it to be general, it'll have to be better defined.
>>> What is a "comment line"?
>> A line containing only a comment (possibly after whitespace).
> Is a line (using C syntax) like:
>     /* blablabla
> considered as a "comment line"?


> What about the likely next line:
>     blablabla */


> ?
> How about
>     blablabla
> on a line between the previous two (i.e. within a comment)?


(However, I found a minor bug: an empty line, even between a line "/*"
and another with "*/" is _not_ considered a comment line by my
function.  I'll try to fix it.

> Regardless of the answer you give above, I'm wondering in which kind of
> circumstance we'd want to test if we're on "a line containing only
> a comment".

You will be surprised, then, that I actually did use a very similar
function in completely another circumstance: a command that counts
source lines of code in a region, and excludes lines containing only
whitespace, comments and docstrings.  (Never mind the discussion about
whether SLOC is meaningful in any sense;-).)


Marcin Borkowski

reply via email to

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