[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 08aeadc 4/6: Merge pull request #4 from mookid/master
From: |
Alexey Veretennikov |
Subject: |
[elpa] master 08aeadc 4/6: Merge pull request #4 from mookid/master |
Date: |
Mon, 26 Dec 2016 14:14:36 +0000 (UTC) |
branch: master
commit 08aeadc69571bddf44f2708dd75f57c7e027d32f
Merge: fb1fbc0 e9b1e69
Author: Alexey Veretennikov <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #4 from mookid/master
Do something useful with the active region, if any.
---
loccur.el | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/loccur.el b/loccur.el
index 2921ba0..2b4c543 100644
--- a/loccur.el
+++ b/loccur.el
@@ -29,7 +29,7 @@
;;; Commentary:
;;
;; Add the following to your .emacs file:
-;;
+;;
;; (require 'loccur)
;; ;; defines shortcut for loccur of the current word
;; (define-key global-map [(control o)] 'loccur-current)
@@ -43,14 +43,14 @@
;; gives unexpected jumps in loccur mode
;;
;;; TODO:
-;;
+;;
;;; Change Log:
;;
;; 2015-12-27 (1.2.2)
;; + Preparation for GNU ELPA submission. Removed contributions
;; without signed papers
;; + added loccur-face - face to highlight text, by default isearch
-;;
+;;
;; 2013-10-22 (1.2.1)
;; + Added custom option loccur-jump-beginning-of-line; removed some
;; of cl dependencies
@@ -168,11 +168,19 @@ 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))))
+ (cond ((region-active-p)
+ (list (buffer-substring (mark) (point))))
+ (loccur-mode
+ (list nil))
+ (t
+ (list (read-string "Loccur: " (loccur-prompt) 'loccur-history)))))
+ (when (region-active-p) (deactivate-mark))
(if (or loccur-mode
(= (length regex) 0))
(progn
@@ -315,8 +323,8 @@ containing match"
(forward-line 1))
(setq lines (nreverse lines)))))
-
-
+
+
(provide 'loccur)
- [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 <=
- [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, 2016/12/26