From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.devel Subject: Re: Unicode confusables and reordering characters considered harmful Date: Thu, 04 Nov 2021 08:50:35 +0000 Message-ID: <7699dbfaffee28acd14b@heytings.org> References: <875ytag0hb.fsf@yahoo.com> <87zgqmd5np.fsf@mat.ucm.es> <83wnlqk3rn.fsf@gnu.org> <72dd5c2a-42c7-b12e-05ed-e93adbd89727@gmail.com> <83ilxajyhw.fsf@gnu.org> <83fssejxf8.fsf@gnu.org> <835ytajsv2.fsf@gnu.org> <11d5fecb44af1d388b7f@heytings.org> <11d5fecb449846dc0851@heytings.org> <875yt932ar.fsf@igel.home> <11d5fecb441e697317f0@heytings.org> <11d5fecb440d9c4d0e6a@heytings.org> <11d5fecb4446d054126b@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7MBhmlZeqh" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34756"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , Eli Zaretskii , Andreas Schwab , cpitclaudel@gmail.com, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 04 09:51:22 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 1miYSv-0008nI-BN for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Nov 2021 09:51:21 +0100 Original-Received: from localhost ([::1]:37638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miYSt-0003QR-Kn for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Nov 2021 04:51:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51534) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miYSI-0002eV-3b for emacs-devel@gnu.org; Thu, 04 Nov 2021 04:50:42 -0400 Original-Received: from heytings.org ([95.142.160.155]:52386) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miYSG-0007wJ-5G; Thu, 04 Nov 2021 04:50:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1636015836; bh=ebqIr+9fCu4uKa7YfbR5nDwpLyh2FTl5fVQ0QFv4Mzs=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=Hq4fba8E+J98dToCY59JjHJEI8OAkchkmMk9aW5J1cPv1UW+WGMyMuP0pFcZogwb5 vccLvtcF0GieBLV1wka73au/mctBVD85Vg6hv0f6MgXAF5/FnvYfXpsSXwWZGsTaxt bjEJ78TQhLAQd9SC3R4lZMW38zrC5ilaq/6eBn4+zBzJIa6HoiQFp65oMbzchszTiz vSHRyiXMHcUeDlpHt8hwxyJKo7vc6A1cT3HftgAsg2AVdRj+bNPbNYYq9K8S0NLEr7 a2xVSTJYUKZqDhqZGZSwWNOaomKTnwCHDMgGyaJY89gVcgfvTeyKoBVEDsbEoVkzuC gsGa3egwrAikg== In-Reply-To: <11d5fecb4446d054126b@heytings.org> Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham 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:278657 Archived-At: --7MBhmlZeqh Content-Type: text/plain; charset=us-ascii; format=flowed >> I did not spend enough time tweaking that code, given that Eli already >> said he doesn't want it. > > But I could not resist, I implemented your suggestions anyway ;-) > Thanks again! > It just occurred to me that the remove-hook wasn't necessary, and that it is also not necessary to have two separate control flows for the activation and deactivation of the minor mode. Final patch attached, it's only 37 lines long. --7MBhmlZeqh Content-Type: text/x-diff; name=Make-bidi-reordering-characters-visible.patch Content-Transfer-Encoding: base64 Content-ID: <7699dbfaff675e7afa10@heytings.org> Content-Description: Content-Disposition: attachment; filename=Make-bidi-reordering-characters-visible.patch RnJvbSBkZmYzOWNmNjU0MjEzMTIyZDJhOTI2YTc3ZjE0ZDkzNTdkOTVmMmFi IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBUaHUsIDQgTm92 IDIwMjEgMDg6NDc6MjYgKzAwMDANClN1YmplY3Q6IFtQQVRDSF0gTWFrZSBi aWRpIHJlb3JkZXJpbmcgY2hhcmFjdGVycyB2aXNpYmxlDQoNCiogbGlzcC9w cm9nbW9kZXMvcHJvZy1tb2RlLmVsIChiaWRpLXJlb3JkZXJpbmctY2hhcmFj dGVycy12aXNpYmxlKToNCk5ldyBtaW5vciBtb2RlLg0KKGJpZGktcmVvcmRl cmluZy1jaGFyYWN0ZXJzLXZpc2libGUtLWZvbnRpZnksDQpiaWRpLXJlb3Jk ZXJpbmctY2hhcmFjdGVycy12aXNpYmxlLS10b2dnbGUpOiBOZXcgaGVscGVy IGZ1bmN0aW9ucy4NCihwcm9nLW1vZGUpOiB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