[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Partial wdired (edit just filename at the point)
From: |
Stefan Monnier |
Subject: |
Re: Partial wdired (edit just filename at the point) |
Date: |
Wed, 17 Mar 2021 10:09:22 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> The problem here is how aborting changes is implemented in wdired: undo
> is disabled and original code just copies entire buffer and pastes it back
> when changes are aborted.
I think you should be able to leave this part of the code completely unchanged.
> I would like to skip copying entire buffer into buffer-string as
> wdired does originally.
Any particular reason for that? It should be very fast, even for very
large directories.
> I agree with you, but I am not sure how to implement it. My hack was
> literally less than a 5 minute change, I just removed loops and changed
> mode name so I can abort it properly.
I'd start with the following:
When converting to wdired, instead of calling `wdired-preprocess-files`, use
(add-hook 'before-change-functions #'wdired--preprocess-lines nil t)
and then turn `wdired-preprocess-files` into `wdired--preprocess-lines`,
which will `get-text-property` of the first char of each line in the
region to see if it's already been marked as `read-only`. If yes,
do nothing and if not, do what the old code did on that line.
Stefan
- Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/16
- Re: Partial wdired (edit just filename at the point), Stefan Monnier, 2021/03/16
- Re: Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/16
- Re: Partial wdired (edit just filename at the point), Stefan Monnier, 2021/03/16
- Re: Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/17
- Re: Partial wdired (edit just filename at the point),
Stefan Monnier <=
- Re: Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/17
- Re: Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/17
- Re: Partial wdired (edit just filename at the point), Stefan Monnier, 2021/03/17
- Re: Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/18
- Re: Partial wdired (edit just filename at the point), Thierry Volpiatto, 2021/03/18
- Re: Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/18
- Re: Partial wdired (edit just filename at the point), Thierry Volpiatto, 2021/03/18
- Re: Partial wdired (edit just filename at the point), Arthur Miller, 2021/03/18
- Re: Partial wdired (edit just filename at the point), Michael Heerdegen, 2021/03/23
- Re: Partial wdired (edit just filename at the point), Stefan Monnier, 2021/03/18