[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm de07b116fe 1/2: Fix helm-occur when previous mark is
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm de07b116fe 1/2: Fix helm-occur when previous mark is outside active region |
Date: |
Wed, 27 Jul 2022 16:58:37 -0400 (EDT) |
branch: elpa/helm
commit de07b116fee4ed0f3512324bd5b2f36c4b2f3377
Author: Renato Ferreira <renatofdds@gmail.com>
Commit: Renato Ferreira <renatofdds@gmail.com>
Fix helm-occur when previous mark is outside active region
---
helm-occur.el | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/helm-occur.el b/helm-occur.el
index 14a831b645..ad269ded43 100644
--- a/helm-occur.el
+++ b/helm-occur.el
@@ -211,11 +211,15 @@ engine beeing completely different and also much faster."
;; When user mark defun with `mark-defun' with intention of
;; using helm-occur on this region, it is relevant to use the
;; thing-at-point located at previous position which have been
- ;; pushed to `mark-ring'.
- (setq def (save-excursion
- (goto-char (setq pos (car mark-ring)))
- (helm-aif (thing-at-point 'symbol) (regexp-quote it))))
- (narrow-to-region (region-beginning) (region-end)))
+ ;; pushed to `mark-ring', if it's within the active region.
+ (let ((beg (region-beginning))
+ (end (region-end))
+ (prev-pos (car mark-ring)))
+ (when (and prev-pos (>= prev-pos beg) (< prev-pos end))
+ (setq def (save-excursion
+ (goto-char (setq pos prev-pos))
+ (helm-aif (thing-at-point 'symbol) (regexp-quote
it)))))
+ (narrow-to-region beg end)))
(unwind-protect
(helm :sources 'helm-source-occur
:buffer "*helm occur*"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [nongnu] elpa/helm de07b116fe 1/2: Fix helm-occur when previous mark is outside active region,
ELPA Syncer <=