Comments (12)
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.
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...
-
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 useC-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. -
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.
I've sent deadgrep
support PR to wgrep
. mhayashi1120/Emacs-wgrep#58
I hope it could solve the issue.
from deadgrep.
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.
Awesome. Thanks. Had a feeling you'd add this too :)
from deadgrep.
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.
Any progress here?
from deadgrep.
+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.
@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.
I found deadgrep-edit-mode
worked 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.
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.
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)
- T, C key binding are not supported (Get Error in mini buffer: T is undefined and C is undefined) HOT 5
- Fix: Buffer name `*deadgrep search_term /directory*' is in use
- Re-use existing `*deadgrep ...*` buffer HOT 5
- How to search filename with pattern? HOT 2
- file-remote-p: Wrong type argument: stringp, (Git "~/.emacs.d/") HOT 1
- deadgrep faces not registered until first run HOT 1
- [Feature Request] optional flags with magit-like menu?
- [Question] Is the search in directory recursive? HOT 1
- Simple search don't work HOT 4
- Feature idea: ability to identify several file types HOT 1
- [Feature Request] Add keybinding to cycle File search type HOT 2
- question: how to config deadgrep's result window not using split window? HOT 1
- how to set deadgrep-executable? HOT 1
- Question: Syntax highlight (defferent mode for each file) in results HOT 2
- [Package Idea]: An extension for XREF that works like this package?
- Exclude glob patterns not working HOT 3
- bind next-error / previous-error
- deadgrep not using current dired folder as search directory HOT 3
- Dynamic search
- there should be a way to do ad hoc exclusions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deadgrep.