On Fri, 16 Aug 2024 at 15:47, Chet Ramey <chet.ra...@case.edu> wrote:

> On 8/16/24 6:40 AM, Reuben Thomas wrote:
>
> I don't know that they're mutually contradictory. If you look at Tim's bug
> report, you see a link to the bugzilla report he's forwarding, and that's
> from you. It's a report that Meta-p and "\M-p" behave differently when used
> to bind key sequences, and your complaint now is that I chose the behavior
> you don't prefer then.
>

Oh, OK!

If you're going to have meta-p (however you enter it on your keyboard)


What I'm saying is that on macOS, the option key is the meta key, in that
> it can be configured to either send meta characters (option-p emits "π",
> for example) or be used as a meta key in the way you mean it with the
> escape meta-prefix.
>

I think this may be the nub of the issue: you are defining the Meta key as
"the key that sends meta characters", whereas I'm defining it as "the key
(if any) ascribed the Meta function". So in particular, it's a certain key
on the keyboard.

I think it's just a terminology difference. If you think meta means to
> unconditionally send the meta-prefix (escape), that's fine, but is that
> the same as the `meta character' (characters with the eighth bit set) that
> convert-meta refers to?
>

So, I don't mean any of that. I think Meta refers to a key on the keyboard.

>   * Even in Emacs, on which readline is modelled, even when running in the
> >     terminal, one doesn't have to write keybindings in different ways
> >     depending on the terminal setup.
>
> How does it do that? Or does it simply default to the equivalent of
> setting convert-meta to on, whatever it is?
>

I have no idea, and as a user, I don't care. That's my point here, really:
most users don't care about the minutiae of what pressing the Meta key
does, under the hood.


> But readline doesn't use `meta' in the way you mean. It's always
> consistently used meta as referring to a character with the eighth bit set.
> Look at the `input-meta' and `output-meta' variables. You might not think
> that such a distinction has value in today's world, but let's at least
> use the terminology readline has traditionally used.
>

Exactly: I think the problem here from readline's point of view is to
square the fact that it has traditionally used terminology in a certain way
with the fact that the distinction is unimportant to most users today.

So you want the \M- portion of the key sequence to reflect what the meta
> key on your keyboard does (whichever one that is, since lots of keyboards
> on windows laptops, for instance, don't have a meta key, either), without
> telling readline explicitly. It's a new capability, basically defaulting
> convert-meta to on for key bindings while being careful not to strip the
> eighth bit from any multibyte characters (which I think we already do, to
> be clear).
>

It sounds like it is indeed a new capability!

set convert-meta on
>
> in your .inputrc before any key bindings and see if that gets you where you
> want? If there are no negative effects when entering multibyte characters
> from the keyboard, we can talk about defaulting convert-meta to on in a
> locale with UTF-8 encoding.
>

I tried setting convert-meta to "on", but this breaks entering e.g.
accented characters. Unsurprisingly, since now it is converting all my
≥8-bit characters to multiple 7-bit characters; for example, a (UK) pound
sign (£) comes out as hash followed by newline.

Many thanks for your patience, by the way!

-- 
https://rrt.sc3d.org

Reply via email to