[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 8aef9f0 19/40: Added customizable option to jump to the be
From: |
Alexey Veretennikov |
Subject: |
[elpa] master 8aef9f0 19/40: Added customizable option to jump to the beginnig of the line in loccur mode: loccur-jump-beginning-of-line |
Date: |
Fri, 29 Jan 2016 23:29:39 +0000 |
branch: master
commit 8aef9f046e353700b708b5f59301e2925be94e32
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Added customizable option to jump to the beginnig of the line in loccur
mode: loccur-jump-beginning-of-line
---
loccur.el | 19 +++++++++++--------
1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/loccur.el b/loccur.el
index 3f0dfaf..753a62a 100644
--- a/loccur.el
+++ b/loccur.el
@@ -65,7 +65,6 @@
;;
;;; Code:
-(eval-when-compile (require 'cl))
(defconst loccur-overlay-property-name 'loccur-custom-buffer-grep)
@@ -76,6 +75,9 @@
regex is highlighted. Use loccur-toggle-highlight to modify its
value interactively.")
+(defcustom loccur-jump-beginning-of-line nil
+ "Determines if cursor shall be at the beginning of the line
+when the loccur function is called.")
(defun loccur-toggle-highlight()
"Toggles the highlighting of the part of the line matching the
@@ -139,7 +141,7 @@ regex given in the loccur buffer."
(make-variable-buffer-local 'loccur-overlay-list)
(defun loccur-create-highlighted-overlays(buffer-matches)
- (let ((overlays
+ (let ((overlays
(map 'list #'(lambda (match)
(make-overlay
(nth 1 match)
@@ -148,21 +150,21 @@ regex given in the loccur buffer."
buffer-matches)))
;; To possibly remove highlighting of the matching regexp
(if loccur-highlight-matching-regexp
- (mapcar (lambda (ovl)
+ (mapcar (lambda (ovl)
(overlay-put ovl loccur-overlay-property-name t)
(overlay-put ovl 'face 'isearch))
overlays))))
(defun loccur-create-invisible-overlays (ovl-bounds)
- (let ((overlays
+ (let ((overlays
(map 'list #'(lambda (bnd)
(make-overlay
(car bnd)
(cadr bnd)
(current-buffer) t nil))
ovl-bounds)))
- (mapcar (lambda (ovl)
+ (mapcar (lambda (ovl)
(overlay-put ovl loccur-overlay-property-name t)
(overlay-put ovl 'invisible t)
;; force intangible property if invisible property
@@ -201,14 +203,15 @@ expression REGEX
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"
- (interactive
+ (interactive
(if loccur-mode
(list nil)
(list (read-string (concat "Regexp<" (loccur-prompt)
">: ") "" 'loccur-history ))))
(if (string-equal "" regex) (setq regex (loccur-prompt)))
(loccur-toggle-mode regex)
- (beginning-of-line)) ; Handier to be at the beginning of line
+ (when loccur-jump-beginning-of-line
+ (beginning-of-line))) ; optionally jump to the beginning of line
@@ -239,7 +242,7 @@ if its size is 1 line"
(defun loccur-1 (regex)
(let* ((buffer-matches (loccur-find-matches regex))
(ovl-bounds (loccur-create-overlay-bounds-btw-lines buffer-matches)))
- (setq loccur-overlay-list
+ (setq loccur-overlay-list
(loccur-create-invisible-overlays ovl-bounds))
(setq loccur-overlay-list
(append loccur-overlay-list
- [elpa] master aa1e119 07/40: Removed cl dependency, (continued)
- [elpa] master aa1e119 07/40: Removed cl dependency, Alexey Veretennikov, 2016/01/29
- [elpa] master 5859be9 09/40: Recenter on exit from loccur-mode, Alexey Veretennikov, 2016/01/29
- [elpa] master a1e135a 12/40: Added loccur-no-highlight function., Alexey Veretennikov, 2016/01/29
- [elpa] master 440c96e 10/40: Added possibility of desactivating regex highlighting., Alexey Veretennikov, 2016/01/29
- [elpa] master 2bc08c6 14/40: Updated change log in the loccur.el file., Alexey Veretennikov, 2016/01/29
- [elpa] master 9b5d16c 13/40: Added detailed info on the README file., Alexey Veretennikov, 2016/01/29
- [elpa] master e9d4714 15/40: Fixed displaying problems on github caused by the README file., Alexey Veretennikov, 2016/01/29
- [elpa] master 409b322 11/40: Rewrote the minor-mode using the define-minor-mode macro and added RET, Alexey Veretennikov, 2016/01/29
- [elpa] master d279b6a 16/40: Added internal link to the "quick navigation" in the README file., Alexey Veretennikov, 2016/01/29
- [elpa] master b1b1d91 18/40: Updated version, Alexey Veretennikov, 2016/01/29
- [elpa] master 8aef9f0 19/40: Added customizable option to jump to the beginnig of the line in loccur mode: loccur-jump-beginning-of-line,
Alexey Veretennikov <=
- [elpa] master ab4804a 20/40: Removed some cl dependencies; version changed to 1.2.1, Alexey Veretennikov, 2016/01/29
- [elpa] master cb7f8ac 17/40: Merge pull request #1 from picarresursix/master, Alexey Veretennikov, 2016/01/29
- [elpa] master 7d19c16 22/40: Preparation to move to GNU ELPA., Alexey Veretennikov, 2016/01/29
- [elpa] master 8ffd028 23/40: Preparation to move to GNU ELPA., Alexey Veretennikov, 2016/01/29
- [elpa] master 43cbc15 21/40: Fixed checkdoc issues, Alexey Veretennikov, 2016/01/29
- [elpa] master b6655e3 24/40: Preparation to move to GNU ELPA., Alexey Veretennikov, 2016/01/29
- [elpa] master 900eb51 26/40: Preparation to move to GNU ELPA., Alexey Veretennikov, 2016/01/29
- [elpa] master f95c8d6 28/40: Preparation to move to GNU ELPA., Alexey Veretennikov, 2016/01/29
- [elpa] master 359fae1 25/40: Preparation to move to GNU ELPA., Alexey Veretennikov, 2016/01/29
- [elpa] master 194dd68 30/40: Reimplemented loccur-no-highlight and fixed checkdoc, Alexey Veretennikov, 2016/01/29