Permalink
Browse files

trust only text-property. --context option destroy simple matching me…

…chanism.
  • Loading branch information...
1 parent 5b80f07 commit 06912ca371450d0410c3c9f10aeb3444009730a5 @mhayashi1120 mhayashi1120 committed Oct 5, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 wgrep.el
View
@@ -689,6 +689,7 @@ This change will be applied when \\[wgrep-finish-edit]."
(wgrep-inhibit-modification-hook t)
buffer-read-only beg end)
;; Set read-only grep result header
+ (goto-char (point-min))
(setq beg (point-min))
(when (re-search-forward "^Grep " nil t)
;; See `compilation-start'
@@ -777,9 +778,10 @@ This change will be applied when \\[wgrep-finish-edit]."
(defun wgrep-current-header ()
(save-excursion
(forward-line 0)
- ;;TODO obsolete to use wgrep-line-file-regexp here. to use text property
- (when (looking-at wgrep-line-file-regexp)
- (match-string-no-properties 0))))
+ (let ((f (get-text-property (point) 'wgrep-line-filename))
+ (n (get-text-property (point) 'wgrep-line-number)))
+ (when (and f n)
+ (format "^%s\\([:-]\\)%s\\1" f n)))))
(defun wgrep-get-old-text (file number)
(when (and wgrep-each-other-buffer

0 comments on commit 06912ca

Please sign in to comment.