Commit 348e1411 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

(sh-mark-init): Don't set `occur-buffer'.

(sh-mark-line): Likewise. Use 'occur-target and 'occur-match instead of 'occur
and 'occur-point.
parent 123d5548
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
* replace.el (occur-find-match): New function. * replace.el (occur-find-match): New function.
(occur-next, occur-prev): Use it. (occur-next, occur-prev): Use it.
* progmodes/sh-script.el (sh-mark-init): Don't set `occur-buffer'.
(sh-mark-line): Likewise. Use 'occur-target and 'occur-match
instead of 'occur and 'occur-point.
2002-09-23 Kenichi Handa <handa@etl.go.jp> 2002-09-23 Kenichi Handa <handa@etl.go.jp>
* international/quail.el (quail-completion): Be sure to scroll * international/quail.el (quail-completion): Be sure to scroll
......
...@@ -2655,13 +2655,11 @@ unless optional argument ARG (the prefix when interactive) is non-nil." ...@@ -2655,13 +2655,11 @@ unless optional argument ARG (the prefix when interactive) is non-nil."
(defun sh-mark-init (buffer) (defun sh-mark-init (buffer)
"Initialize a BUFFER to be used by `sh-mark-line'." "Initialize a BUFFER to be used by `sh-mark-line'."
(let ((main-buffer (current-buffer))) (save-excursion
(save-excursion (set-buffer (get-buffer-create buffer))
(set-buffer (get-buffer-create buffer)) (erase-buffer)
(erase-buffer) (occur-mode)
(occur-mode) ))
(setq occur-buffer main-buffer)
)))
(defun sh-mark-line (message point buffer &optional add-linenum occur-point) (defun sh-mark-line (message point buffer &optional add-linenum occur-point)
...@@ -2671,7 +2669,6 @@ If ADD-LINENUM is non-nil the message is preceded by the line number. ...@@ -2671,7 +2669,6 @@ If ADD-LINENUM is non-nil the message is preceded by the line number.
If OCCUR-POINT is non-nil then the line is marked as a new occurrence If OCCUR-POINT is non-nil then the line is marked as a new occurrence
so that `occur-next' and `occur-prev' will work." so that `occur-next' and `occur-prev' will work."
(let ((m1 (make-marker)) (let ((m1 (make-marker))
(main-buffer (current-buffer))
start start
(line "")) (line ""))
(when point (when point
...@@ -2683,7 +2680,6 @@ so that `occur-next' and `occur-prev' will work." ...@@ -2683,7 +2680,6 @@ so that `occur-next' and `occur-prev' will work."
(set-buffer (get-buffer buffer)) (set-buffer (get-buffer buffer))
(set-buffer (get-buffer-create buffer)) (set-buffer (get-buffer-create buffer))
(occur-mode) (occur-mode)
(setq occur-buffer main-buffer)
) )
(goto-char (point-max)) (goto-char (point-max))
(setq start (point)) (setq start (point))
...@@ -2699,10 +2695,10 @@ so that `occur-next' and `occur-prev' will work." ...@@ -2699,10 +2695,10 @@ so that `occur-next' and `occur-prev' will work."
(insert "\n") (insert "\n")
(if point (if point
(progn (progn
(put-text-property start (point) 'occur m1) (put-text-property start (point) 'occur-target m1)
(if occur-point (if occur-point
(put-text-property occur-point (1+ occur-point) (put-text-property start occur-point
'occur-point t)) 'occur-match t))
)) ))
))) )))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment