From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: master ce63f91025: Add textsec functions for verifying email addresses Date: Thu, 20 Jan 2022 13:29:40 +0200 Message-ID: <834k5yr6fv.fsf@gnu.org> References: <164250841214.433.17670666873471731764@vcs2.savannah.gnu.org> <20220118122012.7A3A4C0DA1B@vcs2.savannah.gnu.org> <87ee555fy8.fsf@yahoo.com> <8335lkvqas.fsf@gnu.org> <871r127pzl.fsf@gnus.org> <83czkmrbha.fsf@gnu.org> <87ee524u0j.fsf@gnus.org> <838rvar9n0.fsf@gnu.org> <874k5y3brg.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18526"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 20 14:26:15 2022 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 1nAXSA-0004ax-W4 for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Jan 2022 14:26:15 +0100 Original-Received: from localhost ([::1]:56682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAXS9-0004jT-Kc for ged-emacs-devel@m.gmane-mx.org; Thu, 20 Jan 2022 08:26:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAVdO-0004zH-Ot for emacs-devel@gnu.org; Thu, 20 Jan 2022 06:29:42 -0500 Original-Received: from [2001:470:142:3::e] (port=39266 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAVdO-0006N0-Aw; Thu, 20 Jan 2022 06:29:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=lzTvmOACfrGu8aca2UliH5ZfYQdfkHFH8V/qgL+V67w=; b=SI7wsLdoejb6zuJ945bT UAg898m2ZHq8AgEvWIeAhHE1vvdmB3r031ieQ0+56LM++wxFIVHqq7t4LVKHTvpxUTXnTLkk6bhew ilaMGYa842NLjzuIQiM6Di2svAXwtMA1OsLz1T74F1xxknCSWfDp7xx/NDwngWSJBkEyfycW26/1i 2n7heKban+qIzES4TRnrn6jSCdiaoA5j0nzDlZ1oVgb0KG8xKufskXMfazWDzjMuE53AyLT2Khwo9 AmLu6Lc4KD7fr5n/v9BOQRvf9NlXTWIw84lecl12hdrI/MUdKmEu0Ikhwfkoypt9sYt7dVL6Dk4VE GMj/++RaV+JWLw==; Original-Received: from [87.69.77.57] (port=4743 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAVdO-0000Nj-6g; Thu, 20 Jan 2022 06:29:42 -0500 In-Reply-To: <874k5y3brg.fsf@gnus.org> (message from Lars Ingebrigtsen on Thu, 20 Jan 2022 12:08:35 +0100) 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:285039 Archived-At: > From: Lars Ingebrigtsen > Cc: luangruo@yahoo.com, emacs-devel@gnu.org > Date: Thu, 20 Jan 2022 12:08:35 +0100 > > Eli Zaretskii writes: > > >> (insert "Lars Ingebrigtsen\N{RIGHT-TO-LEFT OVERRIDE}" "larsi@gnus.org") > >> > >> Boom. > > > > Then you must pass the entire concatenated string to the function. Or > > call it on buffer text after inserting the string there. This > > function must see the characters affected by the bidi controls, to > > tell whether the control do any harm. > > I see. Perhaps we should have another function in addition -- one that > says "does this string (if inserted into a buffer) possibly affect other > text"? I.e., "does it have dangling directional modifiers"? I think > that's really what we want here (and why the Unicode recommendations are > like they are in this area). The problem is that the answer to that question depends on the following text. E.g., if RIGHT-TO-LEFT OVERRIDE is followed by R2L characters, they will not be affected. We could try appending some representative text to the string being tested, of course. For example, append a fixed string like this: a1א:! and see if the function returns non-nil position that points to one of those characters; if so, consider the original string "unsafe". Would that be good enough for textsec purposes?