[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master aa1e119 07/40: Removed cl dependency
From: |
Alexey Veretennikov |
Subject: |
[elpa] master aa1e119 07/40: Removed cl dependency |
Date: |
Fri, 29 Jan 2016 23:29:30 +0000 |
branch: master
commit aa1e1193ffafe932031d1820612090543a1a5fbb
Author: Alexey Veretennikov <address@hidden>
Commit: Alexey Veretennikov <address@hidden>
Removed cl dependency
---
loccur.el | 118 +++++++++++++++++++++++++++++++------------------------------
1 files changed, 60 insertions(+), 58 deletions(-)
diff --git a/loccur.el b/loccur.el
index d45cc8f..13b934c 100644
--- a/loccur.el
+++ b/loccur.el
@@ -1,13 +1,13 @@
;;; loccur.el --- Perform an occur-like folding in current buffer
-;; Copyright (C) 2009 Alexey Veretennikov
+;; Copyright (C) 2009-2012 Alexey Veretennikov
;;
;; Author: Alexey Veretennikov <alexey dot veretennikov at gmail dot com>
;; Created: 2009-09-08
-;; Version: 1.1.1
+;; Version: 1.1.2
;; Keywords: matching
;; URL: http://loccur.sourceforge.net/
-;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
+;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x, 24.x
;;
;; This file is NOT part of GNU Emacs.
;;
@@ -44,6 +44,10 @@
;;
;;; Change Log:
;;
+;; 2012-09-25 (1.1.2)
+;; + Removed cl dependency
+;;
+;;
;; 2010-03-07 (1.1.1)
;; + Default value is taken from prompt instead of an edit area
;; (thanks to Nathaniel Flath)
@@ -60,14 +64,12 @@
;;
;;; Code:
-(eval-when-compile (require 'cl))
-
(defconst loccur-overlay-property-name 'loccur-custom-buffer-grep)
(or (assq 'loccur-mode minor-mode-alist)
(nconc minor-mode-alist
- (list '(loccur-mode loccur-mode))))
+ (list '(loccur-mode loccur-mode))))
(defvar loccur-mode nil) ;; name of the minor mode
@@ -91,15 +93,15 @@
(defun loccur-mode (regex)
(setq loccur-mode
- (if (or loccur-mode
- (null regex)
- (zerop (length regex)))
- nil
- " Loccur"))
+ (if (or loccur-mode
+ (null regex)
+ (zerop (length regex)))
+ nil
+ " Loccur"))
(force-mode-line-update)
(loccur-remove-overlays)
(when loccur-mode
- (loccur-1 regex)))
+ (loccur-1 regex)))
(defun loccur-current ()
@@ -124,8 +126,8 @@ unhides lines again"
(interactive
(if loccur-mode
(list nil)
- (list (read-string (concat "Regexp<" (loccur-prompt)
- ">: ") "" 'loccur-history ))))
+ (list (read-string (concat "Regexp<" (loccur-prompt)
+ ">: ") "" 'loccur-history ))))
(if (string-equal "" regex) (setq regex (loccur-prompt)))
(loccur-mode regex))
@@ -151,38 +153,38 @@ 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
- (loccur-create-invisible-overlays ovl-bounds))
+ (ovl-bounds (loccur-create-overlay-bounds-btw-lines buffer-matches)))
+ (setq loccur-overlay-list
+ (loccur-create-invisible-overlays ovl-bounds))
(setq loccur-overlay-list
(append loccur-overlay-list
(loccur-create-highlighted-overlays buffer-matches)))
(setq loccur-last-match regex)
- (recenter)))
+ (recenter)))
(defun loccur-create-highlighted-overlays(buffer-matches)
(let ((overlays
- (map 'list #'(lambda (match)
- (make-overlay
- (nth 1 match)
- (nth 2 match)
- (current-buffer) t nil))
- buffer-matches)))
- (mapcar (lambda (ovl)
+ (mapcar (lambda (match)
+ (make-overlay
+ (nth 1 match)
+ (nth 2 match)
+ (current-buffer) t nil))
+ buffer-matches)))
+ (mapcar (lambda (ovl)
(overlay-put ovl loccur-overlay-property-name t)
- (overlay-put ovl 'face 'isearch))
+ (overlay-put ovl 'face 'isearch))
overlays)))
(defun loccur-create-invisible-overlays (ovl-bounds)
(let ((overlays
- (map 'list #'(lambda (bnd)
- (make-overlay
- (car bnd)
- (cadr bnd)
- (current-buffer) t nil))
- ovl-bounds)))
- (mapcar (lambda (ovl)
+ (mapcar (lambda (bnd)
+ (make-overlay
+ (car bnd)
+ (cadr bnd)
+ (current-buffer) t nil))
+ ovl-bounds)))
+ (mapcar (lambda (ovl)
(overlay-put ovl loccur-overlay-property-name t)
(overlay-put ovl 'invisible t)
;; force intangible property if invisible property
@@ -198,18 +200,18 @@ if its size is 1 line"
(defun loccur-create-overlay-bounds-btw-lines (buffer-matches)
(let ((prev-end (point-min))
- (overlays (list)))
- (when buffer-matches
- (mapcar (lambda (line)
+ (overlays (list)))
+ (when buffer-matches
+ (mapcar (lambda (line)
(let ((beginning (car line)))
(unless ( = (- beginning prev-end) 1)
(let ((ovl-start (if (= prev-end 1) 1 prev-end))
- (ovl-end (1- beginning)))
+ (ovl-end (1- beginning)))
(push (list ovl-start ovl-end) overlays)))
(setq prev-end (nth 3 line))))
buffer-matches)
- (push (list (1+ prev-end) (point-max)) overlays)
- (setq overlays (nreverse overlays)))))
+ (push (list (1+ prev-end) (point-max)) overlays)
+ (setq overlays (nreverse overlays)))))
(defun loccur-find-matches (regex)
@@ -217,19 +219,19 @@ if its size is 1 line"
1st match begin of a line, 1st match end of a line, end of a line
containing match"
(save-excursion
- ;; Go to the beginnig of buffer
- (goto-char (point-min))
- ;; Set initial values for variables
- (let ((matches 0)
- (curpoint nil)
- (endpoint nil)
- (lines (list)))
- ;; Search loop
- (while (not (eobp))
- (setq curpoint (point))
- ;; if something found
- (when (setq endpoint (re-search-forward regex nil t))
- (save-excursion
+ ;; Go to the beginnig of buffer
+ (goto-char (point-min))
+ ;; Set initial values for variables
+ (let ((matches 0)
+ (curpoint nil)
+ (endpoint nil)
+ (lines (list)))
+ ;; Search loop
+ (while (not (eobp))
+ (setq curpoint (point))
+ ;; if something found
+ (when (setq endpoint (re-search-forward regex nil t))
+ (save-excursion
(let ((found-begin (match-beginning 0))
(found-end (match-end 0)))
;; Get the start and the and of the matching line
@@ -237,12 +239,12 @@ containing match"
(goto-char found-begin)
(setq endpoint (line-end-position))
(push (list (line-beginning-position) found-begin found-end
endpoint) lines)))
- ;; maybe add some code to highlight matches like in
occur-mode?
- ;; goto the end of line for any case
- (goto-char endpoint))
- (forward-line 1))
- (setq lines (nreverse lines)))))
+ ;; maybe add some code to highlight matches like in occur-mode?
+ ;; goto the end of line for any case
+ (goto-char endpoint))
+ (forward-line 1))
+ (setq lines (nreverse lines)))))
(provide 'loccur)
-;;; loccur.el ends here
\ No newline at end of file
+;;; loccur.el ends here
- [elpa] master updated (ada08b0 -> 8f6fe36), Alexey Veretennikov, 2016/01/29
- [elpa] master b84471a 01/40: Initial revision, v1.0, Alexey Veretennikov, 2016/01/29
- [elpa] master 915846a 03/40: Removed implemented TODO note from comments, Alexey Veretennikov, 2016/01/29
- [elpa] master 1a1fb1a 02/40: + Added highlighting of the matched strings, Alexey Veretennikov, 2016/01/29
- [elpa] master d6f5c06 04/40: Applied patch by Nathaniel Flath:, Alexey Veretennikov, 2016/01/29
- [elpa] master f73cf0e 05/40: Added README file, Alexey Veretennikov, 2016/01/29
- [elpa] master 8ee09a7 06/40: Updated markdown syntax, Alexey Veretennikov, 2016/01/29
- [elpa] master 6e0c960 08/40: Changed URL, Alexey Veretennikov, 2016/01/29
- [elpa] master aa1e119 07/40: Removed cl dependency,
Alexey Veretennikov <=
- [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, 2016/01/29