lisp

(defun iedit-symbol-in-defun ()
  "Enter `iedit-mode' to rename the symbol in current function, or exit it."
  (interactive)
  (if iedit-mode
      (progn
        (iedit-mode -1)
        (widen))
    (progn
      (if (thing-at-point 'symbol)
          (progn
            (narrow-to-defun)
            (iedit-mode t)
            (message "When done, run `epy-iedit-in-defun' again to quit.")
            )
        (error "You need to put cursor on identifier.")
      )))) 

  

posted @ 2015-01-07 19:03  脉搏96  阅读(236)  评论(0编辑  收藏  举报