emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Lazy wdired preprocessing


From: Arthur Miller
Subject: Re: [PATCH] Lazy wdired preprocessing
Date: Fri, 26 Mar 2021 13:15:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Arthur Miller <arthur.miller@live.com> writes:
>
>> This was re-implementation of parts of wdired to make it more efficient
>> and faster to enter the wdired mode.
>
> Ok, thanks for the elaboration.  Didn't try it yet, but I welcome this
> change.  So far I have one question:
>
> +  ;; find one column with permissions and set permision text boundaries
> +  (save-excursion
> +    (goto-char (point-min))
> +    (unless (re-search-forward dired-re-perms nil t 1)
> +      (wdired-abort-changes)
> +      (error "No files to be renamed - Exiting to Dired mode."))
> +    (goto-char (match-beginning 0))
> +    (setq-local wdired-perm-beg (current-column))
> +    (goto-char (match-end 0))
> +    (setq-local wdired-perm-end (current-column)))
>
> Did you check that this works when `dired-hide-details-mode' is enabled?

Yes, it works. I that option always on, and display details only when I
need them.

> I ask because AFAIK `current-column' doesn't count invisible characters.
> [It might be better to just count characters from the line's beginning,
> but I see that the existing code also uses `current-column'.]

As optimization, I pre-calculate start and end of permission part of
text in `wdired-change-to-widred-mode, so I don't need to do this when
processing every line, but I could do this later on, I don't think it
would be a problem. When details are hidden, one can not enter the
permission part of text, so the `current-column wont be called either. I
use it only to check that point is in permission part of text, so when
permissions are hidden user won't enter it and `current-column will not
be called.

I had version where I calculated column on my own, but I thought it is
better to use something that already is there than to add more code :).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]