From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ravi R Newsgroups: gmane.emacs.devel Subject: Re: Terminal or keyboard decoding system? Date: Thu, 23 Sep 2021 22:05:37 -0500 Message-ID: <87ee9epsy2.fsf@gmail.com> References: <87tuigck4h.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26506"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.6.4; emacs 27.2 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 24 14:02:17 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 1mTjuD-0006fn-7Z for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 14:02:17 +0200 Original-Received: from localhost ([::1]:44744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTjuB-00085A-Vj for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 08:02:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTjrT-0005Zu-S3 for emacs-devel@gnu.org; Fri, 24 Sep 2021 07:59:27 -0400 Original-Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:40910) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mTjrR-00027N-Mn for emacs-devel@gnu.org; Fri, 24 Sep 2021 07:59:27 -0400 Original-Received: by mail-qk1-x734.google.com with SMTP id 72so27541154qkk.7 for ; Fri, 24 Sep 2021 04:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:message-id :in-reply-to:mime-version; bh=ZOjycGULC2j9BsiAqP4+h3xEM03/qn31g7NRcz2Fx9s=; b=Byd7ewdEh0St4j650G6bur4l/aKvln2N/O8mzxt1MFm7YAA66CARoDYVwV7tNdOzg7 B6HRMcfXwQVEobDZwXcW5+7FcyswlAnOrjnPJgUtus2cRMQSl85YiFv1hA8T4nzjPiYM TniheXAJfIjPTJdkWT3medqoOq0Pj0aCakTSH2QQWwQ+Fjx+eZfR97J8JQCfmdQcwx4r gyxIFUZWF0aGEwJYolHOqTe9H1i4G8Si+ozSegZSsEObZ/6a2hKda1XXGK9n5pqURLtN pzYiZu1qu+tbswMCIz3vsF3jUj+g5wRqf+VZ1Iz8DXkrX+XqXSjqAZo9YpqZGg6M26Xl UgpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :message-id:in-reply-to:mime-version; bh=ZOjycGULC2j9BsiAqP4+h3xEM03/qn31g7NRcz2Fx9s=; b=s7yak9FRjpJO1657oM1wV29lZRYOJPylkLCu970ed5yZiLhj5/JDbGnzQMEF4e4uBd fZO+2oUIbUKRLE/+kpLYNGVvU1muVS2ly/vI3aKbmbWGDFUlDhf+P5pkHHP3D/Nv2K26 HPeUlYB3x2J3804Qfg9/o+dMk6WPljCJJf3UEUQdsmLGLpdMiF9T0YcSKXJVhJSA6il3 /88l8Qb4Pu9DlzBNm2zTGCH9oO+ym2fAGV73Er04FkPjR8bv/tjFuWQg3rG/WJvpoK/n k+Ryafyjc5ZwR0GYlPTgku7bTUzMVBswWdlFtqhZwNjqsY6B5x0+KIagWt5sc/CPfZSa 0J/w== X-Gm-Message-State: AOAM530QSGB7vJXvt6X4t3jzFE592sQoj/QbNcTHmk9CFstvOQB0tUpP vwBBuTeWlHRYLu6JCWFQnZjdAKBvcVWL/Q== X-Google-Smtp-Source: ABdhPJw/L3Fkg2AfwMQuXRNhTyuU96XqVX+ogT4rba8a6MdrX9s+dmFfS/VHGCSjuSPy3BFfOxXKeQ== X-Received: by 2002:a37:87c7:: with SMTP id j190mr10077917qkd.89.1632484762960; Fri, 24 Sep 2021 04:59:22 -0700 (PDT) Original-Received: from cramer (c-73-8-230-52.hsd1.il.comcast.net. [73.8.230.52]) by smtp.gmail.com with ESMTPSA id z186sm6390521qke.59.2021.09.24.04.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 04:59:22 -0700 (PDT) In-reply-to: Received-SPF: pass client-ip=2607:f8b0:4864:20::734; envelope-from=lists.ravi@gmail.com; helo=mail-qk1-x734.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:275395 Archived-At: On Sun 2021-09-19 7:23:09PM -04, Stefan Monnier wrote: >> My current approach [2] is to bind the CSI sequence to the following > > AFAIK the CSI prefix is used for "all" key sequences as well as for > other "side communication" (such as the bracketed paste functionality or > the mouse events), so binding your function directly to CSI seems > a bit drastic. > > IOW, Maybe a better option is to bind it to all the `CSI > ` sequences. But I guess it depends what other sequences can > occur in your terminal (in xterm, there are many standard keys that use > sequences that start with CSI , and backeted paste actually also > matches this pattern). I do handle all sequences that can occur in my terminal, which are just key sequences, focus in/out, and bracketed paste. >> 1. read-char-exclusive can be advised by packages > > It can, but it doesn't seem common (I can't find any such occurrence in > Emacs nor (Non)GNU ELPA other than inside a test inside Org) and it's > not necessarily a problem. > What problems have you encountered? The multiple cursors package advises `read-key` which I originally used. I haven't run into any packages that advise `read-char-exclusive`. > BTW, why use `read-char-exclusive` rather than, say, `read-event`? Fantastic catch! I did not know that `read-event` could be used here; after replacing `read-char-exclusive` with `read-event`, two days of emacs use has not resulted in the keystroke interleaving problem. Why does this work better? >> 3. Standard C-, M-, C-M- bindings cannot distinguish between shifted >> and non-shifted variants for characters: abcdefghjklnopqrstuvwxyz\ >> I don't understand the "C-DEL" issue at all, and work around the >> shifted/non-shifted bindings via the following hacks: >> a. Mapping shifted to non-shifted versions in key-tranlation-map >> b. Add any non-shifted personal bindings (e.g., to "C-A" rather than >> "C-a") in local-function-key-map (really ugly) > > We have some long standing issues here, I think. > Maybe a bug report is in order. Ok, will do. >> 1. Is modifying input-decode-map and key-translation-map the right >> approach? > > Yes (tho `key-translation-map` is better avoided, but sometimes it's > the only option). Why should it be avoided? I haven't run into any issues, but it'd be good to know. Regards, Ravi