Git Product home page Git Product logo

Comments (12)

Wilfred avatar Wilfred commented on May 26, 2024 14

OK, this is now implemented! Please try M-x deadgrep-edit-mode and tell me what you think.

There will undoubtedly be rough edges and bugs, but it does work. If you edit a line from a file you have open, the buffer gets updated. If the file isn't open, the changes are written to the file directly.

Have a play with it and let me know what you think of the feel :)

from deadgrep.

xenodium avatar xenodium commented on May 26, 2024 8

OK, this is now implemented! Please try M-x deadgrep-edit-mode

Thanks for taking the time to implement this Wilfred! Just gave it a try. Very cool.

Have a play with it and let me know what you think of the feel :)

The following may be subjective suggestions...

  1. Apply buffer/file changes with explicit intent (ie. C-c C-c). That is, useC-x C-q to enterdeadgrep-edit-mode, make your edits, and use C-c C-c to apply the changes to all files. This seems to be consistent with other commands (ie. dired-toggle-read-only). Similarly, C-c C-k would discard the changes.

  2. Save changes to open buffers also. After making batch-changes using deadgrep-edit-mode, magit prompted me to save changed buffers. We may want to save all files (including open buffers) or none for consistency. The former would remove some friction (no additional magit prompts).

Having said this, please gauge feedback from other active users. I unfortunately haven't been using deadgrep much recently. Sorry :/

from deadgrep.

iquiw avatar iquiw commented on May 26, 2024 1

I've sent deadgrep support PR to wgrep. mhayashi1120/Emacs-wgrep#58

I hope it could solve the issue.

from deadgrep.

Wilfred avatar Wilfred commented on May 26, 2024

Yep, this is definitely something I want to do. It's quite a big feature, so I wanted to be happy with the overall UI first, but I will add this at some point.

from deadgrep.

xenodium avatar xenodium commented on May 26, 2024

Awesome. Thanks. Had a feeling you'd add this too :)

from deadgrep.

phoenixanimations avatar phoenixanimations commented on May 26, 2024

Was just about to request this. This package has a really nice ui, and I like how you can change the settings on the result screen. Thanks either way :).

from deadgrep.

Pitometsu avatar Pitometsu commented on May 26, 2024

Any progress here?

from deadgrep.

kaushalmodi avatar kaushalmodi commented on May 26, 2024

+1 to what @xenodium said:

That is, useC-x C-q to enterdeadgrep-edit-mode, make your edits, and use C-c C-c to apply the changes to all files. This seems to be consistent with other commands (ie. dired-toggle-read-only). Similarly, C-c C-k would discard the changes.

from deadgrep.

jojojames avatar jojojames commented on May 26, 2024

@iquiw Nice, looking forward to that.

@Wilfred I think it'd be nice to have an explicit exit function back to deadgrep-mode.

from deadgrep.

hmelman avatar hmelman commented on May 26, 2024

I found deadgrep-edit-modeworked well for simple edits, inserting or deleting characters. However I used downcase-word at the start of a word ("Brian") and while the deadgrep buffer properly changed the text ("brian") the original buffer changed incorrectly to "rian", that is the first character of the word was deleted.

from deadgrep.

andreidum avatar andreidum commented on May 26, 2024

Hi, I'm also noticing an issue with deadgrep-edit-mode. Edits fail when running query-replace with an " Match data clobbered by buffer modification hooks” error.
I'm using a fairly standard Doom Emacs config. The vaule of before-change-functions is

 sp--reset-memoization
 syntax-ppss-flush-cache)

after-change-functions is

(flycheck-handle-change
 deadgrep--propagate-change
 t
 ws-butler-after-change)

Not sure really if this is due to the Doom emacs hooks. Let me know if you have any tips for making deadgrep-edit-mode work better (with Doom).
Thanks

from deadgrep.

fleimgruber avatar fleimgruber commented on May 26, 2024

I am seeing the same error replace-match-maybe-edit: Match data clobbered by buffer modification hooks in *messages* using Spacemacs when running query-replace in a deadgrep-edit-mode buffer. before-change-functions is nil. How to debug this further?

from deadgrep.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.