New answers tagged

0

This may actually be easier on the command line with perl than within emacs: perl -i.bak -pe 's/import org.apache.log4j.Logger;/import org.apache.log4j.Logger;/;' * */* (Add more */*/* if you have deeper subfolders.) Added advantage: backup copies of your original files are created with the suffix ".bak".


0

If you use library Dired+ then you can use command diredp-do-eval-in-marked-recursive to do what you want. If you use it directly it asks you for a sexp to evaluate at the beginning of each file to be acted on. In this case, the sexp you want is just a replace-string sexp. So this simple command does the job: (defun bar () (interactive) (diredp-do-eval-...


1

This is trivial in a Dired buffer for the directory possibly containing (possibly with subdirs, recursively) matches for some search pattern. Just use Q, which is bound to dired-do-find-regexp-and-replace: Q runs the command dired-do-find-regexp-and-replace (found in dired-mode-map), which is an interactive autoloaded compiled Lisp function in dired-aux.el. ...


1

You could do this with wgrep, which you can install from Melpa. The workflow would be: Call grep: M-x grep Fill in an invocation that will match your files and patterns: grep --color=auto -nH --null -e 'import org.apache.log4j.Logger;' ./* (note that the first part is the default, you only need to enter 'import org.apache.log4f.Logger;'./* The results are ...


Top 50 recent answers are included