From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Max Mikhanosha Newsgroups: gmane.emacs.devel Subject: Re: Bugfix for utf-8 XTerm/MinTTY and (set-input-meta-mode t) Date: Tue, 01 Jun 2021 18:01:27 +0000 Message-ID: References: <83k0ndzfxr.fsf@gnu.org> <83fsy1zds7.fsf@gnu.org> Reply-To: Max Mikhanosha Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13282"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jun 01 20:14:20 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lo8uC-0003Fa-31 for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Jun 2021 20:14:20 +0200 Original-Received: from localhost ([::1]:47010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lo8uB-0001du-0N for ged-emacs-devel@m.gmane-mx.org; Tue, 01 Jun 2021 14:14:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo8hq-0003V8-H7 for emacs-devel@gnu.org; Tue, 01 Jun 2021 14:01:34 -0400 Original-Received: from mail-40131.protonmail.ch ([185.70.40.131]:34203) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lo8hn-0007sL-5z for emacs-devel@gnu.org; Tue, 01 Jun 2021 14:01:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1622570488; bh=hWm1tm+YhLOJVkUqaq9LBVAqcTSDsnFFsSnjd08Apjc=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=C1gkMtJ6bGEqFmD/e4o6wQN/Ikq+tGSxkNarBEZUteK6ehj1kqW9vlKhiNJdArFqp BY7Xt9qa3yYvgFvqSx6JN3mluNU+oZymM7GpifJEn2/g14reGDjvkmXixT7FrP5v8B VQqa9ZUsBVAEaz8FPLDKI3nB+hhNixQNafbbTWdY= In-Reply-To: <83fsy1zds7.fsf@gnu.org> Received-SPF: pass client-ip=185.70.40.131; envelope-from=max.mikhanosha@protonmail.com; helo=mail-40131.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 01 Jun 2021 14:12:03 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270236 Archived-At: On Tuesday, June 1st, 2021 at 1:38 PM, Eli Zaretskii wrote: > > Date: Tue, 01 Jun 2021 17:28:59 +0000 > > > From: Max Mikhanosha max.mikhanosha@protonmail.com > > > > Cc: emacs-devel@gnu.org > > > > > If these terminal emulators send M-x as 248 decimal, then how do they > > > > > > send the Latin character =C3=B8, whose codepoint is 248 decimal? > > > > Exactly the same 0xc3,0xb8. Its point of the encode meta-key in the 8th= bit mechanics, that you give up ability to type upper half of ASCII table = (128-255) instead using them to indicate meta key. Its a life-safer for tho= se of us using vi, (on in Emacs case evil), otherwise sending meta keys as = Esc really interferes with vi mode where Esc key is super-special.. Y= ou can still insert these characters by doing quoted-insert, ie C-v M-x and= it will insert =C3=B8 > > I see your point, but I don't think we can then accept this patch as > is. The patch in effect forces everyone to give up on being able to > type 8-bit Latin characters as soon as they configure keyboard > encoding to be UTF-8, right? Or am I missing something? No there are two separate toggles in terminal programs (metaSendsEscape:fal= se), and in Emacs itself (set-input-meta-mode t) and (set-input-mode). Fir= st one changes how terminals send it, and 2nd one makes Emacs interpret 8th= bit as meta key. Both of these are non-default, for either Xterm or in Em= acse The (set-input-meta-mode META) parameter in emacs can be either NIL, T or s= omething else, you can lookup the docstring yourself. Default is 0, which = sets keyboard->meta_key =3D 2, and thus does not affect anything. I just started Emacs with ./emacs -nw --no-init-file in UTF-8 XTerm, did (c= urrent-input-mode) which shows (nil nil 0 7), and typed Alt+aoeuid which pr= oduces =C3=A1=C3=AF=C3=A5=C3=B5=C3=A9 as expected, and exactly same as with= out my patch. My patch functionality is specifically enabled only when someone customizes= their Emacs to set META parameter of (set-input-mode) to T or NIL, but its= behavior is exactly the same as in non-UTF-8 mode. Only thing it does, is= make UTF-8 terminals work exactly same as non-UTF-8 terminals, instead of = beaing broken