;; Copyright (C) 2010, 2011, 2012 Victor Ren
-;; Time-stamp: <2012-09-12 15:22:33 Victor Ren>
+;; Time-stamp: <2012-10-22 14:14:53 Victor Ren>
;; Author: Victor Ren <victorhge@gmail.com>
;; Keywords: occurrence region simultaneous refactoring
;; Version: 0.97
(setq iedit-only-complete-symbol-local complete-symbol)
(setq mark-active nil)
(run-hooks 'deactivate-mark-hook)
+ (setq iedit-initial-string-local occurrence)
(iedit-start (iedit-regexp-quote occurrence) beg end))))
(defun iedit-mode-from-isearch (regexp)
(isearch-regexp isearch-string)
(t (regexp-quote isearch-string)))))
(list regexp)))
+ (if (or isearch-regexp isearch-word)
+ nil
+ (setq iedit-initial-string-local isearch-string))
(isearch-exit)
+ (setq mark-active nil)
+ (run-hooks 'deactivate-mark-hook)
(iedit-start regexp (point-min) (point-max))
;; TODO: reconsider how to avoid the loop in iedit-same-length
(if (iedit-same-length)
(defun iedit-start (occurrence-regexp beg end)
"Start Iedit mode for the `occurrence-regexp' in the current buffer."
(setq iedit-unmatched-lines-invisible iedit-unmatched-lines-invisible-default)
- (setq iedit-initial-string-local occurrence-regexp)
(setq iedit-initial-region (list beg end))
(iedit-start2 occurrence-regexp beg end)
(run-hooks 'iedit-mode-hook)
(iedit-cleanup)
+ (setq iedit-initial-string-local nil)
(setq iedit-mode nil)
(force-mode-line-update)
(remove-hook 'kbd-macro-termination-hook 'iedit-done t)