~protesilaos/general-issues

3 2

substitute.el: optionally include target text in replacement text prompt?

Details
Message ID
<877cwn3u4s.fsf@posteo.net>
DKIM signature
missing
Download raw message
Hi Prot,

Thanks a lot for substitute.el. I find it particularly handy. Do you think it would be a good thing if the user could get the replacement prompt automatically
filled with the target text? I would find it useful in cases where one needs to apply a very slight modification to a long word throughout the buffer, for
instance.

For example, say I have a `(defun foobar-package-particularly-long-function-name () ...)' and I realise that this particular function is in fact
internal, and it thus needs to be named `foobar-package--particularly-long-function-name'. It would be nice if the replacement prompt were
automatically filled with the function name, so that I could simply add a second dash without having to type the whole name again. Perhaps this could be
triggered with two prefix arguments?

Thanks a lot,

Edgar
Details
Message ID
<87y1p355j3.fsf@protesilaos.com>
In-Reply-To
<877cwn3u4s.fsf@posteo.net> (view parent)
DKIM signature
missing
Download raw message
> From: Edgar Vincent <e-v@posteo.net>
> Date: Sun, 12 Feb 2023 13:10:39 +0000
>
> Hi Prot,

Hello Edgar,

> Thanks a lot for substitute.el. I find it particularly handy. Do you
> think it would be a good thing if the user could get the replacement
> prompt automatically filled with the target text? I would find it
> useful in cases where one needs to apply a very slight modification to
> a long word throughout the buffer, for instance.

If I understand this correctly, it can be achieved by typing M-n at the
prompt.  This is a standard for many Emacs prompt that have a default
value.

Otherwise, we can always think of user options, prefix arguments, or
even more commands.

What do you think?

All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<875yc73q9g.fsf@posteo.net>
In-Reply-To
<87y1p355j3.fsf@protesilaos.com> (view parent)
DKIM signature
missing
Download raw message
Protesilaos Stavrou <info@protesilaos.com> writes:

> Hello Edgar,
>
> If I understand this correctly, it can be achieved by typing M-n at the
> prompt.  This is a standard for many Emacs prompt that have a default
> value.
>
> Otherwise, we can always think of user options, prefix arguments, or
> even more commands.
>
> What do you think?
>
> All the best,
> Prot

Thanks for your reply. That’s perfect! `M-n' achieves exactly that. I didn’t know about “future history”.
I don’t think adding user options would be necessary, given that built in goodness.

Thanks again,

Edgar
Details
Message ID
<87r0uvudtd.fsf@protesilaos.com>
In-Reply-To
<875yc73q9g.fsf@posteo.net> (view parent)
DKIM signature
missing
Download raw message
> From: Edgar Vincent <e-v@posteo.net>
> Date: Sun, 12 Feb 2023 14:33:51 +0000

> [... 17 lines elided]

> Thanks for your reply. That’s perfect! `M-n' achieves exactly that. I
> didn’t know about “future history”.  I don’t think adding user options
> would be necessary, given that built in goodness.
>
> Thanks again,

You are welcome!

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)