]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/iedit.el
fix missing ) for org-mode
[lib.git] / emacs_el / iedit.el
index 9eea9c81c503170b394294378ce619dc9f7d911a..48d2122eb9c8e671c17c968cb2cde0e2d542da3f 100644 (file)
@@ -2,7 +2,7 @@
 
 ;; 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
@@ -340,6 +340,7 @@ Keymap used within overlays:
       (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)
@@ -352,7 +353,12 @@ Keymap used within overlays:
                   (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)
@@ -363,7 +369,6 @@ Keymap used within overlays:
 (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)
@@ -401,6 +406,7 @@ the initial string globally."
 
   (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)