From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.bugs,gmane.emacs.devel Subject: bug#21072: Brave new mark-defun (and a testing tool) Date: Wed, 15 Feb 2017 20:18:07 +0100 Message-ID: <87efyze00g.fsf@jane> References: <87o9ydrzkr.fsf@mbork.pl> <87mvdriuss.fsf@mbork.pl> <87bmu6icea.fsf@mbork.pl> <87wpctgieu.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> <87tw7wh9sf.fsf@mbork.pl> <87k28sdka6.fsf@jane> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1487186301 13575 195.159.176.226 (15 Feb 2017 19:18:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 15 Feb 2017 19:18:21 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 26.0.50.5 Cc: 21072@debbugs.gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Feb 15 20:18:14 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce55h-0002Ur-2Z for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Feb 2017 20:18:13 +0100 Original-Received: from localhost ([::1]:42614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ce55h-0006Xk-D9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Feb 2017 14:18:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ce55W-0006WX-SG for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2017 14:18:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ce55W-0002Ih-0j for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2017 14:18:02 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ce55V-0002Id-Tt for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2017 14:18:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ce55V-00065Z-MF for bug-gnu-emacs@gnu.org; Wed, 15 Feb 2017 14:18:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 15 Feb 2017 19:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.148718625623374 (code B ref 21072); Wed, 15 Feb 2017 19:18:01 +0000 Original-Received: (at 21072) by debbugs.gnu.org; 15 Feb 2017 19:17:36 +0000 Original-Received: from localhost ([127.0.0.1]:41342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce556-00064w-J3 for submit@debbugs.gnu.org; Wed, 15 Feb 2017 14:17:36 -0500 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:53064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ce554-00064n-Qf for 21072@debbugs.gnu.org; Wed, 15 Feb 2017 14:17:35 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id E3F33E6A39; Wed, 15 Feb 2017 20:17:31 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 77zUnztwW1eC; Wed, 15 Feb 2017 20:17:29 +0100 (CET) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id F154AE6279; Wed, 15 Feb 2017 20:17:28 +0100 (CET) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:129392 gmane.emacs.devel:212404 Archived-At: On 2017-02-15, at 08:56, Stefan Monnier 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"? Yes. > What about the likely next line: > > blablabla */ Yes. > > ? > How about > > blablabla > > on a line between the previous two (i.e. within a comment)? Yes. (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;-).) Best, -- Marcin Borkowski