From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Unicode confusables and reordering characters considered harmful, a simple solution Date: Thu, 4 Nov 2021 20:52:21 -0700 Message-ID: References: <72dd5c2a-42c7-b12e-05ed-e93adbd89727@gmail.com> <83ilxajyhw.fsf@gnu.org> <83fssejxf8.fsf@gnu.org> <835ytajsv2.fsf@gnu.org> <831r3yjqo9.fsf@gnu.org> <83v91aibe7.fsf@gnu.org> <87o872s0wf.fsf_-_@db48x.net> <83lf25gm1j.fsf@gnu.org> <83ee7xgio2.fsf@gnu.org> <87fssdrp54.fsf@db48x.net> <831r3xgfz3.fsf@gnu.org> <87v918qx37.fsf@db48x.net> <83o870fjqg.fsf@gnu.org> <87k0hnqr1v.fsf@db48x.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23273"; mail-complaints-to="usenet@ciao.gmane.io" Cc: cpitclaudel@gmail.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, yuri.v.khan@gmail.com To: Daniel Brooks , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 05 04:54:33 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 1miqJE-0005qi-Oq for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Nov 2021 04:54:32 +0100 Original-Received: from localhost ([::1]:53352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miqJC-0004Q0-OF for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Nov 2021 23:54:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miqHD-0001kf-8B for emacs-devel@gnu.org; Thu, 04 Nov 2021 23:52:28 -0400 Original-Received: from mail-pg1-f173.google.com ([209.85.215.173]:34701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1miqH9-0001dr-I7; Thu, 04 Nov 2021 23:52:26 -0400 Original-Received: by mail-pg1-f173.google.com with SMTP id j9so7321764pgh.1; Thu, 04 Nov 2021 20:52:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=4ig9K7QIyRqDYclZdiASwE2szDIeBGw5z2hZ4FTEWnM=; b=qs6jbI501KQmTuQWzMfWTGWPojsvKALh5IpbHiqJIlbXOQp74QjbWk38YmPf6XYB1s Q+4WNzfkaAeEtT4M4+pma61f4xztt3b5Tyn7HfLr717WnFX+jD0uCe+0ezr8X4GaVEjK hLBHDswkgZpTIX9yq9bVhurUcAtTOP6pDYTdZ4ACTDeP1F4oPeoWQan0F54OXtv8lvOY 62IR3LkyInOOYLwC225qwYSnPknSG347HdG2ykzpDBjBnY7KP5gLE0YFRiTL5M3JvnYZ X6jk4M/FTZ/I8O700bl+6YLWdOuWkxmJjIxAbbY8wlAxf+p6u/gSGJwFBblutL7tocE/ aG4A== X-Gm-Message-State: AOAM531rYqHnL2O3TUJDRyYWCaglh30ApZR10UJezSEf8e8KJ2J9pohv FPdIqGV5k3ILnZgh9NBw+hCkNsjiBxO8+OrRNgw= X-Google-Smtp-Source: ABdhPJyW2JornT3NEPKlUz7O8ZfdY+W4Aivt5b41DsA3gVgs0sSYFsuYXVjrwU0fznRr2mMyD6xcLVicjzY+1nz8O3Q= X-Received: by 2002:a63:370c:: with SMTP id e12mr41996885pga.359.1636084341798; Thu, 04 Nov 2021 20:52:21 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 4 Nov 2021 20:52:21 -0700 In-Reply-To: <87k0hnqr1v.fsf@db48x.net> Received-SPF: pass client-ip=209.85.215.173; envelope-from=stefankangas@gmail.com; helo=mail-pg1-f173.google.com X-Spam_score_int: -13 X-Spam_score: -1.4 X-Spam_bar: - X-Spam_report: (-1.4 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.29 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:278729 Archived-At: Daniel Brooks writes: > Rust also has a very flexible annotation system that allows the > programmer to annotate specific statements and language items. If a use > of these characters is determined to be legitimate, the programmer can > annotate the comment, or the function the comment is in, so that this > error is disabled. In projects with strong review culture, seeing that > annotation while doing a code review will be a very strong signal that > something unusual is going on, and that it needs to be considered > carefully. Annotations are are a great feature of Rust that I do not > expect Emacs to take into account. We already have `ignore-errors', `with-suppressed-warnings', etc. That sounds as powerful as the annotation system you describe, or am I missing something? [Discussing strictly what to do about Emacs Lisp here:] In any case, the above leads me back to the simple idea to raise byte-compiler (or even `read'?) warnings for the problematic control characters unless a specific variable is set to t, or unless the piece of code using them is wrapped in some `with-suppressed-warnings' call. Or we do it the other way around: users mark a source code file to say that "this file will never contain RTL characters" (but RTL scripts in ELisp code is pretty uncommon, I think). It doesn't seem too bad, certainly not much worse than having to add "coding: utf-8" or similar. Was such a solution rejected already? > Instead I think that Emacs should adopt a similar fast > strategy. Anything we do today can be refined later. FWIW, I tend to agree with this.