[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 341f8f1 2/6: Uses the active region, is any.
From: |
Alexey Veretennikov |
Subject: |
[elpa] master 341f8f1 2/6: Uses the active region, is any. |
Date: |
Mon, 26 Dec 2016 14:14:36 +0000 (UTC) |
branch: master
commit 341f8f1fed7d36c0a35265c70c5594d52332f07e
Author: mookid <address@hidden>
Commit: mookid <address@hidden>
Uses the active region, is any.
---
loccur.el | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/loccur.el b/loccur.el
index e1008ab..c48ce3e 100644
--- a/loccur.el
+++ b/loccur.el
@@ -168,11 +168,18 @@ REGEX is regexp to search"
This command hides all lines from the current buffer except those
containing the regular expression REGEX. A second call of the function
-unhides lines again"
+unhides lines again.
+
+When called interactively, either prompts the user for REGEXP or,
+when called with an active region, uses the content of the
+region."
(interactive
- (if loccur-mode
- (list nil)
- (list (read-string "Loccur: " (loccur-prompt) 'loccur-history))))
+ (if (region-active-p)
+ (list (buffer-substring (mark) (point)))
+ (if loccur-mode
+ (list nil)
+ (list (read-string "Loccur: " (loccur-prompt) 'loccur-history)))))
+ (when (region-active-p) (deactivate-mark))
(if (or loccur-mode
(= (length regex) 0))
(progn
- [elpa] master updated (5402f35 -> 78e24b7), Alexey Veretennikov, 2016/12/26
- [elpa] master e9b1e69 3/6: Refactor., Alexey Veretennikov, 2016/12/26
- [elpa] master 08aeadc 4/6: Merge pull request #4 from mookid/master, Alexey Veretennikov, 2016/12/26
- [elpa] master 0b85b60 5/6: 1) Fixed issue #5 - removed empty line in the beginning of buffer, Alexey Veretennikov, 2016/12/26
- [elpa] master 78e24b7 6/6: Updated to version 1.2.3, Alexey Veretennikov, 2016/12/26
- [elpa] master 9a3b1cc 1/6: Trim whitespaces., Alexey Veretennikov, 2016/12/26
- [elpa] master 341f8f1 2/6: Uses the active region, is any.,
Alexey Veretennikov <=