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

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

Re: DWIM region (was: Re: count regexp hits)


From: Marcin Borkowski
Subject: Re: DWIM region (was: Re: count regexp hits)
Date: Sun, 07 Jan 2018 08:21:10 +0100
User-agent: mu4e 0.9.19; emacs 27.0.50

On 2018-01-07, at 07:45, Emanuel Berg <address@hidden> 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



reply via email to

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