diff options
| author | Lars Magne Ingebrigtsen | 2015-12-30 10:10:20 +0100 |
|---|---|---|
| committer | Lars Magne Ingebrigtsen | 2015-12-30 10:10:20 +0100 |
| commit | 7c343eeaacd1454aef7ab492cbefb53d52ab6cf4 (patch) | |
| tree | 509af57dbb8eaef30a846e44b17a7a76bd0b681f | |
| parent | d7f24b86e1dd28bcbe4fa7089bebb70f0fe29b3a (diff) | |
| download | emacs-7c343eeaacd1454aef7ab492cbefb53d52ab6cf4.tar.gz emacs-7c343eeaacd1454aef7ab492cbefb53d52ab6cf4.zip | |
New function `puny-highly-restrictive-domain-p'
* lisp/net/puny.el (puny-highly-restrictive-string-p): Rename.
(puny-highly-restrictive-domain-p): New function.
| -rw-r--r-- | 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 ac47e13c97d..f2fa3464348 100644 --- a/lisp/net/puny.el +++ b/lisp/net/puny.el | |||
| @@ -193,7 +193,12 @@ For instance \"xn--bcher-kva\" => \"bücher\"." | |||
| 193 | ;; http://www.unicode.org/reports/tr39/#Restriction_Level_Detection | 193 | ;; http://www.unicode.org/reports/tr39/#Restriction_Level_Detection |
| 194 | ;; http://www.unicode.org/reports/tr31/#Table_Candidate_Characters_for_Inclusion_in_Identifiers | 194 | ;; http://www.unicode.org/reports/tr31/#Table_Candidate_Characters_for_Inclusion_in_Identifiers |
| 195 | 195 | ||
| 196 | (defun puny-highly-restrictive-p (string) | 196 | (defun puny-highly-restrictive-string-p (string) |
| 197 | "Say whether STRING is \"highly restrictive\" in the Unicode IDNA sense. | ||
| 198 | See http://www.unicode.org/reports/tr39/#Restriction_Level_Detection | ||
| 199 | for details. The main idea is that if you're mixing | ||
| 200 | scripts (like latin and cyrillic), you may confuse the user by | ||
| 201 | using homographs." | ||
| 197 | (let ((scripts | 202 | (let ((scripts |
| 198 | (delq | 203 | (delq |
| 199 | t | 204 | t |
| @@ -233,6 +238,11 @@ For instance \"xn--bcher-kva\" => \"bücher\"." | |||
| 233 | (latin han bopomofo) | 238 | (latin han bopomofo) |
| 234 | (latin han hangul))))))) | 239 | (latin han hangul))))))) |
| 235 | 240 | ||
| 241 | (defun puny-highly-restrictive-domain-p (domain) | ||
| 242 | "Say whether DOMAIN is \"highly restrictive\" in the Unicode IDNA sense. | ||
| 243 | See `puny-highly-restrictive-string-p' for further details." | ||
| 244 | (seq-every-p 'puny-highly-restrictive-string-p (split-string domain "[.]"))) | ||
| 245 | |||
| 236 | (provide 'puny) | 246 | (provide 'puny) |
| 237 | 247 | ||
| 238 | ;;; puny.el ends here | 248 | ;;; puny.el ends here |