From: Arthur Miller <arthur.miller@live.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Lazy wdired preprocessing
Date: Fri, 26 Mar 2021 13:15:12 +0100 [thread overview]
Message-ID: <AM9PR09MB497712082F7831A3747CEF3396619@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <87h7kyh9w7.fsf@web.de> (Michael Heerdegen's message of "Fri, 26 Mar 2021 04:27:36 +0100")
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 :).
next prev parent reply other threads:[~2021-03-26 12:15 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-25 16:06 [PATCH] Lazy wdired preprocessing Arthur Miller
2021-03-25 23:09 ` Michael Heerdegen
2021-03-26 1:00 ` Arthur Miller
2021-03-26 3:27 ` Michael Heerdegen
2021-03-26 12:15 ` Arthur Miller [this message]
2021-03-26 12:21 ` Arthur Miller
2021-03-27 23:49 ` Michael Heerdegen
2021-03-28 1:51 ` Stefan Monnier
2021-03-28 1:56 ` Michael Heerdegen
2021-03-28 2:00 ` Stefan Monnier
2021-03-28 7:50 ` Sv: " arthur miller
2021-03-28 13:51 ` Stefan Monnier
2021-03-28 16:22 ` Sv: " arthur miller
[not found] ` <87y2e6242i.fsf@web.de>
2021-03-29 8:35 ` arthur miller
2021-03-26 10:18 ` Stefan Kangas
2021-03-26 19:37 ` Stefan Monnier
2021-03-27 7:39 ` Arthur Miller
2021-03-27 14:56 ` Stefan Monnier
2021-03-27 15:17 ` Arthur Miller
2021-03-27 15:56 ` Stefan Monnier
2021-03-27 17:01 ` Arthur Miller
2021-03-27 18:20 ` [PATCH] Lazy wdired preprocessing - BUG Arthur Miller
2021-03-27 18:32 ` Stefan Monnier
2021-03-27 18:50 ` Arthur Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AM9PR09MB497712082F7831A3747CEF3396619@AM9PR09MB4977.eurprd09.prod.outlook.com \
--to=arthur.miller@live.com \
--cc=emacs-devel@gnu.org \
--cc=michael_heerdegen@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.