From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: DWIM region (was: Re: count regexp hits) Date: Sun, 07 Jan 2018 08:21:10 +0100 Message-ID: <878tdaf82h.fsf@amu.edu.pl> References: <86shbmcldx.fsf@zoho.com> <86d12pcvgj.fsf@zoho.com> <86d12pb988.fsf_-_@zoho.com> <86a7xqupz0.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1515337180 7155 195.159.176.226 (7 Jan 2018 14:59:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 7 Jan 2018 14:59:40 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 27.0.50 Cc: help-gnu-emacs@gnu.org To: Emanuel Berg Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 07 15:59:36 2018 Return-path: Envelope-to: geh-help-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 1eYCQ9-0001NH-M7 for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Jan 2018 15:59:33 +0100 Original-Received: from localhost ([::1]:55724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eYCS9-0006RI-8g for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Jan 2018 10:01:37 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eY7Iv-00028M-7Q for help-gnu-emacs@gnu.org; Sun, 07 Jan 2018 04:31:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eY7Iq-0005Te-5e for help-gnu-emacs@gnu.org; Sun, 07 Jan 2018 04:31:45 -0500 Original-Received: from mx1.amu.edu.pl ([150.254.65.108]:39066) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eY7Ip-0005M3-NG for help-gnu-emacs@gnu.org; Sun, 07 Jan 2018 04:31:39 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mx1.amu.edu.pl (Postfix) with ESMTP id 42CDD1A14D7; Sun, 7 Jan 2018 10:30:52 +0100 (CET) X-Virus-Scanned: amavisd-new at amu.edu.pl Original-Received: from mx1.amu.edu.pl ([127.0.0.1]) by localhost (mx1.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SM3oF40IPgYM; Sun, 7 Jan 2018 10:30:52 +0100 (CET) Original-Received: from pp.amu.edu.pl (pp.amu.edu.pl [150.254.65.67]) by mx1.amu.edu.pl (Postfix) with ESMTPS; Sun, 7 Jan 2018 10:30:49 +0100 (CET) Original-Received: from localhost (pp.amu.edu.pl [127.0.0.1]) by pp.amu.edu.pl (Postfix) with ESMTP id 65EB566DDE; Sun, 7 Jan 2018 10:30:58 +0100 (CET) X-Virus-Scanned: amavisd-new at amu.edu.pl Original-Received: from pp.amu.edu.pl ([127.0.0.1]) by localhost (pp.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MRAVrqRWNDrZ; Sun, 7 Jan 2018 10:30:58 +0100 (CET) Original-Received: by pp.amu.edu.pl (Postfix, from userid 207) id 8688466EC9; Sun, 7 Jan 2018 10:44:43 +0100 (CET) Original-Received: from localhost (pp.amu.edu.pl [127.0.0.1]) by pp.amu.edu.pl (Postfix) with ESMTP id 22AA3671B7; Sun, 7 Jan 2018 08:21:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=amu.edu.pl; h= content-type:content-type:mime-version:message-id:date:date :in-reply-to:subject:subject:from:from:user-agent:references :received:received; s=pp; t=1515309671; x=1517124072; bh=FPS0jtC Zzl2bk6YhcWepzmqpLdDIFEiFPIROQbLTIFE=; b=NeSWma5Ofdq6HAjuKsmUEwa 3vz3eG+VgWpJJAp/hBIaewBVH7dK5JTxXi3C62jgsfA8v8buldPdrY2n6N+U+1iy ddL7p59CXsduBA0utKRa3zKWF+q4aAR0GYVR9YNMbJxdbzil4GmRM0JgxN6V1XfT hjhmmKf/n3O3teUKJsCk= X-Virus-Scanned: amavisd-new at amu.edu.pl Original-Received: from pp.amu.edu.pl ([127.0.0.1]) by localhost (pp.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id baYJY_DCOwfh; Sun, 7 Jan 2018 08:21:11 +0100 (CET) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by pp.amu.edu.pl (Postfix) with ESMTPSA id CA441671B5; Sun, 7 Jan 2018 08:21:10 +0100 (CET) In-reply-to: <86a7xqupz0.fsf@zoho.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 150.254.65.108 X-Mailman-Approved-At: Sun, 07 Jan 2018 10:00:51 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:115612 Archived-At: On 2018-01-07, at 07:45, Emanuel Berg wrote: > Marcin Borkowski wrote: > >> spacing is kind of strange. > > "spacing"? (defun count-regexp-hits (regexp) (interactive "sregexp: ") (let*((region (if mark-active `(,(region-beginning) ,(region-end)) `(,(point-min) ,(point-max)) )) (start (car region)) (end (cadr region)) ) (count-matches regexp start end t) )) 1. Lack of space after `let*'. 2. Unnecessary space before `))` (twice). 3. Unnecessary double spaces in lines with `start' and `end' (I understand their purpose, but my OCD does not like them anyway). Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University