Rubyの古いHash記法 { :foo => 'bar' }
を1.9以降の記法 { foo: 'bar' }
に置換するelispです。
(defun ruby-anti-hash-rocket ()
(interactive)
(beginning-of-line)
(setq current-line (count-lines (point-min) (point)))
(setq replaced (replace-regexp-in-string ":\\([a-z0-9_]+\\)\s*=>" "\\1:" (buffer-string)))
(erase-buffer)
(insert replaced)
(goto-line (+ 1 current-line))
(beginning-of-line)
)