grep-edit.elç¡å
è¤æ°ã®ãã¡ã¤ã«ã«ã¾ãããç¹å®ã®ãã¿ã¼ã³ãç½®æããå¿
è¦ããã£ãããããªã¨ãã«ã¯Emacs使ããªãã°grep-edit.elããããM-x grepã§ç½®æç®æãåºåãã¦ãM-x query-replaceã§ç½®æãããæå¼·ãgrep-editç¡åã
unix wizardãªãã°perlã®ã¯ã³ã©ã¤ãã¼ã§ç½®æããã ãããã©ãã¿ã¬ãªä¿ºã«ã¯ä¸å®ã§â¦èª¤çããããããããã
http://www.bookshelf.jp/elc/grep-edit.el
俺è¨å®ãbuffer-read-onlyã§ããããããå«ãªã®ã§ç½®ææã«inhibit-read-onlyãã»ãããã¦ãããããã¦ãC-c C-cã§ç·¨éçµäºãããããããè¨å®ãã¦ãããè¡ã¸é£ã¶ã®ã¯Enterã§ã
grepã®çµæããæ¢ç´¢ããç®çã«ã¯ãã®ãã¡å
¬éäºå®ã®anything-grep.elã使ã£ã¦ãããanything.elã ã¨çµãè¾¼ã¿ãã§ãããããã*grep*ãããã¡ã¯å°ãgrep-edit.elå°ç¨ã¨ãªã£ã¦ããã
dmoccurãmoccur-editçã¯ãã¾ã使ããªããªããã£ããgrepãgrep-editããããã ãããã£ã¡ã®ã»ããéãã
(require 'grep) (require 'grep-edit) (defadvice grep-edit-change-file (around inhibit-read-only activate) "" (let ((inhibit-read-only t)) ad-do-it)) ;; (progn (ad-disable-advice 'grep-edit-change-file 'around 'inhibit-read-only) (ad-update 'grep-edit-change-file)) (defun my-grep-edit-setup () (define-key grep-mode-map '[up] nil) (define-key grep-mode-map "\C-c\C-c" 'grep-edit-finish-edit) (message (substitute-command-keys "\\[grep-edit-finish-edit] to apply changes.")) (set (make-local-variable 'inhibit-read-only) t) ) (add-hook 'grep-setup-hook 'my-grep-edit-setup t)