all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Arthur Miller <arthur.miller@live.com>
Cc: emacs-devel@gnu.org
Subject: Re: Partial wdired (edit just filename at the point)
Date: Thu, 18 Mar 2021 10:21:23 -0400	[thread overview]
Message-ID: <jwvwnu4eetz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <AM9PR09MB49779E89767646E72FD1E9C396699@AM9PR09MB4977.eurprd09.prod.outlook.com> (Arthur Miller's message of "Thu, 18 Mar 2021 11:26:14 +0100")

>> As you can guess from the previous comment, we should loop over BEG...END
>> to process all the lines involved.
> Can you elaborate more on this please?

Because that's how `before-change-functions` is defined.  We can try and
argue that in the specific case of wdired buffer the multiline case will
never happen (presumably because of all the `read-only` annotations) or
that it will always be "on the same line as point", but I'm pretty sure
we'll end up finding corner cases where these are not true, so I find it
easier to slap a simple while loop around the code and stop worrying
about corner cases.

[ As a general rule, I find it easier to write code if I just rely on
  the few things which I know to be true, rather than having to think of
  a set of unbounded possible cases.  Here, what we know to be true is
  that the upcoming changes will not affect anything outside BEG...END
  (at least not until `before-change-functions` are called again).  ]

> This is what I got for each char I typed in:

Try something like

    M-: (subst-char-in-region (point-min) (point-min) ?. ?-) RET

> I can change it back to three smaller defuns, but I will still though
> prefer to have them following each other in the code rather than
> scattered around in wdired.el for no reason as it is now. They are not
> refered from any other code.

Sounds great, thanks.


        Stefan




  parent reply	other threads:[~2021-03-18 14:21 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-16 18:23 Partial wdired (edit just filename at the point) Arthur Miller
2021-03-17  1:18 ` Stefan Monnier
2021-03-17  2:21   ` Arthur Miller
2021-03-17  2:34     ` Stefan Monnier
2021-03-17 13:58       ` Arthur Miller
2021-03-17 14:09         ` Stefan Monnier
2021-03-17 19:56           ` Arthur Miller
2021-03-17 22:40             ` Arthur Miller
2021-03-18  2:10               ` Stefan Monnier
2021-03-18 10:26                 ` Arthur Miller
2021-03-18 10:32                   ` Thierry Volpiatto
2021-03-18 11:00                     ` Arthur Miller
2021-03-18 11:11                       ` Thierry Volpiatto
2021-03-18 11:46                         ` Arthur Miller
2021-03-23 23:32                     ` Michael Heerdegen
2021-03-18 14:21                   ` Stefan Monnier [this message]
2021-03-19 11:15                     ` Arthur Miller
2021-03-19 16:18                       ` Stefan Monnier
2021-03-19 20:40                         ` Sv: " arthur miller
2021-03-19 21:58                           ` Stefan Monnier
2021-03-20 11:23                             ` Sv: " arthur miller
2021-03-21 22:17                 ` Tomas Hlavaty
2021-03-22  8:12                   ` tomas
2021-03-22 12:44                     ` Arthur Miller
2021-03-22 14:50                       ` tomas
2021-03-22 13:11                   ` Stefan Monnier
2021-03-22 20:08                     ` Tomas Hlavaty
2021-03-22 20:28                       ` Andreas Schwab
2021-03-22 21:00                       ` Stefan Monnier
2021-03-22 21:52                         ` Tomas Hlavaty
2021-03-22 22:16                           ` Stefan Monnier
2021-03-22 22:39                             ` Tomas Hlavaty
2021-03-22 23:27                           ` Andreas Schwab

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=jwvwnu4eetz.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    /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.