diff options
author | Juri Linkov <juri@jurta.org> | 2010-03-30 19:38:45 +0300 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2010-03-30 19:38:45 +0300 |
commit | 0ef84fc806f9f4c08f1ce0ba046fbc46af2ff9e6 (patch) | |
tree | c5ba8a21bbf48e47d48ad79ccb0d9952ce2a7620 /lisp/replace.el | |
parent | bd924a5d6cea9a17c4c46f6ce3ecdef875dad69f (diff) | |
download | emacs-0ef84fc806f9f4c08f1ce0ba046fbc46af2ff9e6.tar.gz |
* replace.el (occur-accumulate-lines): Move occur-engine related
functions `occur-accumulate-lines' and `occur-engine-add-prefix'
to be located after `occur-engine'.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r-- | lisp/replace.el | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 14a1869b4f9..487974073aa 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1005,23 +1005,6 @@ which means to discard all text properties." :group 'matching :version "22.1") -(defun occur-accumulate-lines (count &optional keep-props pt) - (save-excursion - (when pt - (goto-char pt)) - (let ((forwardp (> count 0)) - result beg end moved) - (while (not (or (zerop count) - (if forwardp - (eobp) - (and (bobp) (not moved))))) - (setq count (+ count (if forwardp -1 1))) - (setq beg (line-beginning-position) - end (line-end-position)) - (push (occur-engine-line beg end keep-props) result) - (setq moved (= 0 (forward-line (if forwardp 1 -1))))) - (nreverse result)))) - (defun occur-read-primary-args () (list (read-regexp "List lines matching regexp" (car regexp-history)) @@ -1175,12 +1158,6 @@ See also `multi-occur'." (set-buffer-modified-p nil) (run-hooks 'occur-hook))))))) -(defun occur-engine-add-prefix (lines) - (mapcar - #'(lambda (line) - (concat " :" line "\n")) - lines)) - (defun occur-engine (regexp buffers out-buf nlines case-fold-search title-face prefix-face match-face keep-props) (with-current-buffer out-buf @@ -1356,6 +1333,29 @@ See also `multi-occur'." str) (buffer-substring-no-properties beg end))) +(defun occur-engine-add-prefix (lines) + (mapcar + #'(lambda (line) + (concat " :" line "\n")) + lines)) + +(defun occur-accumulate-lines (count &optional keep-props pt) + (save-excursion + (when pt + (goto-char pt)) + (let ((forwardp (> count 0)) + result beg end moved) + (while (not (or (zerop count) + (if forwardp + (eobp) + (and (bobp) (not moved))))) + (setq count (+ count (if forwardp -1 1))) + (setq beg (line-beginning-position) + end (line-end-position)) + (push (occur-engine-line beg end keep-props) result) + (setq moved (= 0 (forward-line (if forwardp 1 -1))))) + (nreverse result)))) + ;; Generate context display for occur. ;; OUT-LINE is the line where the match is. ;; NLINES and KEEP-PROPS are args to occur-engine. |