[Top][All Lists]

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

Re: [patch] Run occur command restricted to a region

From: Juri Linkov
Subject: Re: [patch] Run occur command restricted to a region
Date: Sat, 21 Jan 2017 01:17:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu)

> OK.  Updated the patch.
> *)  First patch allow `occur' handle the region with the new convention,
>     i.e., region argument instead of BEG, END.

Thanks.  As a prerequisite I'm going to install this patch:

diff --git a/lisp/simple.el b/lisp/simple.el
index 3d25ec1..610846b 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1015,6 +1015,9 @@ (defvar region-extract-function
 If anything else, delete the region and return its content as a string,
 after filtering it with `filter-buffer-substring'.")
+(defun region-bounds ()
+  "Return the boundaries of the region as a list of (START . END) positions."
+  (funcall region-extract-function 'bounds))
 (defvar region-insert-function
   (lambda (lines)
     (let ((first t))

> **) The second patch add your suggestion on showing highlighted the
>     current line.  When there are matches after the current line, the
>     point in *Occur* is set right after such line.
> I am fine with just adding *).  In case we also want **),
> an option to enable/disable that behaviour might be desirable.

Keeping traditional behaviour means not jumping to the middle of the
*Occur* output by default.  Then maybe we could use the same option
to highlight the current line and to jump to it?  Like the existing
‘list-matching-lines-buffer-name-face’, adding a nil/face choice for
‘list-matching-lines-current-line-face’, so when it's nil then don't

reply via email to

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