emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 7c343ee 1/2: New function `puny-highly-restrictive-


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 7c343ee 1/2: New function `puny-highly-restrictive-domain-p'
Date: Wed, 30 Dec 2015 09:11:45 +0000

branch: master
commit 7c343eeaacd1454aef7ab492cbefb53d52ab6cf4
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Lars Magne Ingebrigtsen <address@hidden>

    New function `puny-highly-restrictive-domain-p'
    
    * lisp/net/puny.el (puny-highly-restrictive-string-p): Rename.
    (puny-highly-restrictive-domain-p): New function.
---
 lisp/net/puny.el |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/lisp/net/puny.el b/lisp/net/puny.el
index ac47e13..f2fa346 100644
--- a/lisp/net/puny.el
+++ b/lisp/net/puny.el
@@ -193,7 +193,12 @@ For instance \"xn--bcher-kva\" => \"bücher\"."
 ;; http://www.unicode.org/reports/tr39/#Restriction_Level_Detection
 ;; 
http://www.unicode.org/reports/tr31/#Table_Candidate_Characters_for_Inclusion_in_Identifiers
 
-(defun puny-highly-restrictive-p (string)
+(defun puny-highly-restrictive-string-p (string)
+  "Say whether STRING is \"highly restrictive\" in the Unicode IDNA sense.
+See http://www.unicode.org/reports/tr39/#Restriction_Level_Detection
+for details.  The main idea is that if you're mixing
+scripts (like latin and cyrillic), you may confuse the user by
+using homographs."
   (let ((scripts
          (delq
           t
@@ -233,6 +238,11 @@ For instance \"xn--bcher-kva\" => \"bücher\"."
                          (latin han bopomofo)
                          (latin han hangul)))))))
 
+(defun puny-highly-restrictive-domain-p (domain)
+  "Say whether DOMAIN is \"highly restrictive\" in the Unicode IDNA sense.
+See `puny-highly-restrictive-string-p' for further details."
+  (seq-every-p 'puny-highly-restrictive-string-p (split-string domain "[.]")))
+
 (provide 'puny)
 
 ;;; puny.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]