Elektrine lite

← Feed

@kickingvegas@sfba.social

Post #1806123

2026-04-30 05:27 UTC

Yes, Emacs is quite capable of doing multi-file refactoring. You can do this and live to tell the tale. http://yummymelon.com/devnull/bulk-search-replace-commands-for-files-and-buffers-in-emacs.html #Emacs

Replies (7)

  • @kickingvegas@sfba.social 2026-04-30 16:56

    Updated post - added vc-git-grep, eglot-rename, and xref-find-references-and-replace. Thanks to @hl@social.lol and @etenil@toot.cat for their input!

    Open ##2230690

  • @kickingvegas@sfba.social 2026-05-04 16:19

    Amended 2026-05-04. Added diff and multi commands.

    Open ##2230691

  • @yantar92@fosstodon.org 2026-04-30 05:30

    @kickingvegas@sfba.social That's true, but more complex capabilities are still desired. In fact, Emacs maintainers explicitly asked volunteers to work on dedicated refactoring functionality some time ago. See https://yhetil.org/emacs-devel/83fs4f36wi.fsf@gnu.org/

    Open ##2230692

  • @hl@social.lol 2026-04-30 05:35

    @kickingvegas@sfba.social Great overview, thanks. The one grep command I use quite a lot, and is probably very similar to `project-find-regexp`, is `vc-git-grep` which mimics `git grep` and will search for text in your current git project, while respecting the contents of the gitignore file. That is really useful for something like Python projects where you want to search *.py file, but usually not those in the installed packages.

    Open ##2230693

  • @kickingvegas@sfba.social thanks! One thing I would say though is that it should be impossible for these commands to do anything "catastrophic" if your emacs backup file settings are solid (ie keeping a LOT of versions).

    Open ##2230695

  • @etenil@toot.cat 2026-04-30 06:02

    @kickingvegas@sfba.social I'm surprised there's no refactoring commands based on LSP (eglot) or treesitter... Oh there are some! https://www.gnu.org/software/emacs/manual/html_node/eglot/Eglot-Commands.html#index-M_002dx-eglot_002drename

    Open ##2230697

  • @vincent@merveilles.town 2026-04-30 19:48

    @kickingvegas@sfba.social You could just ask an AI to do this and all it would take is 10000x the amount of energy.

    Open ##2230701