[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] Run occur command restricted to a region
From: |
Eli Zaretskii |
Subject: |
Re: [patch] Run occur command restricted to a region |
Date: |
Thu, 29 Dec 2016 18:10:04 +0200 |
> From: Tino Calancha <address@hidden>
> Date: Thu, 29 Dec 2016 15:36:56 +0900
> Cc: address@hidden
>
> Any comment about this proposal?
I have one comment:
> +(defun occur-in-region (regexp &optional nlines)
> + "Show all lines in the active region containing a match for REGEXP.
> +Each line is displayed with NLINES lines before and after, or -NLINES
> +before if NLINES is negative.
> +As `occur' but restricted to lines within the active region."
> + (interactive (occur-read-primary-args "in region"))
> + (unless (use-region-p)
> + (error "Region not active"))
I think our convention for functions that act on the region is to
accept BEG and END arguments, so that the function could be called
from Lisp. The 'interactive' form/spec should then provide these
arguments for the interactive use.
Also, this will need a NEWS entry, and possibly also an addition to
the user manual.
Thanks.
Re: [patch] Run occur command restricted to a region, Juri Linkov, 2016/12/29