branch: master commit 0b85b6001a42dfce2906cd5ff66b849c44ed1aa1 Author: Alexey Veretennikov <alexey.veretenni...@gmail.com> Commit: Alexey Veretennikov <alexey.veretenni...@gmail.com>
1) Fixed issue #5 - removed empty line in the beginning of buffer 2) Added Tips & Tricks section to the README.md file --- README.md | 13 +++++++++++++ loccur.el | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cea09cd..bfb9acd 100644 --- a/README.md +++ b/README.md @@ -48,3 +48,16 @@ Below is the list of interactive commands available for user: * `loccur-jump-beginning-of-line` variable specifies if move the cursor to the beginning of the matching line. Default `nil` * `loccur-highlight-matching-regexp` variable whenever `loccur` should highlight matching words. Default `t`. * `loccur-face` face to be used while highlighting. Default points to `isearch` face. + +### Tips and tricks +To combine **Loccur** and **isearch** functionality (narrowing-search) one can use the following hooks: +```lisp +(add-hook 'isearch-update-post-hook + (lambda () + (let ((loccur-mode nil)) + (loccur (regexp-quote isearch-string))))) + +(add-hook 'isearch-mode-end-hook + (lambda () + (loccur nil))) +``` diff --git a/loccur.el b/loccur.el index 2b4c543..2cd7bee 100644 --- a/loccur.el +++ b/loccur.el @@ -5,7 +5,7 @@ ;; Author: Alexey Veretennikov <alexey.veretenni...@gmail.com> ;; ;; Created: 2009-09-08 -;; Version: 1.2.2 +;; Version: 1.2.3 ;; Package-Requires: ((cl-lib "0")) ;; Keywords: matching ;; URL: https://github.com/fourier/loccur @@ -46,6 +46,9 @@ ;; ;;; Change Log: ;; +;; 2016-12-26 (1.2.3) +;; + Removed empty line in the beginning of the buffer. +;; + Added 'Tips and tricks' session to the README.md file ;; 2015-12-27 (1.2.2) ;; + Preparation for GNU ELPA submission. Removed contributions ;; without signed papers @@ -279,6 +282,7 @@ REGEX is an argument to `loccur'." (let ((prev-end (point-min)) (overlays (list))) (when buffer-matches + (push (list 1 (caar buffer-matches)) overlays) (mapc (lambda (line) (let ((beginning (car line))) (unless ( = (- beginning prev-end) 1)