diff options
Diffstat (limited to 'lisp/language')
40 files changed, 1637 insertions, 502 deletions
diff --git a/lisp/language/burmese.el b/lisp/language/burmese.el index 25425ec4858..96ba7752684 100644 --- a/lisp/language/burmese.el +++ b/lisp/language/burmese.el @@ -1,4 +1,4 @@ -;;; burmese.el --- support for Burmese -*- coding: utf-8 -*- +;;; burmese.el --- support for Burmese -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -23,9 +23,8 @@ ;;; Commentary: -;; Aung San Suu Kyi says to call her country "Burma". ;; The murderous generals say to call it "Myanmar". -;; We will call it "Burma". -- rms, Chief GNUisance. +;; We will call it "Burma". -- rms, Chief GNUisance. ;;; Code: @@ -39,11 +38,11 @@ (defvar burmese-composable-pattern (let ((table '(("K" . "[\u1004\u105A]\u103A\u1039") ; KINZI sequence - ("C" . "[\u1000-\u102A\u103F\u1041-\u1049\u104E\u105A-\u105D\u1061\u1065-\u1066\u106E\u1071\u1075\u1081\u108E\uAA60-\uAA6F\uAA71-\uAA76]") ; consonant and vowel letter + ("C" . "[\u1000-\u102A\u103F\u1041-\u1049\u104E\u105A-\u105D\u1061\u1065\u1066\u106E\u1071\u1075\u1081\u108E\uAA60-\uAA6F\uAA71-\uAA76]") ; consonant and vowel letter ("V" . "\u1039") ; VIRAMA ("A" . "\u103A") ; ASAT ("S" . "[\u1000-\u1019\u101C\u101E\u1020\u1021\u105A]") ; subscript - ("M" . "[\u103B-\u103E\105E-\1060]") ; medial + ("M" . "[\u103B-\u103E\u105E-\u1060]") ; medial ("v" . "[\u102B-\u103A\u103C-\u103E\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A\u109C\uAA70]"))) ; vowel sign, etc. (regexp "\\(K\\)?C\\(VS\\)?\\(VS\\)?A?M*v*")) (let ((case-fold-search nil)) @@ -52,7 +51,9 @@ regexp t t)))) regexp)) -(let ((elt (list (vector burmese-composable-pattern 0 'font-shape-gstring) - (vector "." 0 'font-shape-gstring)))) +(let ((elt (list (vector burmese-composable-pattern 0 #'font-shape-gstring) + (vector "." 0 #'font-shape-gstring)))) (set-char-table-range composition-function-table '(#x1000 . #x107F) elt) (set-char-table-range composition-function-table '(#xAA60 . #xAA7B) elt)) + +;;; burmese.el ends here diff --git a/lisp/language/cham.el b/lisp/language/cham.el index 4749f2e8db4..cbb35565af2 100644 --- a/lisp/language/cham.el +++ b/lisp/language/cham.el @@ -1,4 +1,4 @@ -;;; cham.el --- support for Cham -*- coding: utf-8 -*- +;;; cham.el --- support for Cham -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011, 2012 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -23,17 +23,25 @@ ;;; Commentary: -;; Tai Viet is being included in the Unicode at the range U+AA80..U+AADF. +;; Cham script is included in the Unicode at the range U+AA00..U+AA5F. ;;; Code: (set-char-table-range composition-function-table '(#xAA00 . #xAA5F) - (list (vector "[\xAA00-\xAA5F]+" 0 'font-shape-gstring))) + (list (vector "[\xAA00-\xAA5F]+" 0 #'font-shape-gstring))) (set-language-info-alist "Cham" '((charset unicode) (coding-system utf-8) - (coding-priority utf-8))) + (coding-priority utf-8) + (input-method . "cham") + (sample-text . "Cham (ꨌꩌ)\tꨦꨤꩌ ꨦꨁꨰ") + (documentation . "\ +The Cham script is a Brahmic script used to write Cham, +an Austronesian language spoken by some 245,000 Chams +in Vietnam and Cambodia."))) (provide 'cham) + +;;; cham.el ends here diff --git a/lisp/language/china-util.el b/lisp/language/china-util.el index f5174fb5e93..d5c6160efb8 100644 --- a/lisp/language/china-util.el +++ b/lisp/language/china-util.el @@ -1,6 +1,6 @@ -;;; china-util.el --- utilities for Chinese -*- coding: utf-8 -*- +;;; china-util.el --- utilities for Chinese -*- lexical-binding: t; -*- -;; Copyright (C) 1995, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1995, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -168,7 +168,7 @@ Return the length of resulting text." ;; ESC ESC -> ESC (delete-char 1) (forward-char -1) - (if (looking-at iso2022-gb-designation) + (if (looking-at "\e\\$A") (progn (delete-region (match-beginning 0) (match-end 0)) (insert hz-gb-designation) diff --git a/lisp/language/chinese.el b/lisp/language/chinese.el index 9ba178d7239..3970b0d154d 100644 --- a/lisp/language/chinese.el +++ b/lisp/language/chinese.el @@ -1,6 +1,6 @@ -;;; chinese.el --- support for Chinese -*- coding: utf-8; -*- +;;; chinese.el --- support for Chinese -*- coding: utf-8; lexical-binding: t; -*- -;; Copyright (C) 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -103,6 +103,11 @@ (define-coding-system-alias 'hz-gb-2312 'chinese-hz) (define-coding-system-alias 'hz 'chinese-hz) +;; FIXME: 'define-coding-system' automatically sets :ascii-compatible-p, +;; to any encoding whose :coding-type is 'utf-8', but UTF-7 is not ASCII +;; compatible, so we override that here (bug#40407). +(coding-system-put 'chinese-hz :ascii-compatible-p nil) + (set-language-info-alist "Chinese-GB" '((charset chinese-gb2312 chinese-sisheng) (iso639-language . zh) diff --git a/lisp/language/cyril-util.el b/lisp/language/cyril-util.el index 7644064c5a0..5482b3ea306 100644 --- a/lisp/language/cyril-util.el +++ b/lisp/language/cyril-util.el @@ -1,6 +1,6 @@ -;;; cyril-util.el --- utilities for Cyrillic scripts +;;; cyril-util.el --- utilities for Cyrillic scripts -*- lexical-binding: t; -*- -;; Copyright (C) 1997-1998, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997-1998, 2001-2022 Free Software Foundation, Inc. ;; Keywords: mule, multilingual, Cyrillic @@ -47,7 +47,7 @@ ;;;###autoload (defun standard-display-cyrillic-translit (&optional cyrillic-language) - "Display a cyrillic buffer using a transliteration. + "Display a Cyrillic buffer using a transliteration. For readability, the table is slightly different from the one used for the input method `cyrillic-translit'. @@ -60,7 +60,7 @@ If the argument is nil, we return the display table to its standard state." (list (let* ((completion-ignore-case t)) (completing-read - "Cyrillic language (default nil): " + (format-prompt "Cyrillic language" "nil") cyrillic-language-alist nil t nil nil nil)))) (or standard-display-table @@ -152,6 +152,7 @@ If the argument is nil, we return the display table to its standard state." (aset standard-display-table ?љ [?l ?j]) (aset standard-display-table ?њ [?n ?j]) (aset standard-display-table ?џ [?d ?z]) + (aset standard-display-table ?ґ [?g]) (aset standard-display-table ?Є [?Y ?e]) (aset standard-display-table ?Ї [?Y ?i]) @@ -166,6 +167,7 @@ If the argument is nil, we return the display table to its standard state." (aset standard-display-table ?Љ [?L ?j]) (aset standard-display-table ?Њ [?N ?j]) (aset standard-display-table ?Џ [?D ?j]) + (aset standard-display-table ?Ґ [?G]) (when (equal cyrillic-language "Bulgarian") (aset standard-display-table ?щ [?s ?h ?t]) @@ -182,7 +184,9 @@ If the argument is nil, we return the display table to its standard state." (aset standard-display-table ?й [?i]) (aset standard-display-table ?Й [?Y]) (aset standard-display-table ?ю [?i ?u]) - (aset standard-display-table ?я [?i ?a])))) + (aset standard-display-table ?я [?i ?a]) + (aset standard-display-table ?г [?h]) + (aset standard-display-table ?Г [?H])))) ;; (provide 'cyril-util) diff --git a/lisp/language/cyrillic.el b/lisp/language/cyrillic.el index ba985a4754f..4576373a6d1 100644 --- a/lisp/language/cyrillic.el +++ b/lisp/language/cyrillic.el @@ -1,6 +1,6 @@ -;;; cyrillic.el --- support for Cyrillic -*- coding: utf-8; -*- +;;; cyrillic.el --- support for Cyrillic -*- coding: utf-8; lexical-binding: t; -*- -;; Copyright (C) 1997-1998, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997-1998, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -9,7 +9,7 @@ ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H13PRO009 -;; Author: Kenichi Handa <handa@etl.go.jp> +;; Author: Kenichi Handa <handa@gnu.org> ;; Keywords: multilingual, Cyrillic, i18n ;; This file is part of GNU Emacs. @@ -33,7 +33,7 @@ ;; are converted to Unicode internally. See ;; <URL:http://www.ecma.ch/ecma1/STAND/ECMA-113.HTM>. For more info ;; on Cyrillic charsets, see -;; <URL:http://czyborra.com/charsets/cyrillic.html>. The KOI and +;; <URL:https://czyborra.com/charsets/cyrillic.html>. The KOI and ;; Alternativnyj coding systems should live in code-pages.el, but ;; they've always been preloaded and the coding system autoload ;; mechanism didn't get accepted, so they have to stay here and @@ -95,7 +95,7 @@ (define-coding-system-alias 'cp878 'cyrillic-koi8) (set-language-info-alist - "Cyrillic-KOI8" `((charset koi8) + "Cyrillic-KOI8" '((charset koi8) (coding-system cyrillic-koi8) (coding-priority cyrillic-koi8 cyrillic-iso-8bit) (ctext-non-standard-encodings "koi8-r") @@ -131,7 +131,7 @@ Support for Russian using koi8-r and the russian-computer input method.") :mime-charset 'koi8-u) (set-language-info-alist - "Ukrainian" `((charset koi8-u) + "Ukrainian" '((charset koi8-u) (coding-system koi8-u) (coding-priority koi8-u) (nonascii-translation . koi8-u) @@ -151,7 +151,7 @@ Support for Russian using koi8-r and the russian-computer input method.") (define-coding-system-alias 'alternativnyj 'cyrillic-alternativnyj) (set-language-info-alist - "Cyrillic-ALT" `((charset alternativnyj) + "Cyrillic-ALT" '((charset alternativnyj) (coding-system cyrillic-alternativnyj) (coding-priority cyrillic-alternativnyj) (nonascii-translation . alternativnyj) @@ -169,13 +169,6 @@ Support for Russian using koi8-r and the russian-computer input method.") :charset-list '(ibm866) :mime-charset 'cp866) -(define-coding-system 'koi8-u - "KOI8-U 8-bit encoding for Cyrillic (MIME: KOI8-U)" - :coding-type 'charset - :mnemonic ?U - :charset-list '(koi8-u) - :mime-charset 'koi8-u) - (define-coding-system 'koi8-t "KOI8-T 8-bit encoding for Cyrillic" :coding-type 'charset @@ -229,7 +222,7 @@ Support for Russian using koi8-r and the russian-computer input method.") ;; '("Cyrillic")) (set-language-info-alist - "Tajik" `((coding-system koi8-t) + "Tajik" '((coding-system koi8-t) (coding-priority koi8-t) (nonascii-translation . cyrillic-koi8-t) (charset koi8-t) @@ -239,7 +232,7 @@ Support for Russian using koi8-r and the russian-computer input method.") '("Cyrillic")) (set-language-info-alist - "Bulgarian" `((coding-system windows-1251) + "Bulgarian" '((coding-system windows-1251) (coding-priority windows-1251) (nonascii-translation . windows-1251) (charset windows-1251) @@ -250,7 +243,7 @@ Support for Russian using koi8-r and the russian-computer input method.") '("Cyrillic")) (set-language-info-alist - "Belarusian" `((coding-system windows-1251) + "Belarusian" '((coding-system windows-1251) (coding-priority windows-1251) (nonascii-translation . windows-1251) (charset windows-1251) @@ -262,7 +255,7 @@ Support for Russian using koi8-r and the russian-computer input method.") '("Cyrillic")) (set-language-info-alist - "Ukrainian" `((coding-system koi8-u) + "Ukrainian" '((coding-system koi8-u) (coding-priority koi8-u) (input-method . "ukrainian-computer") (documentation diff --git a/lisp/language/czech.el b/lisp/language/czech.el index 21213c65fd5..de80b73b3fc 100644 --- a/lisp/language/czech.el +++ b/lisp/language/czech.el @@ -1,6 +1,6 @@ -;;; czech.el --- support for Czech -*- coding: utf-8 -*- +;;; czech.el --- support for Czech -*- coding: utf-8; lexical-binding: t -*- -;; Copyright (C) 1998, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001-2022 Free Software Foundation, Inc. ;; Author: Milan Zamazal <pdm@zamazal.org> ;; Maintainer: Pavel Janík <Pavel@Janik.cz> diff --git a/lisp/language/english.el b/lisp/language/english.el index 3e8f3123c3f..278951121a6 100644 --- a/lisp/language/english.el +++ b/lisp/language/english.el @@ -1,6 +1,6 @@ -;;; english.el --- support for English +;;; english.el --- support for English -*- lexical-binding: t; -*- -;; Copyright (C) 1997, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ;; 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -62,6 +62,14 @@ Nothing special is needed to handle English.") :mnemonic ?*) (define-coding-system-alias 'cp1047 'ibm1047) +(define-coding-system 'ibm038 + "International version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm038) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-int 'ibm038) +(define-coding-system-alias 'cp038 'ibm038) + ;; Make "ASCII" an alias of "English" language environment. (set-language-info-alist "ASCII" (cdr (assoc "English" language-info-alist))) diff --git a/lisp/language/ethio-util.el b/lisp/language/ethio-util.el index cdf41ba909e..2f76acfe7cb 100644 --- a/lisp/language/ethio-util.el +++ b/lisp/language/ethio-util.el @@ -1,6 +1,6 @@ -;;; ethio-util.el --- utilities for Ethiopic -*- coding: utf-8-emacs; -*- +;;; ethio-util.el --- utilities for Ethiopic -*- coding: utf-8-emacs; lexical-binding: t; -*- -;; Copyright (C) 1997-1998, 2002-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997-1998, 2002-2022 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ;; 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -98,44 +98,74 @@ ;; users' preference ;; -(defvar ethio-primary-language 'tigrigna +(defgroup ethiopic nil + "Options for writing Ethiopic." + :version "28.1" + :group 'languages) + +(defcustom ethio-primary-language 'tigrigna "Symbol that defines the primary language in SERA --> FIDEL conversion. -The value should be one of: `tigrigna', `amharic' or `english'.") +The value should be one of: `tigrigna', `amharic' or `english'." + :version "28.1" + :type '(choice (const :tag "Tigrigna" tigrigna) + (const :tag "Amharic" amharic) + (const :tag "English" english))) -(defvar ethio-secondary-language 'english +(defcustom ethio-secondary-language 'english "Symbol that defines the secondary language in SERA --> FIDEL conversion. -The value should be one of: `tigrigna', `amharic' or `english'.") +The value should be one of: `tigrigna', `amharic' or `english'." + :version "28.1" + :type '(choice (const :tag "Tigrigna" tigrigna) + (const :tag "Amharic" amharic) + (const :tag "English" english))) -(defvar ethio-use-colon-for-colon nil +(defcustom ethio-use-colon-for-colon nil "Non-nil means associate ASCII colon with Ethiopic colon. If nil, associate ASCII colon with Ethiopic word separator, i.e., two vertically stacked dots. All SERA <--> FIDEL converters refer this -variable.") +variable." + :version "28.1" + :type 'boolean) -(defvar ethio-use-three-dot-question nil - "Non-nil means associate ASCII question mark with Ethiopic old style question mark (three vertically stacked dots). +(defcustom ethio-use-three-dot-question nil + "If non-nil, associate ASCII question mark with Ethiopic question mark. +The Ethiopic old style question mark is three vertically stacked dots. If nil, associate ASCII question mark with Ethiopic stylized question -mark. All SERA <--> FIDEL converters refer this variable.") - -(defvar ethio-quote-vowel-always nil - "Non-nil means always put an apostrophe before an isolated vowel (except at word initial) in FIDEL --> SERA conversion. +mark. All SERA <--> FIDEL converters refer this variable." + :version "28.1" + :type 'boolean) + +(defcustom ethio-quote-vowel-always nil + "Non-nil means always put an apostrophe before an isolated vowel. +This happens in FIDEL --> SERA conversions. Isolated vowels at +word beginning do not get an apostrophe put before them. If nil, put an apostrophe only between a 6th-form consonant and an -isolated vowel.") +isolated vowel." + :version "28.1" + :type 'boolean) -(defvar ethio-W-sixth-always nil - "Non-nil means convert the Wu-form of a 12-form consonant to \"W'\" instead of \"Wu\" in FIDEL --> SERA conversion.") +(defcustom ethio-W-sixth-always nil + "Non-nil means convert the Wu-form of a 12-form consonant to \"W'\". +This is instead of \"Wu\" in FIDEL --> SERA conversion." + :version "28.1" + :type 'boolean) -(defvar ethio-numeric-reduction 0 +(defcustom ethio-numeric-reduction 0 "Degree of reduction in converting Ethiopic digits into Arabic digits. Should be 0, 1 or 2. For example, ({10}{9}{100}{80}{7}) is converted into: \\=`10\\=`9\\=`100\\=`80\\=`7 if `ethio-numeric-reduction' is 0, \\=`109100807 if `ethio-numeric-reduction' is 1, - \\=`10900807 if `ethio-numeric-reduction' is 2.") + \\=`10900807 if `ethio-numeric-reduction' is 2." + :version "28.1" + :type 'integer) -(defvar ethio-java-save-lowercase nil +(defcustom ethio-java-save-lowercase nil "Non-nil means save Ethiopic characters in lowercase hex numbers to Java files. -If nil, use uppercases.") +If nil, use uppercases." + :version "28.1" + :type 'boolean) + (defun ethio-prefer-amharic-p () (or (eq ethio-primary-language 'amharic) @@ -764,15 +794,15 @@ The 2nd and 3rd arguments BEGIN and END specify the region." "This function is deprecated." (interactive "*cInput number: 1. 2. 3. 4. 5.") (cond - ((= arg ?1) + ((eq arg ?1) (insert "")) - ((= arg ?2) + ((eq arg ?2) (insert "")) - ((= arg ?3) + ((eq arg ?3) (insert "")) - ((= arg ?4) + ((eq arg ?4) (insert "")) - ((= arg ?5) + ((eq arg ?5) (insert "")) (t (error "")))) @@ -786,7 +816,7 @@ The 2nd and 3rd arguments BEGIN and END specify the region." "Convert each fidel characters in the current buffer into a fidel-tex command." (interactive) (let ((buffer-read-only nil) - comp ch) + comp) ;; Special treatment for geminated characters. ;; Geminated characters la", etc. change into \geminateG{\laG}, etc. @@ -804,22 +834,23 @@ The 2nd and 3rd arguments BEGIN and END specify the region." ;; Special Ethiopic punctuation. (goto-char (point-min)) - (while (re-search-forward "\\ce[»\\.\\?]\\|«\\ce" nil t) - (cond - ((= (setq ch (preceding-char)) ?\») - (delete-char -1) - (insert "\\rquoteG")) - ((= ch ?.) - (delete-char -1) - (insert "\\dotG")) - ((= ch ??) - (delete-char -1) - (insert "\\qmarkG")) - (t - (forward-char -1) - (delete-char -1) - (insert "\\lquoteG") - (forward-char 1)))) + (while (re-search-forward "\\ce[».?]\\|«\\ce" nil t) + (let ((ch (preceding-char))) + (cond + ((eq ch ?\») + (delete-char -1) + (insert "\\rquoteG")) + ((eq ch ?.) + (delete-char -1) + (insert "\\dotG")) + ((eq ch ??) + (delete-char -1) + (insert "\\qmarkG")) + (t + (forward-char -1) + (delete-char -1) + (insert "\\lquoteG") + (forward-char 1))))) ;; Ethiopic characters to TeX macros (robin-invert-region (point-min) (point-max) "ethiopic-tex") @@ -828,11 +859,12 @@ The 2nd and 3rd arguments BEGIN and END specify the region." (set-buffer-modified-p nil))) ;;;###autoload -(defun ethio-tex-to-fidel-buffer nil +(defun ethio-tex-to-fidel-buffer () "Convert fidel-tex commands in the current buffer into fidel chars." (interactive) - (let ((buffer-read-only nil) - (p) (ch)) + (let ((inhibit-read-only t) + ;; (p) (ch) + ) ;; TeX macros to Ethiopic characters (robin-convert-region (point-min) (point-max) "ethiopic-tex") @@ -967,8 +999,7 @@ Otherwise, [0-9A-F]." ;; Ethiopic word separator vs. ASCII space ;; -(defvar ethio-prefer-ascii-space t) -(make-variable-buffer-local 'ethio-prefer-ascii-space) +(defvar-local ethio-prefer-ascii-space t) (defun ethio-toggle-space nil "Toggle ASCII space and Ethiopic separator for keyboard input." @@ -1014,7 +1045,7 @@ With ARG, insert that many delimiters." ;; ;;;###autoload -(defun ethio-composition-function (pos to font-object string) +(defun ethio-composition-function (pos _to _font-object string _direction) (setq pos (1- pos)) (let ((pattern "\\ce\\(፟\\|\\)")) (if string @@ -2068,6 +2099,10 @@ mark." ;; The ethiopic-tex package is not used for keyboard input, therefore ;; not registered with the register-input-method function. +;; Local Variables: +;; checkdoc-symbol-words: ("-->") +;; End: + (provide 'ethio-util) ;;; ethio-util.el ends here diff --git a/lisp/language/ethiopic.el b/lisp/language/ethiopic.el index f0bb049fdbb..1faba424ba2 100644 --- a/lisp/language/ethiopic.el +++ b/lisp/language/ethiopic.el @@ -1,6 +1,6 @@ -;;; ethiopic.el --- support for Ethiopic -*- coding: utf-8-emacs; -*- +;;; ethiopic.el --- support for Ethiopic -*- coding: utf-8-emacs; lexical-binding: t; -*- -;; Copyright (C) 1997, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -79,8 +79,8 @@ ))) ;; For automatic composition -(aset composition-function-table ? 'ethio-composition-function) -(aset composition-function-table ?፟ 'ethio-composition-function) +(aset composition-function-table ? #'ethio-composition-function) +(aset composition-function-table ?፟ #'ethio-composition-function) (provide 'ethiopic) diff --git a/lisp/language/european.el b/lisp/language/european.el index d9ce05c24ae..937215074bc 100644 --- a/lisp/language/european.el +++ b/lisp/language/european.el @@ -1,6 +1,6 @@ -;;; european.el --- support for European languages -*- coding: utf-8; -*- +;;; european.el --- support for European languages -*- coding: utf-8; lexical-binding: t; -*- -;; Copyright (C) 1997-1998, 2000-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997-1998, 2000-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -324,6 +324,87 @@ Latin-9 is sometimes nicknamed `Latin-0'.")) :mime-charset 'windows-1257) (define-coding-system-alias 'cp1257 'windows-1257) +(define-coding-system 'ibm256 + "Netherlands version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm256) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-int1 'ibm256) +(define-coding-system-alias 'cp256 'ibm256) + +(define-coding-system 'ibm273 + "Austrian / German version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm273) + :mnemonic ?*) +(define-coding-system-alias 'cp273 'ibm273) + +(define-coding-system 'ibm274 + "Belgian version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm274) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-be 'ibm274) +(define-coding-system-alias 'cp274 'ibm274) + +(define-coding-system 'ibm275 + "Brazilian version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm275) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-br 'ibm275) +(define-coding-system-alias 'cp275 'ibm275) + +(define-coding-system 'ibm277 + "Danish / Norwegian version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm277) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-cp-dk 'ibm277) +(define-coding-system-alias 'ebcdic-cp-no 'ibm277) +(define-coding-system-alias 'cp277 'ibm277) + +(define-coding-system 'ibm278 + "Finnish / Swedish version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm278) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-cp-fi 'ibm278) +(define-coding-system-alias 'ebcdic-cp-se 'ibm278) +(define-coding-system-alias 'cp278 'ibm278) + +(define-coding-system 'ibm280 + "Italian version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm280) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-cp-it 'ibm280) +(define-coding-system-alias 'cp280 'ibm280) + +(define-coding-system 'ibm284 + "Spanish version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm284) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-cp-es 'ibm284) +(define-coding-system-alias 'cp284 'ibm284) + +(define-coding-system 'ibm285 + "UK English version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm285) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-cp-gb 'ibm285) +(define-coding-system-alias 'cp285 'ibm285) + +(define-coding-system 'ibm297 + "French version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm297) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-cp-fr 'ibm297) +(define-coding-system-alias 'cp297 'ibm297) + (define-coding-system 'cp775 "DOS codepage 775 (PC Baltic, MS-DOS Baltic Rim)" :coding-type 'charset @@ -525,7 +606,7 @@ method and applying Turkish case rules for the characters i, I, ı, İ."))) (set-case-syntax ?ı "w" table))) ;; Polish ISO 8859-2 environment. -;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl> +;; Maintainer: Włodek Bzyl <matwb@univ.gda.pl> ;; Keywords: multilingual, Polish (set-language-info-alist @@ -541,7 +622,7 @@ method and applying Turkish case rules for the characters i, I, ı, İ."))) '("European")) (set-language-info-alist - "Welsh" `((coding-system utf-8 latin-8) ; the input method is Unicode-based + "Welsh" '((coding-system utf-8 latin-8) ; the input method is Unicode-based (coding-priority utf-8 latin-8) (nonascii-translation . iso-8859-14) (input-method . "welsh") @@ -558,7 +639,7 @@ method and applying Turkish case rules for the characters i, I, ı, İ."))) '("European")) (set-language-info-alist - "Latin-7" `((coding-system latin-7) + "Latin-7" '((coding-system latin-7) (coding-priority latin-7) (nonascii-translation . iso-8859-13) (input-method . "latin-prefix") @@ -566,7 +647,7 @@ method and applying Turkish case rules for the characters i, I, ı, İ."))) '("European")) (set-language-info-alist - "Lithuanian" `((coding-system latin-7 windows-1257) + "Lithuanian" '((coding-system latin-7 windows-1257) (coding-priority latin-7) (nonascii-translation . iso-8859-13) (input-method . "lithuanian-keyboard") @@ -574,7 +655,7 @@ method and applying Turkish case rules for the characters i, I, ı, İ."))) '("European")) (set-language-info-alist - "Latvian" `((coding-system latin-7 windows-1257) + "Latvian" '((coding-system latin-7 windows-1257) (coding-priority latin-7) (nonascii-translation . iso-8859-13) (input-method . "latvian-keyboard") diff --git a/lisp/language/georgian.el b/lisp/language/georgian.el index 43718092959..a268b8c23fd 100644 --- a/lisp/language/georgian.el +++ b/lisp/language/georgian.el @@ -1,6 +1,6 @@ -;;; georgian.el --- language support for Georgian +;;; georgian.el --- language support for Georgian -*- lexical-binding: t -*- -;; Copyright (C) 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 2001-2022 Free Software Foundation, Inc. ;; Author: Dave Love <fx@gnu.org> ;; Keywords: i18n @@ -37,7 +37,7 @@ :charset-list '(georgian-academy)) (set-language-info-alist - "Georgian" `((coding-system georgian-ps) + "Georgian" '((coding-system georgian-ps) (coding-priority georgian-ps) (input-method . "georgian") (nonascii-translation . georgian-ps) diff --git a/lisp/language/greek.el b/lisp/language/greek.el index 1a401480642..920cf67d871 100644 --- a/lisp/language/greek.el +++ b/lisp/language/greek.el @@ -1,6 +1,6 @@ -;;; greek.el --- support for Greek +;;; greek.el --- support for Greek -*- lexical-binding: t -*- -;; Copyright (C) 2002, 2013-2017 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2013-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -79,7 +79,9 @@ (coding-priority greek-iso-8bit) (nonascii-translation . iso-8859-7) (input-method . "greek") - (documentation . t))) + (documentation . "Support for Greek ISO-8859-7 using the greek input method.") + (sample-text . "Greek (ελληνικά) Γειά σας") + (tutorial . "TUTORIAL.el_GR"))) (provide 'greek) diff --git a/lisp/language/hanja-util.el b/lisp/language/hanja-util.el index 6af47982bae..0c2419c91cd 100644 --- a/lisp/language/hanja-util.el +++ b/lisp/language/hanja-util.el @@ -1,6 +1,6 @@ -;;; hanja-util.el --- Korean Hanja util module -*- coding: utf-8 -*- +;;; hanja-util.el --- Korean Hanja util module -*- lexical-binding: t; -*- -;; Copyright (C) 2008-2017 Free Software Foundation, Inc. +;; Copyright (C) 2008-2022 Free Software Foundation, Inc. ;; Author: Jihyun Cho <jihyun.jo@gmail.com> ;; Keywords: multilingual, input method, Korean, Hanja @@ -22,7 +22,7 @@ ;;; Commentary: -;; This file defines korean hanja table and symbol table. +;; This file defines the Korean Hanja table and symbol table. ;;; Code: @@ -31,7 +31,7 @@ (defvar hanja-table nil "A char table for Hanja characters. -It maps a hangul character to a list of the corresponding Hanja characters. +It maps a Hangul character to a list of the corresponding Hanja characters. Each element of the list has the form CHAR or (CHAR . STRING) where CHAR is a Hanja character and STRING is the meaning of that character. This variable is initialized by `hanja-init-load'.") @@ -6573,8 +6573,8 @@ The value is a hanja character that is selected interactively." (hanja-filter (lambda (x) (car x)) (mapcar (lambda (c) (if (listp c) - (cons (decode-char 'ucs (car c)) (cdr c)) - (list (decode-char 'ucs c)))) + (cons (car c) (cdr c)) + (list c))) (aref hanja-table char))))) (unwind-protect (when (aref hanja-conversions 2) diff --git a/lisp/language/hebrew.el b/lisp/language/hebrew.el index 9e049de8b5f..6cec9f1274e 100644 --- a/lisp/language/hebrew.el +++ b/lisp/language/hebrew.el @@ -1,6 +1,6 @@ -;;; hebrew.el --- support for Hebrew -*- coding: utf-8 -*- +;;; hebrew.el --- support for Hebrew -*- coding: utf-8; lexical-binding: t; -*- -;; Copyright (C) 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -152,7 +152,7 @@ Bidirectional editing is supported."))) ;; (3) If the font has precomposed glyphs, use them as far as ;; possible. Adjust the remaining glyphs artificially. -(defun hebrew-shape-gstring (gstring) +(defun hebrew-shape-gstring (gstring direction) (let* ((font (lgstring-font gstring)) (otf (font-get font :otf)) (nchars (lgstring-char-len gstring)) @@ -172,7 +172,7 @@ Bidirectional editing is supported."))) ((or (assq 'hebr (car otf)) (assq 'hebr (cdr otf))) ;; FONT has OpenType features for Hebrew. - (font-shape-gstring gstring)) + (font-shape-gstring gstring direction)) (t ;; FONT doesn't have OpenType features for Hebrew. @@ -217,7 +217,7 @@ Bidirectional editing is supported."))) ;; Now IDX is an index to the first non-precomposed glyph. ;; Adjust positions of the remaining glyphs artificially. (if (font-get font :combining-capability) - (font-shape-gstring gstring) + (font-shape-gstring gstring direction) (setq base-width (lglyph-width (lgstring-glyph gstring 0))) (while (< idx nglyphs) (setq glyph (lgstring-glyph gstring idx)) @@ -238,15 +238,16 @@ Bidirectional editing is supported."))) (setq idx (1+ idx))))))) gstring)) -(let* ((base "[\u05D0-\u05F2]") - (combining "[\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7]+") +(let* ((base "[\u05D0-\u05F2\uFB1D\uFB1F-\uFB28\uFB2A-\uFB4F]") + (combining + "[\u034F\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\uFB1E]+") (pattern1 (concat base combining)) (pattern2 (concat base "\u200D" combining))) (set-char-table-range composition-function-table '(#x591 . #x5C7) - (list (vector pattern2 3 'hebrew-shape-gstring) - (vector pattern2 2 'hebrew-shape-gstring) - (vector pattern1 1 'hebrew-shape-gstring) + (list (vector pattern2 3 #'hebrew-shape-gstring) + (vector pattern2 2 #'hebrew-shape-gstring) + (vector pattern1 1 #'hebrew-shape-gstring) [nil 0 hebrew-shape-gstring])) ;; Exclude non-combining characters. (set-char-table-range diff --git a/lisp/language/ind-util.el b/lisp/language/ind-util.el index fc8f4c9d983..27facaa858f 100644 --- a/lisp/language/ind-util.el +++ b/lisp/language/ind-util.el @@ -1,8 +1,7 @@ -;;; ind-util.el --- Transliteration and Misc. Tools for Indian Languages -*- coding: utf-8-emacs; -*- +;;; ind-util.el --- Transliteration and Misc. Tools for Indian Languages -*- coding: utf-8-emacs; lexical-binding: t; -*- -;; Copyright (C) 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 2001-2022 Free Software Foundation, Inc. -;; Maintainer: KAWABATA, Taichi <kawabata@m17n.org> ;; Keywords: multilingual, Indian, Devanagari ;; This file is part of GNU Emacs. @@ -41,7 +40,7 @@ (defun indian-regexp-of-hashtbl-keys (hashtbl) "Return the regular expression of hash table keys." (let (keys) - (maphash (lambda (key val) (push key keys)) hashtbl) + (maphash (lambda (key _val) (push key keys)) hashtbl) (regexp-opt keys))) (defvar indian-dev-base-table @@ -233,8 +232,8 @@ '( (;; VOWELS (?അ nil) (?ആ ?ാ) (?ഇ ?ി) (?ഈ ?ീ) (?ഉ ?ു) (?ഊ ?ൂ) - (?ഋ ?ൃ) (?ഌ nil) nil (?ഏ ?േ) (?എ ?െ) (?ഐ ?ൈ) - nil (?ഓ ?ോ) (?ഒ ?ൊ) (?ഔ ?ൌ) nil nil) + (?ഋ ?ൃ) (?ഌ ?ൢ) (?ൡ ?ൣ) (?ഏ ?േ) (?എ ?െ) (?ഐ ?ൈ) + nil (?ഒ ?ൊ) (?ഓ ?ോ) (?ഔ ?ൗ) (?് ?്) (?ൠ ?ൄ)) (;; CONSONANTS ?ക ?ഖ ?ഗ ?ഘ ?ങ ;; GUTTRULS ?ച ?ഛ ?ജ ?ഝ ?ഞ ;; PALATALS @@ -244,13 +243,16 @@ ?യ ?ര ?റ ?ല ?ള ?ഴ ?വ ;; SEMIVOWELS ?ശ ?ഷ ?സ ?ഹ ;; SIBILANTS nil nil nil nil nil nil nil nil ;; NUKTAS - "ജ്ഞ" "ക്ഷ") + "ജ്ഞ" "ക്ഷ" + "റ്റ" "ന്റ" "ത്ത" "ത്ഥ" "ഞ്ഞ" "ങ്ങ" "ന്ന" + "ഞ്ച" "ന്ക" "ങ്ക" "ച്ച" "ച്ഛ" "ക്ക" + "ബ്ബ" "ക്ക" "ഗ്ഗ" "ജ്ജ" "മ്മ" "പ്പ" "വ്വ" "ക്സ" "ശ്ശ") (;; Misc Symbols nil ?ം ?ഃ nil ?് nil nil) (;; Digits ?൦ ?൧ ?൨ ?൩ ?൪ ?൫ ?൬ ?൭ ?൮ ?൯) - (;; Inscript-extra (4) (#, $, ^, *, ]) - "്ര" "ര്" "ത്ര" "ശ്ര" nil))) + (;; Chillus + "ണ്" ?ൺ "ന്" ?ൻ "ര്" ?ർ "ല്" ?ൽ "ള്" ?ൾ))) (defvar indian-tml-base-table '( @@ -265,11 +267,34 @@ ?த nil nil nil ?ந ?ன ;; DENTALS ?ப nil nil nil ?ம ;; LABIALS ?ய ?ர ?ற ?ல ?ள ?ழ ?வ ;; SEMIVOWELS - nil ?ஷ ?ஸ ?ஹ ;; SIBILANTS + ?ஶ ?ஷ ?ஸ ?ஹ ;; SIBILANTS + nil nil nil nil nil nil nil nil ;; NUKTAS + "ஜ்ஞ" "க்ஷ" "க்ஷ") + (;; Misc Symbols + nil ?ஂ ?ஃ nil ?் ?ௐ nil) + (;; Digits + nil nil nil nil nil nil nil nil nil nil) + (;; Inscript-extra (4) (#, $, ^, *, ]) + "்ர" "ர்" "த்ர" nil nil))) + +(defvar indian-tml-base-digits-table + '( + (;; VOWELS + (?அ nil) (?ஆ ?ா) (?இ ?ி) (?ஈ ?ீ) (?உ ?ு) (?ஊ ?ூ) + nil nil nil (?ஏ ?ே) (?எ ?ெ) (?ஐ ?ை) + nil (?ஓ ?ோ) (?ஒ ?ொ) (?ஔ ?ௌ) nil nil) + (;; CONSONANTS + ?க nil nil nil ?ங ;; GUTTRULS + ?ச nil ?ஜ nil ?ஞ ;; PALATALS + ?ட nil nil nil ?ண ;; CEREBRALS + ?த nil nil nil ?ந ?ன ;; DENTALS + ?ப nil nil nil ?ம ;; LABIALS + ?ய ?ர ?ற ?ல ?ள ?ழ ?வ ;; SEMIVOWELS + ?ஶ ?ஷ ?ஸ ?ஹ ;; SIBILANTS nil nil nil nil nil nil nil nil ;; NUKTAS - "ஜ்ஞ" "க்ஷ") + "ஜ்ஞ" "க்ஷ" "க்ஷ") (;; Misc Symbols - nil ?ஂ ?ஃ nil ?் nil nil) + nil ?ஂ ?ஃ nil ?் ?ௐ nil) (;; Digits ?௦ ?௧ ?௨ ?௩ ?௪ ?௫ ?௬ ?௭ ?௮ ?௯) (;; Inscript-extra (4) (#, $, ^, *, ]) @@ -290,8 +315,8 @@ '(;; for encode/decode (;; vowels -- 18 "a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U") - ("RRi" "R^i") ("LLi" "L^i") (".c" "e.c") "E" "e" "ai" - "o.c" "O" "o" "au" ("RRI" "R^I") ("LLI" "L^I")) + ("RRi" "R^i" "RRu" "R^u") ("LLi" "L^i") (".c" "e.c") "E" "e" "ai" + "o.c" "O" "o" "au" ("RRI" "R^I" "RRU" "R^U") ("LLI" "L^I")) (;; consonants -- 40 "k" "kh" "g" "gh" ("~N" "N^") "ch" ("Ch" "chh") "j" "jh" ("~n" "JN") @@ -324,6 +349,29 @@ (;; misc -- 7 ".N" (".n" "M") "H" ".a" ".h" ("AUM" "OM") ".."))) +(defvar indian-mlm-mozhi-table + '(;; for encode/decode + (;; vowels -- 18 + "a" ("aa" "A") "i" ("ii" "I") "u" ("uu" "U") + "R" "Ll" "Lll" ("E" "ae") "e" "ai" + nil "o" "O" "au" "~" "RR") + (;; consonants -- 40 + ("k" "c") "kh" "g" "gh" "ng" + "ch" ("Ch" "chh") "j" "jh" "nj" + "T" "Th" "D" "Dh" "N" + "th" "thh" "d" "dh" "n" nil + "p" ("ph" "f") "b" "bh" "m" + "y" "r" "rr" "l" "L" "zh" ("v" "w") + ("S" "z") "sh" "s" "h" + nil nil nil nil nil nil nil nil + nil "X" + ;; some of these are extra to Mozhi + ("t" "tt") "nt" "tth" "tthh" "nnj" "nng" "nn" + "nch" "nc" "nk" "cch" "cchh" "cc" + "B" ("C" "K" "q") "G" "J" "M" "P" "V" "x" "Z") + (;; misc -- 7 + nil nil "H"))) + (defvar indian-kyoto-harvard-table '(;; for encode/decode (;; vowel @@ -462,7 +510,7 @@ c trans-c)) (defun indian-make-hash (table trans-table) - "Indian Transliteration Hash for decode/encode" + "Indian Transliteration Hash for decode/encode." (let* ((encode-hash (make-hash-table :test 'equal)) (decode-hash (make-hash-table :test 'equal)) (hashtbls (cons encode-hash decode-hash)) @@ -525,9 +573,17 @@ (indian-make-hash indian-mlm-base-table indian-itrans-v5-table)) +(defvar indian-mlm-mozhi-hash + (indian-make-hash indian-mlm-base-table + indian-mlm-mozhi-table)) + (defvar indian-tml-itrans-v5-hash (indian-make-hash indian-tml-base-table indian-itrans-v5-table-for-tamil)) + +(defvar indian-tml-itrans-digits-v5-hash + (indian-make-hash indian-tml-base-digits-table + indian-itrans-v5-table-for-tamil)) ) (defmacro indian-translate-region (from to hashtable encode-p) @@ -536,7 +592,7 @@ (let ((regexp ,(indian-regexp-of-hashtbl-keys (if encode-p (car (eval hashtable)) (cdr (eval hashtable)))))) - (narrow-to-region from to) + (narrow-to-region ,from ,to) (goto-char (point-min)) (while (re-search-forward regexp nil t) (let ((matchstr (gethash (match-string 0) @@ -584,7 +640,7 @@ ;; The followings provide conversion between IS 13194 (ISCII) and UCS. -(let +(dlet ;;Unicode vs IS13194 ;; only Devanagari is supported now. ((ucs-devanagari-to-is13194-alist '((?\x0900 . "[U+0900]") @@ -776,31 +832,31 @@ (defvar is13194-to-ucs-kannada-hashtbl nil) (defvar is13194-to-ucs-kannada-regexp nil) -(defvar ucs-to-is13194-regexp +(defvar indian-ucs-to-is13194-regexp ;; only Devanagari is supported now. (concat "[" (char-to-string #x0900) "-" (char-to-string #x097f) "]") - "Regexp that matches to conversion") + "Regexp that matches to conversion.") -(defun ucs-to-iscii-region (from to) - "Converts the indian UCS characters in the region to ISCII. -Returns new end position." +(defun indian-ucs-to-iscii-region (from to) + "Convert the indian UCS characters in the region to ISCII. +Return new end position." (interactive "r") ;; only Devanagari is supported now. (save-excursion (save-restriction (narrow-to-region from to) (goto-char (point-min)) - (let* ((current-repertory is13194-default-repertory)) - (while (re-search-forward ucs-to-is13194-regexp nil t) + ;; (let* ((current-repertory is13194-default-repertory)) + (while (re-search-forward indian-ucs-to-is13194-regexp nil t) (replace-match (get-char-code-property (string-to-char (match-string 0)) - 'iscii)))) + 'iscii)));; ) (point-max)))) -(defun iscii-to-ucs-region (from to) - "Converts the ISCII characters in the region to UCS. -Returns new end position." +(defun indian-iscii-to-ucs-region (from to) + "Convert the ISCII characters in the region to UCS. +Return new end position." (interactive "r") ;; only Devanagari is supported now. (save-excursion @@ -829,6 +885,9 @@ Returns new end position." (let ((pos from) newpos func (max to)) (narrow-to-region from to) (while (< pos max) + ;; FIXME: The below seems to assume + ;; composition-function-table holds functions? That is no + ;; longer true, since long ago. (setq func (aref composition-function-table (char-after pos))) (if (fboundp func) (setq newpos (funcall func pos nil) @@ -846,7 +905,7 @@ Returns new end position." ;;;###autoload (defun in-is13194-post-read-conversion (len) (let ((pos (point)) endpos) - (setq endpos (iscii-to-ucs-region pos (+ pos len))) + (setq endpos (indian-iscii-to-ucs-region pos (+ pos len))) (- endpos pos))) ;;;###autoload @@ -856,7 +915,7 @@ Returns new end position." (if (stringp from) (insert from) (insert-buffer-substring buf from to)) - (ucs-to-iscii-region (point-min) (point-max)) + (indian-ucs-to-iscii-region (point-min) (point-max)) nil)) @@ -1214,7 +1273,7 @@ Returns new end position." (interactive "r") (save-excursion (save-restriction - (let ((pos from) + (let (;; (pos from) (alist (char-table-extra-slot indian-2-column-to-ucs-chartable 0))) (narrow-to-region from to) (decompose-region from to) diff --git a/lisp/language/indian.el b/lisp/language/indian.el index 0bb123e1899..407173827fe 100644 --- a/lisp/language/indian.el +++ b/lisp/language/indian.el @@ -1,12 +1,10 @@ -;;; indian.el --- Indian languages support -*- coding: utf-8; -*- +;;; indian.el --- Indian languages support -*- coding: utf-8; lexical-binding: t; -*- -;; Copyright (C) 1997, 1999, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1999, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 -;; Maintainer: Kenichi Handa <handa@m17n.org> -;; KAWABATA, Taichi <kawabata@m17n.org> ;; Keywords: multilingual, i18n, Indian ;; This file is part of GNU Emacs. @@ -27,7 +25,7 @@ ;;; Commentary: ;; This file contains definitions of Indian language environments, and -;; setups for displaying the scrtipts used there. +;; setups for displaying the scripts used there. ;;; Code: @@ -47,8 +45,9 @@ (coding-system utf-8) (coding-priority utf-8) (input-method . "devanagari-aiba") + (sample-text . "Devanagari (देवनागरी) नमस्ते / नमस्कार") (documentation . "\ -Such languages using Devanagari script as Hindi and Marathi +Such languages using Devanagari script as Hindi, Marathi and Nepali are supported in this language environment.")) '("Indian")) @@ -57,16 +56,18 @@ are supported in this language environment.")) (coding-system utf-8) (coding-priority utf-8) (input-method . "bengali-itrans") + (sample-text . "Bengali (বাংলা) নমস্কার") (documentation . "\ Such languages using Bengali script as Bengali and Assamese are supported in this language environment.")) '("Indian")) (set-language-info-alist - "Punjabi" '((charset unicode) + "Gurmukhi" '((charset unicode) (coding-system utf-8) (coding-priority utf-8) (input-method . "punjabi-itrans") + (sample-text . "Gurmukhi (ਗੁਰਮੁਖੀ) ਸਤ ਸ੍ਰੀ ਅਕਾਲ") (documentation . "\ North Indian language Punjabi is supported in this language environment.")) '("Indian")) @@ -76,17 +77,31 @@ North Indian language Punjabi is supported in this language environment.")) (coding-system utf-8) (coding-priority utf-8) (input-method . "gujarati-itrans") + (sample-text . "Gujarati (ગુજરાતી) નમસ્તે") (documentation . "\ North Indian language Gujarati is supported in this language environment.")) '("Indian")) (set-language-info-alist + "Odia" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "odia") + (sample-text . "Odia (ଓଡ଼ିଆ) ନମସ୍କାର") + (documentation . "\ +Such languages using the Odia script as Odia, Khonti, and Santali +are supported in this language environment. (This language +environment was formerly known as \"Oriya\").")) + '("Indian")) + +(set-language-info-alist "Oriya" '((charset unicode) - (coding-system utf-8) - (coding-priority utf-8) - (input-method . "oriya-itrans") - (documentation . "\ -Such languages using Oriya script as Oriya, Khonti, and Santali + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "odia") + (sample-text . "Odia (ଓଡ଼ିଆ) ନମସ୍କାର") + (documentation . "\ +Such languages using the Odia script as Odia, Khonti, and Santali are supported in this language environment.")) '("Indian")) @@ -94,7 +109,8 @@ are supported in this language environment.")) "Tamil" '((charset unicode) (coding-system utf-8) (coding-priority utf-8) - (input-method . "tamil-itrans") + (input-method . "tamil-phonetic") + (sample-text . "Tamil (தமிழ்) வணக்கம்") (documentation . "\ South Indian Language Tamil is supported in this language environment.")) '("Indian")) @@ -104,6 +120,7 @@ South Indian Language Tamil is supported in this language environment.")) (coding-system utf-8) (coding-priority utf-8) (input-method . "telugu-itrans") + (sample-text . "Telugu (తెలుగు) నమస్కారం") (documentation . "\ South Indian Language Telugu is supported in this language environment.")) '("Indian")) @@ -115,7 +132,7 @@ South Indian Language Telugu is supported in this language environment.")) (input-method . "kannada-itrans") (sample-text . "Kannada (ಕನ್ನಡ) ನಮಸ್ಕಾರ") (documentation . "\ -Kannada language and script is supported in this language +Kannada language and script are supported in this language environment.")) '("Indian")) @@ -124,10 +141,131 @@ environment.")) (coding-system utf-8) (coding-priority utf-8) (input-method . "malayalam-itrans") + (sample-text . "Malayalam (മലയാളം) നമസ്കാരം") (documentation . "\ South Indian language Malayalam is supported in this language environment.")) '("Indian")) +(set-language-info-alist + "Brahmi" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "brahmi") + (sample-text . "Brahmi (𑀩𑁆𑀭𑀸𑀳𑁆𑀫𑀻) 𑀦𑀫𑀲𑁆𑀢𑁂") + (documentation . "\ +The ancient Brahmi script is supported in this language environment.")) + '("Indian")) ; Should we have an "Old" category? + +(set-language-info-alist + "Kaithi" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "kaithi") + (sample-text . "Kaithi (𑂍𑂶𑂟𑂲) 𑂩𑂰𑂧𑂩𑂰𑂧") + (documentation . "\ +Languages such as Awadhi, Bhojpuri, Magahi and Maithili +which used the Kaithi script are supported in this language environment.")) + '("Indian")) + +(set-language-info-alist + "Tirhuta" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "tirhuta") + (sample-text . "Tirhuta (𑒞𑒱𑒩𑒯𑒳𑒞𑒰) 𑒣𑓂𑒩𑒢𑒰𑒧 / 𑒮𑒲𑒞𑒰𑒩𑒰𑒧") + (documentation . "\ +Maithili language and its script Tirhuta are supported in this +language environment.")) + '("Indian")) + +(set-language-info-alist + "Sharada" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "sharada") + (sample-text . "Sharada (𑆯𑆳𑆫𑆢𑆳) 𑆤𑆩𑆱𑇀𑆑𑆳𑆫") + (documentation . "\ +Kashmiri language and its script Sharada are supported in this +language environment.")) + '("Indian")) + +(set-language-info-alist + "Siddham" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "siddham") + (sample-text . "Siddham (𑖭𑖰𑖟𑖿𑖠𑖽) 𑖡𑖦𑖭𑖿𑖝𑖸") + (documentation . "\ +Sanskrit language and one of its script Siddham are supported +in this language environment.")) + '("Indian")) + +(set-language-info-alist + "Syloti Nagri" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "syloti-nagri") + (sample-text . "Syloti Nagri (ꠍꠤꠟꠐꠤ ꠘꠣꠉꠞꠤ) ꠀꠌ꠆ꠍꠣꠟꠣꠝꠥ ꠀꠟꠣꠁꠇꠥꠝ / ꠘꠝꠡ꠆ꠇꠣꠞ") + (documentation . "\ +Sylheti language and its script Syloti Nagri are supported +in this language environment.")) + '("Indian")) + +(set-language-info-alist + "Modi" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "modi") + (sample-text . "Modi (𑘦𑘻𑘚𑘲) 𑘡𑘦𑘭𑘿𑘎𑘰𑘨") + (documentation . "\ +Marathi language and one of its script Modi are supported +in this language environment.")) + '("Indian")) + +(set-language-info-alist + "Limbu" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "limbu") + (sample-text . "Limbu (ᤕᤠᤰᤌᤢᤱ ᤐᤠᤴ) ᤛᤣᤘᤠᤖᤥ") + (documentation . "\ +Limbu language and its script are supported in this +language environment.")) + '("Indian")) + +(set-language-info-alist + "Grantha" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "grantha") + (sample-text . "Grantha (𑌗𑍍𑌰𑌨𑍍𑌥) 𑌨𑌮𑌸𑍍𑌤𑍇 / 𑌨𑌮𑌸𑍍𑌕𑌾𑌰𑌃") + (documentation . "\ +Languages such as Sanskrit and Manipravalam, when they use the +Grantha script, are supported in this language environment.")) + '("Indian")) + +(set-language-info-alist + "Lepcha" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "lepcha") + (sample-text . "Lepcha (ᰛᰩᰵᰛᰧᰵᰶ) ᰂᰦᰕᰥᰬ") + (documentation . "\ +Lepcha language and its script are supported in this +language environment.")) + '("Indian")) + +(set-language-info-alist + "Meetei Mayek" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "meetei-mayek") + (sample-text . "Meetei Mayek (ꯃꯤꯇꯩ ꯃꯌꯦꯛ) ꯈꯨꯔꯨꯝꯖꯔꯤ") + (documentation . "\ +Meetei language and its script Meetei Mayek are supported in this +language environment.")) + '("Indian")) + ;; Replace mnemonic characters in REGEXP according to TABLE. TABLE is ;; an alist of (MNEMONIC-STRING . REPLACEMENT-STRING). @@ -141,14 +279,16 @@ South Indian language Malayalam is supported in this language environment.")) (let ((table '(("a" . "[\u0900-\u0902]") ; vowel modifier (above) ("A" . "\u0903") ; vowel modifier (post) - ("V" . "[\u0904-\u0914\u0960-\u0961\u0972]") ; independent vowel + ("V" . "[\u0904-\u0914\u0960\u0961\u0972]") ; independent vowel ("C" . "[\u0915-\u0939\u0958-\u095F\u0979-\u097F]") ; consonant ("R" . "\u0930") ; RA ("n" . "\u093C") ; NUKTA - ("v" . "[\u093E-\u094C\u094E\u0955\u0962-\u0963]") ; vowel sign + ("v" . "[\u093E-\u094C\u094E\u0955\u0962\u0963]") ; vowel sign ("H" . "\u094D") ; HALANT - ("s" . "[\u0951-\u0952]") ; stress sign - ("t" . "[\u0953-\u0954]") ; accent + ("s" . "[\u0951\u0952]") ; stress sign + ("t" . "[\u0953\u0954]") ; accent + ("1" . "\u0967") ; numeral 1 + ("3" . "\u0969") ; numeral 3 ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ ("X" . "[\u0900-\u097F]")))) ; all coverage @@ -160,6 +300,8 @@ South Indian language Malayalam is supported in this language environment.")) "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*n?a?s?t?A?\\)\\|" ;; special consonant form, or "JHR\\|" + ;; vedic accents with numerals, or + "1ss?\\|3ss\\|s3ss\\|" ;; any other singleton characters "X") table)) @@ -168,16 +310,17 @@ South Indian language Malayalam is supported in this language environment.")) (defconst bengali-composable-pattern (let ((table '(("a" . "\u0981") ; SIGN CANDRABINDU - ("A" . "[\u0982-\u0983]") ; SIGN ANUSVARA .. VISARGA - ("V" . "[\u0985-\u0994\u09E0-\u09E1]") ; independent vowel - ("C" . "[\u0995-\u09B9\u09DC-\u09DF\u09F1]") ; consonant - ("B" . "[\u09AC\u09AF-\u09B0\u09F0]") ; BA, YA, RA + ("A" . "[\u0982\u0983]") ; SIGN ANUSVARA .. VISARGA + ("V" . "[\u0985-\u0994\u09E0\u09E1]") ; independent vowel + ("C" . "[\u0995-\u09B9\u09DC-\u09DF\u09F0\u09F1]") ; consonant + ("B" . "[\u09AC\u09AF\u09B0\u09F0]") ; BA, YA, RA ("R" . "[\u09B0\u09F0]") ; RA ("n" . "\u09BC") ; NUKTA - ("v" . "[\u09BE-\u09CC\u09D7\u09E2-\u09E3]") ; vowel sign + ("v" . "[\u09BE-\u09CC\u09D7\u09E2\u09E3]") ; vowel sign ("H" . "\u09CD") ; HALANT ("T" . "\u09CE") ; KHANDA TA - ("N" . "\u200C") ; ZWNJ + ("S" . "\u09FE") ; SANDHI MARK + ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ ("X" . "[\u0980-\u09FF]")))) ; all coverage (indian-compose-regexp @@ -185,7 +328,7 @@ South Indian language Malayalam is supported in this language environment.")) ;; syllables with an independent vowel, or "\\(?:RH\\)?Vn?\\(?:J?HB\\)?v*n?a?A?\\|" ;; consonant-based syllables, or - "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*[NJ]?v?a?A?\\)\\|" + "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*[NJ]?v?a?A?S?\\)\\|" ;; another syllables with an independent vowel, or "\\(?:RH\\)?T\\|" ;; special consonant form, or @@ -197,11 +340,11 @@ South Indian language Malayalam is supported in this language environment.")) (defconst gurmukhi-composable-pattern (let ((table - '(("a" . "[\u0A01-\u0A02\u0A70]") ; SIGN ADAK BINDI .. BINDI, TIPPI + '(("a" . "[\u0A01\u0A02\u0A70]") ; SIGN ADAK BINDI .. BINDI, TIPPI ("A" . "\u0A03") ; SIGN VISARGA ("V" . "[\u0A05-\u0A14]") ; independent vowel ("C" . "[\u0A15-\u0A39\u0A59-\u0A5E]") ; consonant - ("Y" . "[\u0A2F-u0A30\u0A35\u0A39]") ; YA, RA, VA, HA + ("Y" . "[\u0A2F\u0A30\u0A35\u0A39]") ; YA, RA, VA, HA ("n" . "\u0A3C") ; NUKTA ("v" . "[\u0A3E-\u0A4C]") ; vowel sign ("H" . "\u0A4D") ; VIRAMA @@ -223,13 +366,13 @@ South Indian language Malayalam is supported in this language environment.")) (defconst gujarati-composable-pattern (let ((table - '(("a" . "[\u0A81-\u0A82]") ; SIGN CANDRABINDU .. ANUSVARA + '(("a" . "[\u0A81\u0A82]") ; SIGN CANDRABINDU .. ANUSVARA ("A" . "\u0A83") ; SIGN VISARGA - ("V" . "[\u0A85-\u0A94\u0AE0-\u0AE1]") ; independent vowel + ("V" . "[\u0A85-\u0A94\u0AE0\u0AE1]") ; independent vowel ("C" . "[\u0A95-\u0AB9]") ; consonant ("R" . "\u0AB0") ; RA ("n" . "\u0ABC") ; NUKTA - ("v" . "[\u0ABE-\u0ACC\u0AE2-\u0AE3]") ; vowel sign + ("v" . "[\u0ABE-\u0ACC\u0AE2\u0AE3]") ; vowel sign ("H" . "\u0ACD") ; VIRAMA ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ @@ -250,13 +393,13 @@ South Indian language Malayalam is supported in this language environment.")) (defconst oriya-composable-pattern (let ((table '(("a" . "\u0B01") ; SIGN CANDRABINDU - ("A" . "[\u0B02-\u0B03]") ; SIGN ANUSVARA .. VISARGA - ("V" . "[\u0B05-\u0B14\u0B60-\u0B61]") ; independent vowel - ("C" . "[\u0B15-\u0B39\u0B5C-\u0B5D\u0B71]") ; consonant - ("B" . "[\u0B15-\u0B17\u0B1B-\u0B1D\u0B1F-\u0B21\u0B23-\u0B24\u0B27-\u0B30\u0B32-\u0B35\u0B38-\u0B39]") ; consonant with below form + ("A" . "[\u0B02\u0B03]") ; SIGN ANUSVARA .. VISARGA + ("V" . "[\u0B05-\u0B14\u0B60\u0B61]") ; independent vowel + ("C" . "[\u0B15-\u0B39\u0B5C\u0B5D\u0B5F\u0B71]") ; consonant + ("B" . "[\u0B15-\u0B17\u0B1B-\u0B1D\u0B1F-\u0B21\u0B23\u0B24\u0B27-\u0B30\u0B32-\u0B35\u0B38\u0B39]") ; consonant with below form ("R" . "\u0B30") ; RA ("n" . "\u0B3C") ; NUKTA - ("v" . "[\u0B3E-\u0B4C\u0B56-\u0B57\u0B62-\u0B63]") ; vowel sign + ("v" . "[\u0B3E-\u0B4C\u0B56\u0B57\u0B62\u0B63]") ; vowel sign ("H" . "\u0B4D") ; VIRAMA ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ @@ -298,9 +441,9 @@ South Indian language Malayalam is supported in this language environment.")) (defconst telugu-composable-pattern (let ((table '(("a" . "[\u0C01-\u0C03]") ; SIGN CANDRABINDU .. VISARGA - ("V" . "[\u0C05-\u0C14\u0C60-\u0C61]") ; independent vowel - ("C" . "[\u0C15-\u0C39\u0C58-\u0C59]") ; consonant - ("v" . "[\u0C3E-\u0C4C\u0C55-\u0C56\u0C62-\u0C63]") ; vowel sign + ("V" . "[\u0C05-\u0C14\u0C60\u0C61]") ; independent vowel + ("C" . "[\u0C15-\u0C39\u0C58\u0C59]") ; consonant + ("v" . "[\u0C3E-\u0C4C\u0C55\u0C56\u0C62\u0C63]") ; vowel sign ("H" . "\u0C4D") ; VIRAMA ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ @@ -320,12 +463,12 @@ South Indian language Malayalam is supported in this language environment.")) (defconst kannada-composable-pattern (let ((table - '(("A" . "[\u0C82-\u0C83]") ; SIGN ANUSVARA .. VISARGA - ("V" . "[\u0C85-\u0C94\u0CE0-\u0CE1]") ; independent vowel - ("C" . "[\u0C95-\u0CB9\u0CDE]") ; consonant + '(("A" . "[\u0C82\u0C83]") ; SIGN ANUSVARA .. VISARGA + ("V" . "[\u0C85-\u0C94\u0CE0\u0CE1]") ; independent vowel + ("C" . "[\u0C95-\u0CB9\u0CDE]") ; consonant ("R" . "\u0CB0") ; RA ("n" . "\u0CBC") ; NUKTA - ("v" . "[\u0CBE-\u0CCC\u0CD5-\u0CD6\u0CE2-\u0CE3]") ; vowel sign + ("v" . "[\u0CBE-\u0CCC\u0CD5\u0CD6\u0CE2\u0CE3]") ; vowel sign ("H" . "\u0CCD") ; VIRAMA ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ @@ -345,25 +488,25 @@ South Indian language Malayalam is supported in this language environment.")) (defconst malayalam-composable-pattern (let ((table - '(("A" . "[\u0D02-\u0D03]") ; SIGN ANUSVARA .. VISARGA - ("V" . "[\u0D05-\u0D14\u0D60-\u0D61]") ; independent vowel + '(("A" . "[\u0D02\u0D03]") ; SIGN ANUSVARA .. VISARGA + ("V" . "[\u0D05-\u0D14\u0D60\u0D61]") ; independent vowel ("C" . "[\u0D15-\u0D39]") ; consonant - ("Y" . "[\u0D2F-\u0D30\u0D32\u0D35]") ; YA, RA, LA, VA - ("v" . "[\u0D3E-\u0D4C\u0D57\u0D62-\u0D63]") ; postbase matra + ("Y" . "[\u0D2F\u0D30\u0D32\u0D35]") ; YA, RA, LA, VA + ("v" . "[\u0D3E-\u0D4C\u0D57\u0D62\u0D63]") ; postbase matra ("H" . "\u0D4D") ; SIGN VIRAMA ("N" . "\u200C") ; ZWNJ ("J" . "\u200D") ; ZWJ ("X" . "[\u0D00-\u0D7F]")))) ; all coverage (indian-compose-regexp (concat + ;; any sequence of 2 or more Malayalam characters, or + "XX+\\|" ;; consonant-based syllables, or "C\\(?:J?HJ?C\\)*\\(?:H[NJ]?\\|v?A?\\)\\|" ;; syllables with an independent vowel, or "V\\(?:J?HY\\)?v*?A?\\|" - ;; special consonant form, or - "JHY\\|" - ;; any other singleton characters - "X") + ;; special consonant form + "JHY") table)) "Regexp matching a composable sequence of Malayalam characters.") @@ -383,9 +526,266 @@ South Indian language Malayalam is supported in this language environment.")) (if slot (set-char-table-range composition-function-table key - (list (vector (cdr slot) 0 'font-shape-gstring)))))) + (list (vector (cdr slot) 0 #'font-shape-gstring)))))) char-script-table)) -(provide 'indian) +;; Brahmi composition rules +(let ((consonant "[\U00011013-\U00011034]") + (non-consonant "[^\U00011013-\U00011034\U00011046\U0001107F]") + (vowel "[\U00011038-\U00011045]") + (numeral "[\U00011052-\U00011065]") + (multiplier "[\U00011064\U00011065]") + (virama "\U00011046") + (number-joiner "\U0001107F")) + (set-char-table-range composition-function-table + '(#x11046 . #x11046) + (list (vector + ;; Consonant conjuncts + (concat consonant "\\(?:" virama consonant "\\)+" + vowel "?") + 1 'font-shape-gstring) + (vector + ;; Vowelless consonants + (concat consonant virama non-consonant) + 1 'font-shape-gstring))) + (set-char-table-range composition-function-table + '(#x1107F . #x1107F) + (list (vector + ;; Additive-multiplicative numerals + (concat multiplier number-joiner numeral) + 1 'font-shape-gstring)))) + +;; Kaithi composition rules +(let ((consonant "[\x1108D-\x110AF]") + (nukta "\x110BA") + (independent-vowel "[\x11083-\x1108C]") + (vowel "[\x1108D-\x110C2]") + (nasal "[\x11080\x11081]") + (virama "\x110B9") + (number-sign "\x110BD") + (number-sign-above "\x110CD") + (numerals "[\x966-\x96F]+") + (zwj "\x200D")) + (set-char-table-range composition-function-table + '(#x110B0 . #x110BA) + (list (vector + ;; Consonant based syllables + (concat consonant nukta "?\\(?:" virama zwj "?" consonant + nukta "?\\)*\\(?:" virama zwj "?\\|" vowel "*" nukta + "?" nasal "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowel based syllables + (concat independent-vowel nukta "?" virama "?" vowel "?") + 1 'font-shape-gstring))) + (set-char-table-range composition-function-table + '(#x110BD . #x110BD) + (list (vector + ;; Number sign + (concat number-sign numerals) + 0 'font-shape-gstring))) + (set-char-table-range composition-function-table + '(#x110CD . #x110CD) + (list (vector + ;; Number sign above + (concat number-sign-above numerals) + 0 'font-shape-gstring)))) + +;; Tirhuta composition rules +(let ((consonant "[\x1148F-\x114AF]") + (nukta "\x114C3") + (independent-vowel "[\x11481-\x1148E]") + (vowel "[\x114B0-\x114BE]") + (nasal "[\x114BF\x114C0]") + (virama "\x114C2")) + (set-char-table-range composition-function-table + '(#x114B0 . #x114C3) + (list (vector + ;; Consonant based syllables + (concat consonant nukta "?\\(?:" virama consonant nukta + "?\\)*\\(?:" virama "\\|" vowel "*" nukta "?" + nasal "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowel based syllables + (concat independent-vowel nukta "?" virama "?" vowel "?" nasal "?") + 1 'font-shape-gstring)))) + +;; Sharada composition rules +(let ((consonant "[\x11191-\x111B2]") + (nukta "\x111CA") + (independent-vowel "[\x11183-\x11190]") + (vowel "[\x111B3-\x111BF\x111CE]") + (vowel-modifier "\x111CB") + (extra-short-vowel-mark "\x111CC") + (nasal "[\x11181\x11180\x111CF]") + (virama "\x111C0") + (fricatives "[\x111C2\x111C3]") + (sandhi-mark "\x111C9") + (misc "[\x111C4-\x111C8\x111CD]")) + (set-char-table-range composition-function-table + '(#x111B3 . #x111CE) + (list (vector + ;; Consonant based syllables + (concat consonant nukta "?" vowel-modifier "?\\(?:" virama + consonant nukta "?" vowel-modifier "?\\)*\\(?:" virama + "\\|" vowel "*" nukta "?" nasal "?" extra-short-vowel-mark + "?" vowel-modifier "?" sandhi-mark "?+" misc "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowel based syllables + (concat independent-vowel nukta "?" vowel-modifier "?" virama "?" + vowel "?" extra-short-vowel-mark "?" sandhi-mark "?" + fricatives "?" misc "?") + 1 'font-shape-gstring) + (vector + ;; Fricatives with Consonants + (concat fricatives "?" consonant vowel "?") + 0 'font-shape-gstring)))) + +;; Siddham composition rules +(let ((consonant "[\x1158E-\x115AE]") + (nukta "\x115C0") + (independent-vowel "[\x11580-\x1158D\x115D8-\x115DB]") + (vowel "[\x115AF-\x115BB\x115DC\x115DD]") + (nasal "[\x115BC\x115BD]") + (visarga "\x115BE") + (virama "\x115BF")) + (set-char-table-range composition-function-table + '(#x115AF . #x115C0) + (list (vector + ;; Consonant based syllables + (concat consonant nukta "?" "\\(?:" virama consonant nukta + "?\\)*\\(?:" virama "\\|" vowel "*" nukta "?" nasal + "?" visarga "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel nukta "?" virama "?" vowel "?" + nasal "?" visarga "?") + 1 'font-shape-gstring)))) + +;; Syloti Nagri composition rules +(let ((consonant "[\xA807-\xA80A\xA80C-\xA822]") + (vowel "[\xA802\xA823-\xA827]") + (nasal "[\xA80B]") + (virama "\xA806") + (alternate-virama "\xA82C")) + (set-char-table-range composition-function-table + '(#xA806 . #xA806) + (list (vector + ;; Consonant conjunct based syllables + (concat consonant "\\(?:" virama consonant "\\)+" + vowel "?" nasal "?") + 1 'font-shape-gstring))) + (set-char-table-range composition-function-table + '(#xA823 . #xA827) + (list (vector + ;; Non Consonant conjunct based syllables + (concat consonant vowel nasal "?") + 1 'font-shape-gstring))) + (set-char-table-range composition-function-table + '(#xA82C . #xA82C) + (list (vector + ;; Consonant with the alternate virama + (concat consonant "\\(?:" alternate-virama consonant "\\)+" + vowel "?" nasal "?") + 1 'font-shape-gstring)))) + +;; Modi composition rules +(let ((consonant "[\x1160E-\x1162F]") + (independent-vowel "[\x11600-\x1160D]") + (vowel "[\x11630-\x1163C]") + (nasal "\x1163D") + (visarga "\x1163E") + (virama "\x1163F") + (ardhacandra "\x11640")) + (set-char-table-range composition-function-table + '(#x11630 . #x11640) + (list (vector + ;; Consonant based syllables + (concat consonant "\\(?:" virama consonant "\\)*\\(?:" + virama "\\|" vowel "*" ardhacandra "?" nasal + "?" visarga "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel virama "?" vowel "?" ardhacandra + nasal "?" visarga "?") + 1 'font-shape-gstring)))) + +;; Limbu composition rules +(let ((consonant "[\x1900-\x191E]") + (vowel "[\x1920-\x1928]") + (subjoined-letter "[\x1929-\x192B]") + (small-letter "[\x1930-\x1938]") + (other-signs "[\x1939\x193A]") + (sa-i "\x193B")) + (set-char-table-range composition-function-table + '(#x1920 . #x193B) + (list (vector + ;; Consonant based syllables + (concat consonant sa-i "?" subjoined-letter "?" small-letter + "?" vowel "?" other-signs "?") + 1 'font-shape-gstring)))) + +;; Grantha composition rules +(let ((consonant "[\x11315-\x11339]") + (nukta "\x1133C") + (independent-vowel "[\x11305-\x11314\x11360\x11361]") + (vowel "[\x1133E-\x1134C\x11357\x11362\x11363]") + (nasal "[\x11300-\x11302]") + (bindu "\x1133B") + (visarga "\x11303") + (virama "\x1134D") + (avagraha "\x1133D") + (modifier-above "[\x11366-\x11374]")) + (set-char-table-range composition-function-table + '(#x1133B . #x1134D) + (list (vector + ;; Consonant based syllables + (concat consonant nukta "?" "\\(?:" virama consonant nukta + "?\\)*\\(?:" virama "\\|" vowel "*" nukta "?" nasal + "?" bindu "?" visarga "?" modifier-above "?" + avagraha "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel nukta "?" virama "?" vowel "?" + nasal "?" bindu "?" visarga "?" modifier-above + "?" avagraha "?") + 1 'font-shape-gstring)))) + +;; Lepcha composition rules +(let ((consonant "[\x1C00-\x1C23\x1C4D-\x1C4F]") + (vowel "[\x1C26-\x1C2C]") + (subjoined-letter "[\x1C24\x1C25]") + (consonant-sign "[\x1C2D-\x1C35]") + (other-signs "[\x1C36\x1C37]")) + (set-char-table-range composition-function-table + '(#x1C24 . #x1C37) + (list (vector + ;; Consonant based syllables + (concat consonant other-signs "?" vowel "?" + consonant-sign "?" subjoined-letter "?" + other-signs "?") + 1 'font-shape-gstring)))) + +;; Meetei Mayek composition rules +(let ((akshara "[\xABC0-\xABE2\xAAE0-\xAAEA]") + (vowel "[\xABE3-\xABE9\xAAEB-\xAAEC]") + (nasal "\xABEA") + (visarga "\xAAF5") + (virama "[\xABED\xAAF6]") + (heavy-tone "\x11640")) + (set-char-table-range composition-function-table + '(#xABE3 . #xABED) + (list (vector + ;; Consonant based syllables + (concat akshara "\\(?:" virama akshara "\\)*\\(?:" + virama "\\|" vowel "*" nasal "?" visarga "?" + heavy-tone "?\\)") + 1 'font-shape-gstring)))) +(provide 'indian) ;;; indian.el ends here diff --git a/lisp/language/indonesian.el b/lisp/language/indonesian.el new file mode 100644 index 00000000000..699f8192543 --- /dev/null +++ b/lisp/language/indonesian.el @@ -0,0 +1,197 @@ +;;; indonesian.el --- Indonesian languages support -*- coding: utf-8; lexical-binding: t; -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: समीर सिंह Sameer Singh <lumarzeli30@gmail.com> +;; Keywords: multilingual, input method, i18n, Indonesia + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; This file contains definitions of Indonesia language environments, and +;; setups for displaying the scripts used there. + +;;; Code: + +(set-language-info-alist + "Balinese" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "balinese") + (sample-text . "Balinese (ᬅᬓ᭄ᬱᬭᬩᬮᬶ) ᬒᬁᬲ᭄ᬯᬲ᭄ᬢ᭄ᬬᬲ᭄ᬢᬸ") + (documentation . "\ +Balinese language and its script are supported in this language environment."))) + +(set-language-info-alist + "Javanese" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "javanese") + (sample-text . "Javanese (ꦲꦏ꧀ꦱꦫꦗꦮ) ꦲꦭꦺꦴ") + (documentation . "\ +Javanese language and its script are supported in this language environment."))) + +(set-language-info-alist + "Sundanese" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "sundanese") + (sample-text . "Sundanese (ᮃᮊ᮪ᮞᮛᮞᮥᮔ᮪ᮓ) ᮞᮙ᮪ᮕᮥᮛᮞᮥᮔ᮪") + (documentation . "\ +Sundanese language and its script are supported in this language environment."))) + +(set-language-info-alist + "Batak" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "batak") + (sample-text . "Batak (ᯘᯮᯒᯗ᯲ᯅᯗᯂ᯲) ᯂᯬᯒᯘ᯲ / ᯔᯧᯐᯬᯀᯱᯐᯬᯀᯱ") + (documentation . "\ +Languages that use the Batak script, such as Karo, Toba, Pakpak, Mandailing +and Simalungun, are supported in this language environment."))) + +(set-language-info-alist + "Rejang" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "rejang") + (sample-text . "Rejang (ꥆꤰ꥓ꤼꤽ ꤽꥍꤺꥏ) ꤸꥉꥐꤺꥉꥂꥎ") + (documentation . "\ +Rejang language and its script are supported in this language environment."))) + +(set-language-info-alist + "Makasar" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "makasar") + (sample-text . "Makasar (𑻪𑻢𑻪𑻢) 𑻦𑻤𑻵𑻱") + (documentation . "\ +Makassarese language and its script Makasar are supported in this language environment."))) + +(set-language-info-alist + "Buginese" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "lontara") + (sample-text . "Buginese (ᨒᨚᨈᨑ) ᨖᨒᨚ") + (documentation . "\ +Buginese language and its script Lontara are supported in this language environment."))) + +;; Balinese composition rules +(let ((consonant "[\x1B13-\x1B33\x1B45-\x1B4B]") + (independent-vowel "[\x1B05-\x1B12]") + (rerekan "\x1B34") + (vowel "[\x1B35-\x1B43]") + (modifier-above "[\x1B00-\x1B04]") + (adeg-adeg "\x1B44") + (musical-symbol "[\x1B6B-\x1B73]")) + (set-char-table-range composition-function-table + '(#x1B34 . #x1B44) + (list (vector + ;; Consonant based syllables + (concat consonant rerekan "?\\(?:" adeg-adeg consonant + rerekan "?\\)*\\(?:" adeg-adeg "\\|" vowel "*" rerekan + "?" modifier-above "?" musical-symbol "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel rerekan "?" adeg-adeg "?" + vowel "?" modifier-above "?" musical-symbol "?") + 1 'font-shape-gstring)))) + +;; Javanese composition rules +(let ((consonant "[\xA98F-\xA9B2]") + (independent-vowel "[\xA984-\xA98E]") + (telu "\xA9B3") + (vowel "[\xA9B4-\xA9BC]") + (dependant-consonant "[\xA9BD-\xA9BF]") + (modifier-above "[\xA980-\xA983]") + (pangkon "\xA9C0")) + (set-char-table-range composition-function-table + '(#xA9B3 . #xA9C0) + (list (vector + ;; Consonant based syllables + (concat consonant telu "?\\(?:" pangkon consonant + telu "?\\)*\\(?:" pangkon "\\|" vowel "*" telu + "?" modifier-above "?" dependant-consonant "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel telu "?" pangkon "?" + vowel "?" modifier-above "?" dependant-consonant "?") + 1 'font-shape-gstring)))) + +;; Sundanese composition rules +(let ((consonant "[\x1B8A-\x1BA0\x1BAE\x1BAF\x1BBB-\x1BBF]") + (independent-vowel "[\x1B83-\x1B89]") + (vowel "[\x1BA4-\x1BA9]") + (dependant-consonant "[\x1BA1-\x1BA3\x1BAC-\x1BAD]") + (modifier-above "[\x1B80-\x1B82]") + (virama "[\x1BAA\x1BAB]")) + (set-char-table-range composition-function-table + '(#x1BA1 . #x1BAD) + (list (vector + ;; Consonant based syllables + (concat consonant "\\(?:" virama consonant + "\\)*\\(?:" virama "\\|" vowel "*" + modifier-above "?" dependant-consonant "?\\)") + 1 'font-shape-gstring) + (vector + ;; Vowels based syllables + (concat independent-vowel virama "?" + vowel "?" modifier-above "?" dependant-consonant "?") + 1 'font-shape-gstring)))) + +;; Batak composition rules +(let ((akshara "[\x1BC0-\x1BE5]") + (vowel "[\x1BE7-\x1BEF]") + (dependant-consonant "[\x1BF0\x1BF1]") + (modifier-above "\x1BE6") + (virama "[\x1BF2\x1BF3]")) + (set-char-table-range composition-function-table + '(#x1BE6 . #x1BF3) + (list (vector + ;; Akshara based syllables + (concat akshara virama "?" vowel "*" modifier-above + "?" dependant-consonant "?") + 1 'font-shape-gstring)))) + +;; Rejang composition rules +(let ((akshara "[\xA930-\xA946]") + (vowel "[\xA947-\xA94E]") + (dependant-consonant "[\xA94F\xA952]") + (virama "\xA953")) + (set-char-table-range composition-function-table + '(#xA947 . #xA953) + (list (vector + ;; Akshara based syllables + (concat akshara virama "?" vowel "*" + dependant-consonant "?") + 1 'font-shape-gstring)))) + +;; Makasar composition rules +(let ((akshara "[\x11EE0-\x11EF2]") + (vowel "[\x11EF3-\x11EF6]")) + (set-char-table-range composition-function-table + '(#x11EF3 . #x11EF6) + (list (vector + ;; Akshara based syllables + (concat akshara vowel "*") + 1 'font-shape-gstring)))) + +(provide 'indonesian) +;;; indonesian.el ends here diff --git a/lisp/language/japan-util.el b/lisp/language/japan-util.el index 988b925409e..34248117559 100644 --- a/lisp/language/japan-util.el +++ b/lisp/language/japan-util.el @@ -1,6 +1,6 @@ -;;; japan-util.el --- utilities for Japanese -*- coding: iso-2022-7bit; -*- +;;; japan-util.el --- utilities for Japanese -*- lexical-binding: t; -*- -;; Copyright (C) 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -29,36 +29,34 @@ ;;;###autoload (defun setup-japanese-environment-internal () - ;; By default, we use 'japanese-iso-8bit for file names. But, the - ;; following prefer-coding-system will override it. - (if (memq system-type '(windows-nt ms-dos cygwin)) - (prefer-coding-system 'japanese-shift-jis) - (prefer-coding-system 'japanese-iso-8bit)) + (prefer-coding-system (if (memq system-type '(windows-nt ms-dos cygwin)) + 'japanese-shift-jis + 'utf-8)) (use-cjk-char-width-table 'ja_JP)) (defconst japanese-kana-table - '((?$B$"(B ?$B%"(B ?(I1(B) (?$B$$(B ?$B%$(B ?(I2(B) (?$B$&(B ?$B%&(B ?(I3(B) (?$B$((B ?$B%((B ?(I4(B) (?$B$*(B ?$B%*(B ?(I5(B) - (?$B$+(B ?$B%+(B ?(I6(B) (?$B$-(B ?$B%-(B ?(I7(B) (?$B$/(B ?$B%/(B ?(I8(B) (?$B$1(B ?$B%1(B ?(I9(B) (?$B$3(B ?$B%3(B ?(I:(B) - (?$B$5(B ?$B%5(B ?(I;(B) (?$B$7(B ?$B%7(B ?(I<(B) (?$B$9(B ?$B%9(B ?(I=(B) (?$B$;(B ?$B%;(B ?(I>(B) (?$B$=(B ?$B%=(B ?(I?(B) - (?$B$?(B ?$B%?(B ?(I@(B) (?$B$A(B ?$B%A(B ?(IA(B) (?$B$D(B ?$B%D(B ?(IB(B) (?$B$F(B ?$B%F(B ?(IC(B) (?$B$H(B ?$B%H(B ?(ID(B) - (?$B$J(B ?$B%J(B ?(IE(B) (?$B$K(B ?$B%K(B ?(IF(B) (?$B$L(B ?$B%L(B ?(IG(B) (?$B$M(B ?$B%M(B ?(IH(B) (?$B$N(B ?$B%N(B ?(II(B) - (?$B$O(B ?$B%O(B ?(IJ(B) (?$B$R(B ?$B%R(B ?(IK(B) (?$B$U(B ?$B%U(B ?(IL(B) (?$B$X(B ?$B%X(B ?(IM(B) (?$B$[(B ?$B%[(B ?(IN(B) - (?$B$^(B ?$B%^(B ?(IO(B) (?$B$_(B ?$B%_(B ?(IP(B) (?$B$`(B ?$B%`(B ?(IQ(B) (?$B$a(B ?$B%a(B ?(IR(B) (?$B$b(B ?$B%b(B ?(IS(B) - (?$B$d(B ?$B%d(B ?(IT(B) (?$B$f(B ?$B%f(B ?(IU(B) (?$B$h(B ?$B%h(B ?(IV(B) - (?$B$i(B ?$B%i(B ?(IW(B) (?$B$j(B ?$B%j(B ?(IX(B) (?$B$k(B ?$B%k(B ?(IY(B) (?$B$l(B ?$B%l(B ?(IZ(B) (?$B$m(B ?$B%m(B ?(I[(B) - (?$B$o(B ?$B%o(B ?(I\(B) (?$B$p(B ?$B%p(B "(I2(B") (?$B$q(B ?$B%q(B "(I4(B") (?$B$r(B ?$B%r(B ?(I&(B) - (?$B$s(B ?$B%s(B ?(I](B) - (?$B$,(B ?$B%,(B "(I6^(B") (?$B$.(B ?$B%.(B "(I7^(B") (?$B$0(B ?$B%0(B "(I8^(B") (?$B$2(B ?$B%2(B "(I9^(B") (?$B$4(B ?$B%4(B "(I:^(B") - (?$B$6(B ?$B%6(B "(I;^(B") (?$B$8(B ?$B%8(B "(I<^(B") (?$B$:(B ?$B%:(B "(I=^(B") (?$B$<(B ?$B%<(B "(I>^(B") (?$B$>(B ?$B%>(B "(I?^(B") - (?$B$@(B ?$B%@(B "(I@^(B") (?$B$B(B ?$B%B(B "(IA^(B") (?$B$E(B ?$B%E(B "(IB^(B") (?$B$G(B ?$B%G(B "(IC^(B") (?$B$I(B ?$B%I(B "(ID^(B") - (?$B$P(B ?$B%P(B "(IJ^(B") (?$B$S(B ?$B%S(B "(IK^(B") (?$B$V(B ?$B%V(B "(IL^(B") (?$B$Y(B ?$B%Y(B "(IM^(B") (?$B$\(B ?$B%\(B "(IN^(B") - (?$B$Q(B ?$B%Q(B "(IJ_(B") (?$B$T(B ?$B%T(B "(IK_(B") (?$B$W(B ?$B%W(B "(IL_(B") (?$B$Z(B ?$B%Z(B "(IM_(B") (?$B$](B ?$B%](B "(IN_(B") - (?$B$!(B ?$B%!(B ?(I'(B) (?$B$#(B ?$B%#(B ?(I((B) (?$B$%(B ?$B%%(B ?(I)(B) (?$B$'(B ?$B%'(B ?(I*(B) (?$B$)(B ?$B%)(B ?(I+(B) - (?$B$C(B ?$B%C(B ?(I/(B) - (?$B$c(B ?$B%c(B ?(I,(B) (?$B$e(B ?$B%e(B ?(I-(B) (?$B$g(B ?$B%g(B ?(I.(B) - (?$B$n(B ?$B%n(B "(I\(B") - (?$B!5(B ?$B!3(B) (?$B!6(B ?$B!4(B) - ("$B$&!+(B" ?$B%t(B "(I3^(B") (nil ?$B%u(B "(I6(B") (nil ?$B%v(B "(I9(B")) + '((?あ ?ア ?ア) (?い ?イ ?イ) (?う ?ウ ?ウ) (?え ?エ ?エ) (?お ?オ ?オ) + (?か ?カ ?カ) (?き ?キ ?キ) (?く ?ク ?ク) (?け ?ケ ?ケ) (?こ ?コ ?コ) + (?さ ?サ ?サ) (?し ?シ ?シ) (?す ?ス ?ス) (?せ ?セ ?セ) (?そ ?ソ ?ソ) + (?た ?タ ?タ) (?ち ?チ ?チ) (?つ ?ツ ?ツ) (?て ?テ ?テ) (?と ?ト ?ト) + (?な ?ナ ?ナ) (?に ?ニ ?ニ) (?ぬ ?ヌ ?ヌ) (?ね ?ネ ?ネ) (?の ?ノ ?ノ) + (?は ?ハ ?ハ) (?ひ ?ヒ ?ヒ) (?ふ ?フ ?フ) (?へ ?ヘ ?ヘ) (?ほ ?ホ ?ホ) + (?ま ?マ ?マ) (?み ?ミ ?ミ) (?む ?ム ?ム) (?め ?メ ?メ) (?も ?モ ?モ) + (?や ?ヤ ?ヤ) (?ゆ ?ユ ?ユ) (?よ ?ヨ ?ヨ) + (?ら ?ラ ?ラ) (?り ?リ ?リ) (?る ?ル ?ル) (?れ ?レ ?レ) (?ろ ?ロ ?ロ) + (?わ ?ワ ?ワ) (?ゐ ?ヰ "イ") (?ゑ ?ヱ "エ") (?を ?ヲ ?ヲ) + (?ん ?ン ?ン) + (?が ?ガ "ガ") (?ぎ ?ギ "ギ") (?ぐ ?グ "グ") (?げ ?ゲ "ゲ") (?ご ?ゴ "ゴ") + (?ざ ?ザ "ザ") (?じ ?ジ "ジ") (?ず ?ズ "ズ") (?ぜ ?ゼ "ゼ") (?ぞ ?ゾ "ゾ") + (?だ ?ダ "ダ") (?ぢ ?ヂ "ヂ") (?づ ?ヅ "ヅ") (?で ?デ "デ") (?ど ?ド "ド") + (?ば ?バ "バ") (?び ?ビ "ビ") (?ぶ ?ブ "ブ") (?べ ?ベ "ベ") (?ぼ ?ボ "ボ") + (?ぱ ?パ "パ") (?ぴ ?ピ "ピ") (?ぷ ?プ "プ") (?ぺ ?ペ "ペ") (?ぽ ?ポ "ポ") + (?ぁ ?ァ ?ァ) (?ぃ ?ィ ?ィ) (?ぅ ?ゥ ?ゥ) (?ぇ ?ェ ?ェ) (?ぉ ?ォ ?ォ) + (?っ ?ッ ?ッ) + (?ゃ ?ャ ?ャ) (?ゅ ?ュ ?ュ) (?ょ ?ョ ?ョ) + (?ゎ ?ヮ "ワ") + (?ゝ ?ヽ) (?ゞ ?ヾ) + ("う゛" ?ヴ "ヴ") (nil ?ヵ "カ") (nil ?ヶ "ケ")) "Japanese JISX0208 Kana character table. Each element is of the form (HIRAGANA KATAKANA HANKAKU-KATAKANA), where HIRAGANA and KATAKANA belong to `japanese-jisx0208', @@ -98,19 +96,19 @@ HANKAKU-KATAKANA belongs to `japanese-jisx0201-kana'.") (put-char-code-property jisx0201 'jisx0208 katakana))))) (defconst japanese-symbol-table - '((?\$B!!(B ?\ ) (?$B!$(B ?, ?(I$(B) (?$B!%(B ?. ?(I!(B) (?$B!"(B ?, ?(I$(B) (?$B!#(B ?. ?(I!(B) (?$B!&(B nil ?(I%(B) - (?$B!'(B ?:) (?$B!((B ?\;) (?$B!)(B ??) (?$B!*(B ?!) (?$B!+(B nil ?(I^(B) (?$B!,(B nil ?(I_(B) - (?$B!-(B ?') (?$B!.(B ?`) (?$B!0(B ?^) (?$B!2(B ?_) (?$B!<(B ?- ?(I0(B) (?$B!=(B ?-) (?$B!>(B ?-) - (?$B!?(B ?/) (?$B!@(B ?\\) (?$B!A(B ?~) (?$B!C(B ?|) (?$B!F(B ?`) (?$B!G(B ?') (?$B!H(B ?\") (?$B!I(B ?\") - (?\$B!J(B ?\() (?\$B!K(B ?\)) (?\$B!N(B ?\[) (?\$B!O(B ?\]) (?\$B!P(B ?{) (?\$B!Q(B ?}) - (?$B!R(B ?<) (?$B!S(B ?>) (?\$B!V(B nil ?\(I"(B) (?\$B!W(B nil ?\(I#(B) - (?$B!\(B ?+) (?$B!](B ?-) (?$B!a(B ?=) (?$B!c(B ?<) (?$B!d(B ?>) - (?$B!l(B ?') (?$B!m(B ?\") (?$B!o(B ?\\) (?$B!p(B ?$) (?$B!s(B ?%) (?$B!t(B ?#) (?$B!u(B ?&) (?$B!v(B ?*) - (?$B!w(B ?@) + '((?\ ?\ ) (?, ?,) (?. ?.) (?、 nil ?、) (?。 nil ?。) (?・ nil ?・) + (?: ?:) (?; ?\;) (?? ??) (?! ?!) (?゛ nil ?゙) (?゜ nil ?゚) + (?´ ?') (?` ?`) (?^ ?^) (?_ ?_) (?ー nil ?ー) (?— ?-) (?‐ ?-) + (?/ ?/) (?\ ?\\) (?〜 ?~) (?| ?|) (?‘ ?`) (?’ ?') (?“ ?\") (?” ?\") + (?\( ?\() (?\) ?\)) (?\[ ?\[) (?\] ?\]) (?\{ ?{) (?\} ?}) + (?〈 ?<) (?〉 ?>) (?\「 nil ?\「) (?\」 nil ?\」) + (?+ ?+) (?− ?-) (?= ?=) (?< ?<) (?> ?>) + (?′ ?') (?″ ?\") (?¥ ?\\) (?$ ?$) (?% ?%) (?# ?#) (?& ?&) (?* ?*) + (?@ ?@) ;; cp932-2-byte (#x2015 ?-) (#xFF5E ?~) (#xFF0D ?-)) "Japanese JISX0208 and CP932 symbol character table. - Each element is of the form (SYMBOL ASCII HANKAKU), where SYMBOL +Each element is of the form (SYMBOL ASCII HANKAKU), where SYMBOL belongs to `japanese-jisx0208' or `cp932', ASCII belongs to `ascii', and HANKAKU belongs to `japanese-jisx0201-kana'.") @@ -134,20 +132,20 @@ and HANKAKU belongs to `japanese-jisx0201-kana'.") (put-char-code-property jisx0201 'jisx0208 jisx0208)))))) (defconst japanese-alpha-numeric-table - '((?$B#0(B . ?0) (?$B#1(B . ?1) (?$B#2(B . ?2) (?$B#3(B . ?3) (?$B#4(B . ?4) - (?$B#5(B . ?5) (?$B#6(B . ?6) (?$B#7(B . ?7) (?$B#8(B . ?8) (?$B#9(B . ?9) - (?$B#A(B . ?A) (?$B#B(B . ?B) (?$B#C(B . ?C) (?$B#D(B . ?D) (?$B#E(B . ?E) - (?$B#F(B . ?F) (?$B#G(B . ?G) (?$B#H(B . ?H) (?$B#I(B . ?I) (?$B#J(B . ?J) - (?$B#K(B . ?K) (?$B#L(B . ?L) (?$B#M(B . ?M) (?$B#N(B . ?N) (?$B#O(B . ?O) - (?$B#P(B . ?P) (?$B#Q(B . ?Q) (?$B#R(B . ?R) (?$B#S(B . ?S) (?$B#T(B . ?T) - (?$B#U(B . ?U) (?$B#V(B . ?V) (?$B#W(B . ?W) (?$B#X(B . ?X) (?$B#Y(B . ?Y) (?$B#Z(B . ?Z) - (?$B#a(B . ?a) (?$B#b(B . ?b) (?$B#c(B . ?c) (?$B#d(B . ?d) (?$B#e(B . ?e) - (?$B#f(B . ?f) (?$B#g(B . ?g) (?$B#h(B . ?h) (?$B#i(B . ?i) (?$B#j(B . ?j) - (?$B#k(B . ?k) (?$B#l(B . ?l) (?$B#m(B . ?m) (?$B#n(B . ?n) (?$B#o(B . ?o) - (?$B#p(B . ?p) (?$B#q(B . ?q) (?$B#r(B . ?r) (?$B#s(B . ?s) (?$B#t(B . ?t) - (?$B#u(B . ?u) (?$B#v(B . ?v) (?$B#w(B . ?w) (?$B#x(B . ?x) (?$B#y(B . ?y) (?$B#z(B . ?z)) + '((?0 . ?0) (?1 . ?1) (?2 . ?2) (?3 . ?3) (?4 . ?4) + (?5 . ?5) (?6 . ?6) (?7 . ?7) (?8 . ?8) (?9 . ?9) + (?A . ?A) (?B . ?B) (?C . ?C) (?D . ?D) (?E . ?E) + (?F . ?F) (?G . ?G) (?H . ?H) (?I . ?I) (?J . ?J) + (?K . ?K) (?L . ?L) (?M . ?M) (?N . ?N) (?O . ?O) + (?P . ?P) (?Q . ?Q) (?R . ?R) (?S . ?S) (?T . ?T) + (?U . ?U) (?V . ?V) (?W . ?W) (?X . ?X) (?Y . ?Y) (?Z . ?Z) + (?a . ?a) (?b . ?b) (?c . ?c) (?d . ?d) (?e . ?e) + (?f . ?f) (?g . ?g) (?h . ?h) (?i . ?i) (?j . ?j) + (?k . ?k) (?l . ?l) (?m . ?m) (?n . ?n) (?o . ?o) + (?p . ?p) (?q . ?q) (?r . ?r) (?s . ?s) (?t . ?t) + (?u . ?u) (?v . ?v) (?w . ?w) (?x . ?x) (?y . ?y) (?z . ?z)) "Japanese JISX0208 alpha numeric character table. -Each element is of the form (ALPHA-NUMERIC . ASCII), where ALPHA-NUMERIC +Each element is of the form (ALPHANUMERIC . ASCII), where ALPHANUMERIC belongs to `japanese-jisx0208', ASCII belongs to `ascii'.") ;; Put properties 'jisx0208 and 'ascii to each Japanese alpha numeric @@ -238,7 +236,7 @@ of which charset is `japanese-jisx0201-kana'." (composition (and (not hankaku) (get-char-code-property kana 'kana-composition))) - next slot) + slot) ;; next (if (and composition (setq slot (assq (following-char) composition))) (japanese-replace-region (match-beginning 0) (1+ (point)) (cdr slot)) @@ -260,7 +258,7 @@ of which charset is `japanese-jisx0201-kana'." (while (re-search-forward "\\cK\\|\\ck" nil t) (let* ((kata (preceding-char)) (composition (get-char-code-property kata 'kana-composition)) - next slot) + slot) ;; next (if (and composition (setq slot (assq (following-char) composition))) (japanese-replace-region (match-beginning 0) (1+ (point)) (get-char-code-property @@ -307,7 +305,7 @@ Optional argument KATAKANA-ONLY non-nil means to convert only KATAKANA char." (re-search-forward "\\ca\\|\\ck" nil t))) (let* ((hankaku (preceding-char)) (composition (get-char-code-property hankaku 'kana-composition)) - next slot) + slot) ;; next (if (and composition (setq slot (assq (following-char) composition))) (japanese-replace-region (match-beginning 0) (1+ (point)) (cdr slot)) diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index 57147f62e33..666ebad62f5 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el @@ -1,6 +1,6 @@ -;;; japanese.el --- support for Japanese -*- coding: iso-2022-7bit -*- +;;; japanese.el --- support for Japanese -*- lexical-binding: t; -*- -;; Copyright (C) 1997, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -82,9 +82,7 @@ (#x00A6 . #xFFE4) ; BROKEN LINE FULLWIDTH BROKEN LINE ))) (define-translation-table 'japanese-ucs-jis-to-cp932-map map) - (mapc #'(lambda (x) (let ((tmp (car x))) - (setcar x (cdr x)) (setcdr x tmp))) - map) + (setq map (mapcar (lambda (x) (cons (cdr x) (car x))) map)) (define-translation-table 'japanese-ucs-cp932-to-jis-map map)) ;; U+2014 (EM DASH) vs U+2015 (HORIZONTAL BAR) @@ -190,6 +188,22 @@ eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>." (define-coding-system-alias 'shift_jis-2004 'japanese-shift-jis-2004) +(define-coding-system 'ibm281 + "Japanese-E version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm281) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-jp-e 'ibm281) +(define-coding-system-alias 'cp281 'ibm281) + +(define-coding-system 'ibm290 + "Japanese katakana version of EBCDIC" + :coding-type 'charset + :charset-list '(ibm290) + :mnemonic ?*) +(define-coding-system-alias 'ebcdic-jp-kana 'ibm290) +(define-coding-system-alias 'cp290 'ibm290) + (set-language-info-alist "Japanese" '((setup-function . setup-japanese-environment-internal) (exit-function . use-default-char-width-table) @@ -210,7 +224,7 @@ eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>." iso-2022-jp-2) (input-method . "japanese") (features japan-util) - (sample-text . "Japanese ($BF|K\8l(B) $B$3$s$K$A$O(B, (I:]FAJ(B") + (sample-text . "Japanese (日本語) こんにちは, コンニチハ") (documentation . t))) (let ((map @@ -241,36 +255,15 @@ eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>." (#x2b65 . [#x02E9 #x02E5]) (#x2b66 . [#x02E5 #x02E9]))) table) - (dolist (elt map) - (setcar elt (decode-char 'japanese-jisx0213-1 (car elt)))) + (setq map + (mapcar (lambda (x) (cons (decode-char 'japanese-jisx0213-1 (car x)) + (cdr x))) + map)) (setq table (make-translation-table-from-alist map)) (define-translation-table 'jisx0213-to-unicode table) (define-translation-table 'unicode-to-jisx0213 (char-table-extra-slot table 0))) -(defun compose-gstring-for-variation-glyph (gstring) - "Compose glyph-string GSTRING for graphic display. -GSTRING must have two glyphs; the first is a glyph for a han character, -and the second is a glyph for a variation selector." - (let* ((font (lgstring-font gstring)) - (han (lgstring-char gstring 0)) - (vs (lgstring-char gstring 1)) - (glyphs (font-variation-glyphs font han)) - (g0 (lgstring-glyph gstring 0)) - (g1 (lgstring-glyph gstring 1))) - (catch 'tag - (dolist (elt glyphs) - (if (= (car elt) vs) - (progn - (lglyph-set-code g0 (cdr elt)) - (lglyph-set-from-to g0 (lglyph-from g0) (lglyph-to g1)) - (lgstring-set-glyph gstring 1 nil) - (throw 'tag gstring))))))) - -(let ((elt '([".." 1 compose-gstring-for-variation-glyph]))) - (set-char-table-range composition-function-table '(#xFE00 . #xFE0F) elt) - (set-char-table-range composition-function-table '(#xE0100 . #xE01EF) elt)) - (provide 'japanese) ;;; japanese.el ends here diff --git a/lisp/language/khmer.el b/lisp/language/khmer.el index 4a070321961..12737edc73f 100644 --- a/lisp/language/khmer.el +++ b/lisp/language/khmer.el @@ -1,4 +1,4 @@ -;;; khmer.el --- support for Khmer -*- coding: utf-8 -*- +;;; khmer.el --- support for Khmer -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. +;;; Commentary: + ;;; Code: (set-language-info-alist @@ -31,8 +33,8 @@ (documentation . t))) (let ((val (list (vector "[\x1780-\x17FF\x19E0-\x19FF\x200C\x200D]+" - 0 'font-shape-gstring)))) + 0 #'font-shape-gstring)))) (set-char-table-range composition-function-table '(#x1780 . #x17FF) val) (set-char-table-range composition-function-table '(#x19E0 . #x19FF) val)) -;; khmer.el ends here +;;; khmer.el ends here diff --git a/lisp/language/korea-util.el b/lisp/language/korea-util.el index c49e627ea9b..9a6ab1b2495 100644 --- a/lisp/language/korea-util.el +++ b/lisp/language/korea-util.el @@ -1,6 +1,6 @@ -;;; korea-util.el --- utilities for Korean +;;; korea-util.el --- utilities for Korean -*- lexical-binding: t; -*- -;; Copyright (C) 1997, 1999, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1999, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, ;; 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -29,24 +29,28 @@ ;;;###autoload (defvar default-korean-keyboard - (purecopy (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) + (purecopy (if (string-search "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) "3" "")) - "The kind of Korean keyboard for Korean input method. -\"\" for 2, \"3\" for 3.") + "The kind of Korean keyboard for Korean (Hangul) input method. +\"\" for 2, \"3\" for 3, and \"3f\" for 3f.") ;; functions useful for Korean text input (defun toggle-korean-input-method () - "Turn on or off a Korean text input method for the current buffer." + "Turn on or off a Korean text input method for the current buffer. +The keyboard layout variation used is determined by +`default-korean-keyboard'." (interactive) (if current-input-method (deactivate-input-method) (activate-input-method (concat "korean-hangul" default-korean-keyboard)))) -(defun quail-hangul-switch-symbol-ksc (&rest ignore) - "Swith to/from Korean symbol package." +(defun quail-hangul-switch-symbol-ksc (&rest _ignore) + "Switch to/from Korean symbol package. +The keyboard layout variation used is determined by +`default-korean-keyboard'." (interactive "i") (and current-input-method (if (string-equal current-input-method "korean-symbol") @@ -54,8 +58,10 @@ default-korean-keyboard)) (activate-input-method "korean-symbol")))) -(defun quail-hangul-switch-hanja (&rest ignore) - "Swith to/from Korean hanja package." +(defun quail-hangul-switch-hanja (&rest _ignore) + "Switch to/from Korean hanja package. +The keyboard layout variation used is determined by +`default-korean-keyboard'." (interactive "i") (and current-input-method (if (string-match "korean-hanja" current-input-method) @@ -70,27 +76,24 @@ (interactive) (let ((overriding-terminal-local-map nil)) (toggle-korean-input-method)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) (defun isearch-hangul-switch-symbol-ksc () (interactive) (let ((overriding-terminal-local-map nil)) (quail-hangul-switch-symbol-ksc)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) (defun isearch-hangul-switch-hanja () (interactive) (let ((overriding-terminal-local-map nil)) (quail-hangul-switch-hanja)) - (setq isearch-input-method-function input-method-function - isearch-input-method-local-p t) - (setq input-method-function nil) + (setq isearch-input-method-function input-method-function) + (setq-local input-method-function nil) (isearch-update)) ;; Information for setting and exiting Korean environment. diff --git a/lisp/language/korean.el b/lisp/language/korean.el index 52560d6fb4d..bc68d56b24e 100644 --- a/lisp/language/korean.el +++ b/lisp/language/korean.el @@ -1,6 +1,6 @@ -;;; korean.el --- support for Korean -*- coding: utf-8 -*- +;;; korean.el --- support for Korean -*- coding: utf-8; lexical-binding: t; -*- -;; Copyright (C) 1998, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -42,6 +42,7 @@ (define-coding-system-alias 'euc-kr 'korean-iso-8bit) (define-coding-system-alias 'euc-korea 'korean-iso-8bit) +(define-coding-system-alias 'ks_c_5601-1987 'korean-iso-8bit) (define-coding-system 'iso-2022-kr "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)." @@ -84,6 +85,18 @@ and the following key bindings are available within Korean input methods: F9, Hangul_Hanja: hangul-to-hanja-conversion") )) +;; For auto-composing conjoining jamo. +(let* ((choseong "[\u1100-\u115F\uA960-\uA97C]") + (jungseong "[\u1160-\u11A7\uD7B0-\uD7C6]") + (jongseong "[\u11A8-\u11FF\uD7CB-\uD7FB]?") + (pattern (concat choseong jungseong jongseong))) + (set-char-table-range composition-function-table + '(#x1100 . #x115F) + (list (vector pattern 0 #'font-shape-gstring))) + (set-char-table-range composition-function-table + '(#xA960 . #xA97C) + (list (vector pattern 0 #'font-shape-gstring)))) + (provide 'korean) ;;; korean.el ends here diff --git a/lisp/language/lao-util.el b/lisp/language/lao-util.el index 94504ff9ba6..51a947cc72d 100644 --- a/lisp/language/lao-util.el +++ b/lisp/language/lao-util.el @@ -1,6 +1,6 @@ -;;; lao-util.el --- utilities for Lao -*- coding: utf-8; -*- +;;; lao-util.el --- utilities for Lao -*- lexical-binding: t; -*- -;; Copyright (C) 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, ;; 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -183,7 +183,9 @@ ;; Semi-vowel-sign-lo and lower vowels are put under the letter. (defconst lao-transcription-consonant-alist - (sort '(;; single consonants + (sort + (copy-sequence + '(;; single consonants ("k" . "ກ") ("kh" . "ຂ") ("qh" . "ຄ") @@ -223,14 +225,16 @@ ("hy" . ["ຫຍ"]) ("hn" . ["ຫນ"]) ("hm" . ["ຫມ"]) - ) - (function (lambda (x y) (> (length (car x)) (length (car y))))))) + )) + (lambda (x y) (> (length (car x)) (length (car y)))))) (defconst lao-transcription-semi-vowel-alist '(("r" . "ຼ"))) (defconst lao-transcription-vowel-alist - (sort '(("a" . "ະ") + (sort + (copy-sequence + '(("a" . "ະ") ("ar" . "າ") ("i" . "ິ") ("ii" . "ີ") @@ -257,8 +261,8 @@ ("ai" . "ໄ") ("ei" . "ໃ") ("ao" . ["ເົາ"]) - ("aM" . "ຳ")) - (function (lambda (x y) (> (length (car x)) (length (car y))))))) + ("aM" . "ຳ"))) + (lambda (x y) (> (length (car x)) (length (car y)))))) ;; Maa-sakod is put at the tail. (defconst lao-transcription-maa-sakod-alist @@ -489,15 +493,15 @@ syllable. In that case, FROM and TO are indexes to STR." lao-str))) ;;;###autoload -(defun lao-composition-function (gstring) +(defun lao-composition-function (gstring direction) (if (= (lgstring-char-len gstring) 1) - (compose-gstring-for-graphic gstring) - (or (font-shape-gstring gstring) + (compose-gstring-for-graphic gstring direction) + (or (font-shape-gstring gstring direction) (let ((glyph-len (lgstring-glyph-len gstring)) - (i 0) - glyph) + (i 0)) ;; glyph (while (and (< i glyph-len) - (setq glyph (lgstring-glyph gstring i))) + ;; (setq glyph + (lgstring-glyph gstring i)) ;;) (setq i (1+ i))) (compose-glyph-string-relative gstring 0 i 0.1))))) diff --git a/lisp/language/lao.el b/lisp/language/lao.el index 266c3c634f7..0ad5b9f84e3 100644 --- a/lisp/language/lao.el +++ b/lisp/language/lao.el @@ -1,6 +1,6 @@ -;;; lao.el --- support for Lao -*- coding: utf-8 -*- +;;; lao.el --- support for Lao -*- coding: utf-8; lexical-binding: t; -*- -;; Copyright (C) 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, ;; 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -59,14 +59,14 @@ (let* ((chars (car l)) (len (length chars)) ;; Replace `c', `t', `v' to consonant, tone, and vowel. - (regexp (mapconcat #'(lambda (c) - (cond ((= c ?c) consonant) - ((= c ?t) tone) - ((= c ?v) vowel-upper-lower) - (t (string c)))) + (regexp (mapconcat (lambda (c) + (cond ((eq c ?c) consonant) + ((eq c ?t) tone) + ((eq c ?v) vowel-upper-lower) + (t (string c)))) (cdr l) "")) ;; Element of composition-function-table. - (elt (list (vector regexp 1 'lao-composition-function) + (elt (list (vector regexp 1 #'lao-composition-function) fallback-rule)) ch) (dotimes (i len) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index 2843c7c9038..3d5b68f84be 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -1,5 +1,6 @@ -;;; misc-lang.el --- support for miscellaneous languages (characters) +;;; misc-lang.el --- support for miscellaneous languages (characters) -*- lexical-binding: t; -*- +;; Copyright (C) 2012-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -75,12 +76,198 @@ and Italian."))) (sample-text . "Persian فارسی") (documentation . "Bidirectional editing is supported."))) +(defcustom arabic-shaper-ZWNJ-handling nil + "How to handle ZWMJ in Arabic text rendering. +This variable controls the way to handle a glyph for ZWNJ +returned by the underling shaping engine. + +The default value is nil, which means that the ZWNJ glyph is +displayed as is. + +If the value is `absorb', ZWNJ is absorbed into the previous +grapheme cluster, and not displayed. + +If the value is `as-space', the glyph is displayed by a +thin (i.e. 1-dot width) space." + :group 'mule + :version "26.1" + :type '(choice + (const :tag "default" nil) + (const :tag "as space" as-space) + (const :tag "absorb" absorb)) + :set (lambda (sym val) + (set-default sym val) + (clear-composition-cache))) + +;; Record error in arabic-change-gstring. +(defvar arabic-shape-log nil) + +(defun arabic-shape-gstring (gstring direction) + (setq gstring (font-shape-gstring gstring direction)) + (condition-case err + (when arabic-shaper-ZWNJ-handling + (let ((font (lgstring-font gstring)) + (i 1) + (len (lgstring-glyph-len gstring)) + (modified nil)) + (while (< i len) + (let ((glyph (lgstring-glyph gstring i))) + (when (eq (lglyph-char glyph) #x200c) + (cond + ((eq arabic-shaper-ZWNJ-handling 'as-space) + (if (> (- (lglyph-rbearing glyph) (lglyph-lbearing glyph)) 0) + (let ((space-glyph (aref (font-get-glyphs font 0 1 " ") 0))) + (when space-glyph + (lglyph-set-code glyph (aref space-glyph 3)) + (lglyph-set-width glyph (aref space-glyph 4))))) + (lglyph-set-adjustment glyph 0 0 1) + (setq modified t)) + ((eq arabic-shaper-ZWNJ-handling 'absorb) + (let ((prev (lgstring-glyph gstring (1- i)))) + (lglyph-set-from-to prev (lglyph-from prev) (lglyph-to glyph)) + (setq gstring (lgstring-remove-glyph gstring i)) + (setq len (1- len))) + (setq modified t))))) + (setq i (1+ i))) + (if modified + (lgstring-set-id gstring nil)))) + (error (push err arabic-shape-log))) + gstring) + (set-char-table-range composition-function-table '(#x600 . #x74F) - (list (vector "[\u0600-\u074F\u200C\u200D]+" 0 'font-shape-gstring) - (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" - 1 'font-shape-gstring))) + (list (vector "[\u0600-\u074F\u200C\u200D]+" + 0 #'arabic-shape-gstring))) +(set-char-table-range + composition-function-table + '(#x200C . #x200D) + (list (vector "[\u200C\u200D][\u0600-\u074F\u200C\u200D]+" + 0 #'arabic-shape-gstring))) + +;; The Egyptian Hieroglyph Format Controls were introduced in Unicode +;; Standard v12.0. Apparently, they are not yet well supported in +;; existing fonts, as of late 2020. But there's no reason for us not +;; to be ready for when they will be! +;; The below is needed to support the arrangement of the Egyptian +;; Hieroglyphs in "quadrats", as directed by the format controls, +;; which specify how the hieroglyphs should be joined horizontally and +;; vertically. +(defun egyptian-shape-grouping (gstring direction) + (if (= (lgstring-char gstring 0) #x13437) + (let ((nchars (lgstring-char-len gstring)) + (i 1) + (nesting 1) + ch) + ;; Find where this group ends. + (while (and (< i nchars) (> nesting 0)) + (setq ch (lgstring-char gstring i)) + (cond + ((= ch #x13437) + (setq nesting (1+ nesting))) + ((= ch #x13438) + (setq nesting (1- nesting)))) + (setq i (1+ i))) + (when (zerop nesting) + ;; Make a new gstring from the characters that constitute a + ;; complete nested group. + (let ((new-header (make-vector (1+ i) nil)) + (new-gstring (make-vector (+ i 2) nil))) + (aset new-header 0 (lgstring-font gstring)) + (dotimes (j i) + (aset new-header (1+ j) (lgstring-char gstring j)) + (lgstring-set-glyph new-gstring j (lgstring-glyph gstring j))) + (lgstring-set-header new-gstring new-header) + (font-shape-gstring new-gstring direction)))))) + +(let ((hieroglyph "[\U00013000-\U0001342F]")) + ;; HORIZONTAL/VERTICAL JOINER and INSERT AT.../OVERLAY controls + (set-char-table-range + composition-function-table + '(#x13430 . #x13436) + (list (vector (concat hieroglyph "[\U00013430-\U00013436]" hieroglyph) + ;; We use font-shape-gstring so that, if the font + ;; doesn't support these controls, the glyphs are + ;; displayed individually, and not as a single + ;; grapheme cluster. + 1 #'font-shape-gstring))) + ;; Grouping controls + (set-char-table-range + composition-function-table + #x13437 + (list (vector "\U00013437[\U00013000-\U0001343F]+" + 0 #'egyptian-shape-grouping))) + ;; "Normal" hieroglyphs, for fonts that don't support the above + ;; controls, but do shape sequences of hieroglyphs without the + ;; controls. + ;; FIXME: As of late 2021, Egyptian Hieroglyph Format Controls are + ;; not yet supported in existing fonts and/or shaping engines, but + ;; some fonts do provide ligatures with which texts in Egyptian + ;; Hieroglyphs are correctly displayed. If and when these format + ;; controls are supported, as described in section 11.4 "Egyptian + ;; Hieroglyphs" of the Unicode Standard, the five lines below (which + ;; allow composition of hieroglyphs without formatting controls + ;; around) can be removed, and the entry in etc/HELLO can be + ;; restored to: + ;; Egyptian Hieroglyphs (𓂋𓏤𓈖𓆎𓅓𓏏𓊖) 𓅓𓊵𓏏𓊪, 𓇍𓇋𓂻𓍘𓇋 + (set-char-table-range + composition-function-table + '(#x13000 . #x1342E) + (list (vector "[\U00013000-\U0001342E]+" + 0 #'font-shape-gstring)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Hanifi Rohingya +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(set-language-info-alist + "Hanifi Rohingya" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "hanifi-rohingya") + (sample-text . "Hanifi Rohingya (𐴌𐴟𐴇𐴥𐴝𐴚𐴒𐴙𐴝 𐴇𐴝𐴕𐴞𐴉𐴞 𐴓𐴠𐴑𐴤𐴝) 𐴀𐴝𐴏𐴓𐴝𐴀𐴡𐴤𐴛𐴝𐴓𐴝𐴙𐴑𐴟𐴔") + (documentation . "\ +Rohingya language and its script Hanifi Rohingya are supported +in this language environment."))) + +;; Hanifi Rohingya composition rules +(set-char-table-range + composition-function-table + '(#x10D1D . #x10D27) + (list (vector + "[\x10D00-\x10D27]+" + 1 'font-shape-gstring))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Kharoṣṭhī +;; Author: Stefan Baums <baums@gandhari.org> +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(set-language-info-alist + "Kharoshthi" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "kharoshthi") + (sample-text . "Kharoṣṭhī (𐨑𐨪𐨆𐨛𐨁) 𐨣𐨨𐨲𐨪𐨆 𐨐𐨪𐨅𐨨𐨁") + (documentation . "\ +Language environment for Gāndhārī, Sanskrit, and other languages +using the Kharoṣṭhī script."))) + +(let ((consonant "[\U00010A00\U00010A10-\U00010A35]") + (vowel "[\U00010A01-\U00010A06]") + (virama "\U00010A3F") + (modifier "[\U00010A0C-\U00010A0F\U00010A38-\U00010A3A]")) + (set-char-table-range composition-function-table + '(#x10A3F . #x10A3F) + (list + (vector + (concat consonant + "\\(?:" virama consonant "\\)*" + modifier "*" + virama "?" + vowel "*" + modifier "*") + 1 'font-shape-gstring)))) (provide 'misc-lang) diff --git a/lisp/language/philippine.el b/lisp/language/philippine.el new file mode 100644 index 00000000000..e52ad6912cd --- /dev/null +++ b/lisp/language/philippine.el @@ -0,0 +1,96 @@ +;;; philippine.el --- Philippine languages support -*- coding: utf-8; lexical-binding: t; -*- + +;; Copyright (C) 2022 Free Software Foundation, Inc. + +;; Author: समीर सिंह Sameer Singh <lumarzeli30@gmail.com> +;; Keywords: multilingual, input method, i18n, Philippines + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. + +;;; Commentary: + +;; This file contains definitions of Philippine language environments, and +;; setups for displaying the scripts used there. + +;;; Code: + +(set-language-info-alist + "Tagalog" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "tagalog") + (sample-text . "Tagalog (ᜊᜌ᜔ᜊᜌᜒᜈ᜔) ᜃᜓᜋᜓᜐ᜔ᜆ") + (documentation . "\ +Tagalog language using the Baybayin script is supported in +this language environment."))) + +(set-language-info-alist + "Hanunoo" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "hanunoo") + (sample-text . "Hanunoo (ᜱᜨᜳᜨᜳᜢ) ᜫᜬᜧ᜴ ᜣᜭᜯᜥ᜴ ᜰᜲᜭᜥ᜴") + (documentation . "\ +Philippine Language Hanunoo is supported in this language environment."))) + +(set-language-info-alist + "Buhid" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "buhid") + (documentation . "\ +Philippine Language Buhid is supported in this language environment."))) + +(set-language-info-alist + "Tagbanwa" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (input-method . "tagbanwa") + (sample-text . "Tagbanwa (ᝦᝪᝯ) ᝫᝩᝬᝥ ᝣᝮᝧᝯ") + (documentation . "\ +Philippine Languages Tagbanwa are supported in this language environment."))) + +;; Tagalog composition rules +(let ((akshara "[\x1700-\x1711\x171F]") + (vowel "[\x1712\x1713]") + (virama "\x1714") + (pamudpod "\x1715")) + (set-char-table-range composition-function-table + '(#x1714 . #x1714) + (list (vector + ;; Akshara virama syllables + (concat akshara virama vowel "?") + 1 'font-shape-gstring))) + (set-char-table-range composition-function-table + '(#x1715 . #x1715) + (list (vector + ;; Akshara pamudpod syllables + (concat akshara pamudpod vowel "?") + 1 'font-shape-gstring)))) + +;; Hanunoo composition rules +(let ((akshara "[\x1720-\x1731]") + (vowel "[\x1732\x1733]") + (pamudpod "\x1734")) + (set-char-table-range composition-function-table + '(#x1734 . #x1734) + (list (vector + ;; Akshara pamudpod syllables + (concat akshara pamudpod vowel "?") + 1 'font-shape-gstring)))) + +(provide 'philippine) +;;; philippine.el ends here diff --git a/lisp/language/romanian.el b/lisp/language/romanian.el index 00deb698848..972326c7a83 100644 --- a/lisp/language/romanian.el +++ b/lisp/language/romanian.el @@ -1,8 +1,8 @@ -;;; romanian.el --- support for Romanian -*- coding: utf-8 -*- +;;; romanian.el --- support for Romanian -*- coding: utf-8; lexical-binding: t -*- -;; Copyright (C) 1998, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001-2022 Free Software Foundation, Inc. -;; Author: Dan Nicolaescu <done@ece.arizona.edu> +;; Author: Dan Nicolaescu <done@ece.arizona.edu> ;; Keywords: multilingual, Romanian, i18n ;; This file is part of GNU Emacs. diff --git a/lisp/language/sinhala.el b/lisp/language/sinhala.el index efd8aacc5ac..bf320506001 100644 --- a/lisp/language/sinhala.el +++ b/lisp/language/sinhala.el @@ -1,4 +1,4 @@ -;;; sinhala.el --- support for Sinhala -*- coding: utf-8 -*- +;;; sinhala.el --- support for Sinhala -*- coding: utf-8; lexical-binding: t -*- ;; Copyright (C) 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -21,6 +21,8 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. +;;; Commentary: + ;;; Code: (set-language-info-alist @@ -43,6 +45,6 @@ "[\u0D85-\u0D96][\u0D82-\u0D83]?\\|" ;; any other singleton characters "[\u0D80-\u0DFF]") - 0 'font-shape-gstring))) + 0 #'font-shape-gstring))) -;; sinhala.el ends here +;;; sinhala.el ends here diff --git a/lisp/language/slovak.el b/lisp/language/slovak.el index 9682722e6ee..cc0c6e2e029 100644 --- a/lisp/language/slovak.el +++ b/lisp/language/slovak.el @@ -1,6 +1,6 @@ -;;; slovak.el --- support for Slovak -*- coding: utf-8 -*- +;;; slovak.el --- support for Slovak -*- coding: utf-8; lexical-binding: t -*- -;; Copyright (C) 1998, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001-2022 Free Software Foundation, Inc. ;; Authors: Tibor Šimko <tibor.simko@fmph.uniba.sk>, ;; Milan Zamazal <pdm@zamazal.org> diff --git a/lisp/language/tai-viet.el b/lisp/language/tai-viet.el index 3c589106254..9029aa391f0 100644 --- a/lisp/language/tai-viet.el +++ b/lisp/language/tai-viet.el @@ -1,6 +1,6 @@ -;;; tai-viet.el --- support for Tai Viet -*- coding: utf-8 -*- +;;; tai-viet.el --- support for Tai Viet -*- coding: utf-8; lexical-binding: t -*- -;; Copyright (C) 2007-2017 Free Software Foundation, Inc. +;; Copyright (C) 2007-2022 Free Software Foundation, Inc. ;; Copyright (C) 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H13PRO009 @@ -30,7 +30,7 @@ (set-char-table-range composition-function-table '(#xAA80 . #xAADF) - 'tai-viet-composition-function) + #'tai-viet-composition-function) (set-language-info-alist "TaiViet" '((charset unicode) @@ -39,21 +39,22 @@ (input-method . "tai-sonla") (sample-text . "TaiViet (ꪁꪫꪱꪣ ꪼꪕ)\t\tꪅꪰꪙꫂ ꪨꪮꫂ ꪁꪫꪱ / ꪅꪽ ꪨꪷ ꪁꪫꪱ") (documentation . "\ -TaiViet refers to the Tai language used by Tai people in -Vietnam, and also refers to the script used for this language. -Both the script and language have the same origin as that of Thai +TaiViet refers to the Tai script, which is used to write several +Tai languages of northwestern Vietnam and surrounding areas. These +languages are Tai Dam (also known as Black Tai or Tai Noir), +Tai Dón (also known as White Tai or Tai Blanc), Tày Tac, +Tai Daeng (also known as Red Tai or Tai Rouge), +and Thai Song (also known as Lao Song). However, some people +consider Tai Dam, Tai Dón and Tai Daeng to be dialects of the +same language, and call them collectively \"Tai Viet\". + +Both the script and languages have the same origin as that of Thai language/script used in Thailand, but now they differ from each other in a significant way (especially the scripts are). The language name is spelled as \"ꪁꪫꪱꪣ ꪼꪕ\", and the script name is -spelled as \"ꪎ ꪼꪕ\" in the modern form, \"ꪎꪳ ꪼꪕ\" in the traditional -form. - -As the proposal for TaiViet script to the Unicode is still on -the progress, we use the Private Use Area for TaiViet -characters (U+F000..U+F07E). A TaiViet font encoded accordingly -is available at this web page: - http://www.m17n.org/viettai/ -"))) +spelled as \"ꪎꪳ ꪼꪕ\"."))) (provide 'tai-viet) + +;;; tai-viet.el ends here diff --git a/lisp/language/thai-util.el b/lisp/language/thai-util.el index c8c844fbe25..6c004e9495c 100644 --- a/lisp/language/thai-util.el +++ b/lisp/language/thai-util.el @@ -1,6 +1,6 @@ -;;; thai-util.el --- utilities for Thai -*- coding: utf-8; -*- +;;; thai-util.el --- utilities for Thai -*- lexical-binding: t; -*- -;; Copyright (C) 2000-2017 Free Software Foundation, Inc. +;; Copyright (C) 2000-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -225,17 +225,17 @@ positions (integers or markers) specifying the region." (thai-compose-region (point-min) (point-max))) ;;;###autoload -(defun thai-composition-function (gstring) +(defun thai-composition-function (gstring direction) (if (= (lgstring-char-len gstring) 1) - (compose-gstring-for-graphic gstring) - (or (font-shape-gstring gstring) + (compose-gstring-for-graphic gstring direction) + (or (font-shape-gstring gstring direction) (let ((glyph-len (lgstring-glyph-len gstring)) (last-char (lgstring-char gstring (1- (lgstring-char-len gstring)))) - (i 0) - glyph) + (i 0)) ;; glyph (while (and (< i glyph-len) - (setq glyph (lgstring-glyph gstring i))) + ;; (setq glyph + (lgstring-glyph gstring i)) ;; ) (setq i (1+ i))) (if (= last-char ?ำ) (setq i (1- i))) @@ -244,23 +244,20 @@ positions (integers or markers) specifying the region." ;; Thai-word-mode requires functions in the feature `thai-word'. (require 'thai-word) -(defvar thai-word-mode-map - (let ((map (make-sparse-keymap))) - (define-key map [remap forward-word] 'thai-forward-word) - (define-key map [remap backward-word] 'thai-backward-word) - (define-key map [remap kill-word] 'thai-kill-word) - (define-key map [remap backward-kill-word] 'thai-backward-kill-word) - (define-key map [remap transpose-words] 'thai-transpose-words) - map) - "Keymap for `thai-word-mode'.") +(defvar-keymap thai-word-mode-map + :doc "Keymap for `thai-word-mode'." + "<remap> <forward-word>" #'thai-forward-word + "<remap> <backward-word>" #'thai-backward-word + "<remap> <kill-word>" #'thai-kill-word + "<remap> <backward-kill-word>" #'thai-backward-kill-word + "<remap> <transpose-words>" #'thai-transpose-words) (define-minor-mode thai-word-mode "Minor mode to make word-oriented commands aware of Thai words. -With a prefix argument ARG, enable the mode if ARG is positive, -and disable it otherwise. If called from Lisp, enable the mode -if ARG is omitted or nil. The commands affected are -\\[forward-word], \\[backward-word], \\[kill-word], \\[backward-kill-word], -\\[transpose-words], and \\[fill-paragraph]." + +The commands affected are \\[forward-word], \\[backward-word], +\\[kill-word], \\[backward-kill-word], \\[transpose-words], and +\\[fill-paragraph]." :global t :group 'mule (cond (thai-word-mode ;; This enables linebreak between Thai characters. diff --git a/lisp/language/thai-word.el b/lisp/language/thai-word.el index e67dd093430..d12064958e1 100644 --- a/lisp/language/thai-word.el +++ b/lisp/language/thai-word.el @@ -1,10 +1,10 @@ -;;; thai-word.el -- find Thai word boundaries +;;; thai-word.el --- find Thai word boundaries -*- lexical-binding: t; -*- ;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) ;; Registration Number H14PRO021 -;; Author: Kenichi HANDA <handa@etl.go.jp> +;; Author: Kenichi Handa <handa@gnu.org> ;; Keywords: thai, word break, emacs @@ -64,7 +64,6 @@ ;; the sale, use or other dealings in this Software without prior ;; written authorization of the copyright holder. - ;;; Commentary: ;; This file implements an algorithm to find Thai word breaks using a @@ -76,6 +75,8 @@ ;; which means that you can easily index the list character by ;; character. +;;; Code: + (defvar thai-word-table (let ((table (list 'thai-words))) (dolist (elt @@ -10740,8 +10741,8 @@ (defun thai-update-word-table (file &optional append) - "Update Thai word table by replacing the current word list with -FILE. If called with a prefix argument, FILE is appended instead to + "Update Thai word table by replacing the current word list with FILE. +If called with a prefix argument, FILE is appended instead to the current word list." (interactive "FThai word table file: \nP") (let ((buf (generate-new-buffer "*thai-work*")) @@ -10973,8 +10974,7 @@ If COUNT is negative, move point backward (- COUNT) words." ;; special instead of using forward-word. (let ((start (point)) (limit (match-end 0)) - boundaries - tail) + boundaries) ;; tail ;; If thai-forward-word has been called within a Thai ;; region, we must go back until the Thai region starts ;; to do the contextual analysis for finding word @@ -11042,20 +11042,20 @@ If COUNT is negative, move point forward (- COUNT) words." (defun thai-kill-word (arg) - "Like kill-word but pay attention to Thai word boundaries. + "Like `kill-word' but pay attention to Thai word boundaries. With argument, do this that many times." (interactive "p") (kill-region (point) (progn (thai-forward-word arg) (point)))) (defun thai-backward-kill-word (arg) - "Like backward-kill-word but pay attention to Thai word boundaries." + "Like `backward-kill-word' but pay attention to Thai word boundaries." (interactive "p") (thai-kill-word (- arg))) (defun thai-transpose-words (arg) - "Like transpose-words but pay attention to Thai word boundaries." + "Like `transpose-words' but pay attention to Thai word boundaries." (interactive "*p") (transpose-subr 'thai-forward-word arg)) @@ -11075,4 +11075,4 @@ With argument, do this that many times." ;; coding: utf-8 ;; End: -;; end of thai-word.el +;;; thai-word.el ends here diff --git a/lisp/language/thai.el b/lisp/language/thai.el index 945ea31c8d7..60f5f9d2a38 100644 --- a/lisp/language/thai.el +++ b/lisp/language/thai.el @@ -1,6 +1,6 @@ -;;; thai.el --- support for Thai -*- coding: utf-8 -*- +;;; thai.el --- support for Thai -*- coding: utf-8; lexical-binding: t; -*- -;; Copyright (C) 1997-1998, 2000-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997-1998, 2000-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -82,6 +82,43 @@ This is the same as `thai-tis620' with the addition of no-break-space." (aset composition-function-table (aref chars i) elt))) (aset composition-function-table ?ำ '(["[ก-ฯ]." 1 thai-composition-function])) +;; Tai-Tham + +(set-language-info-alist + "Northern Thai" '((charset unicode) + (coding-system utf-8) + (coding-priority utf-8) + (sample-text . + "Northern Thai (ᨣᩣᩴᨾᩮᩬᩥᨦ / ᨽᩣᩈᩣᩃ᩶ᩣ᩠ᨶᨶᩣ) ᩈ᩠ᩅᩢᩔ᩠ᨯᩦᨣᩕᩢ᩠ᨸ") + (documentation . t))) + +;; From Richard Wordingham <richard.wordingham@ntlworld.com>: +(defvar tai-tham-composable-pattern + (let ((table + ;; C is letters, independent vowels, digits, punctuation and symbols. + '(("C" . "[\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD]") + ("M" . ; Marks, CGJ, ZWNJ, ZWJ + "[\u0324\u034F\u0E49\u0E4A\u0E4B\u1A55-\u1A57\u1A59-\u1A5E\u1A61-\u1A7C\u1A7F\u200C\200D]") + ("H" . "\u1A60") ; Sakot + ("S" . ; Marks commuting with sakot + "[\u0E49-\u0E4B\u0EC9\u0ECB\u1A75-\u1A7C]") + ("N" . "\u1A58"))) ; mai kang lai + (basic-syllable "C\\(N*\\(M\\|HS*C\\)\\)*") + (regexp "X\\(N\\(X\\)?\\)*H?")) ; where X is basic syllable + (let ((case-fold-search nil)) + (setq regexp (replace-regexp-in-string "X" basic-syllable regexp t t)) + (dolist (elt table) + (setq regexp (replace-regexp-in-string (car elt) (cdr elt) + regexp t t)))) + regexp)) + +(let ((elt (list (vector tai-tham-composable-pattern 0 'font-shape-gstring) + ))) + (set-char-table-range composition-function-table '(#x1A20 . #x1A54) elt) + (set-char-table-range composition-function-table '(#x1A80 . #x1A89) elt) + (set-char-table-range composition-function-table '(#x1A90 . #x1A99) elt) + (set-char-table-range composition-function-table '(#x1AA0 . #x1AAD) elt)) + (provide 'thai) ;;; thai.el ends here diff --git a/lisp/language/tibet-util.el b/lisp/language/tibet-util.el index f3648c9b204..e7cb289b65f 100644 --- a/lisp/language/tibet-util.el +++ b/lisp/language/tibet-util.el @@ -1,6 +1,6 @@ -;;; tibet-util.el --- utilities for Tibetan -*- coding: utf-8-emacs; -*- +;;; tibet-util.el --- utilities for Tibetan -*- coding: utf-8-emacs; lexical-binding: t; -*- -;; Copyright (C) 1997, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -43,18 +43,22 @@ ("་" . "་") ("༔" . "༔") ;; Yes these are dirty. But ... - ("༎ ༎" . ,(compose-string "༎ ༎" 0 3 [?༎ (Br . Bl) ? (Br . Bl) ?༎])) + ("༎ ༎" . ,(compose-string (copy-sequence "༎ ༎") + 0 3 [?༎ (Br . Bl) ? (Br . Bl) ?༎])) ("༄༅༅" . ,(compose-string - "࿁࿂࿂࿂" 0 4 + (copy-sequence "࿁࿂࿂࿂") 0 4 [?࿁ (Br . Bl) ?࿂ (Br . Bl) ?࿂ (Br . Bl) ?࿂])) - ("༄༅" . ,(compose-string "࿁࿂࿂" 0 3 [?࿁ (Br . Bl) ?࿂ (Br . Bl) ?࿂])) - ("༆" . ,(compose-string "࿁࿂༙" 0 3 [?࿁ (Br . Bl) ?࿂ (br . tr) ?༙])) - ("༄" . ,(compose-string "࿁࿂" 0 2 [?࿁ (Br . Bl) ?࿂])))) + ("༄༅" . ,(compose-string (copy-sequence "࿁࿂࿂") + 0 3 [?࿁ (Br . Bl) ?࿂ (Br . Bl) ?࿂])) + ("༆" . ,(compose-string (copy-sequence "࿁࿂༙") + 0 3 [?࿁ (Br . Bl) ?࿂ (br . tr) ?༙])) + ("༄" . ,(compose-string (copy-sequence "࿁࿂") + 0 2 [?࿁ (Br . Bl) ?࿂])))) ;;;###autoload (defun tibetan-char-p (ch) "Check if char CH is Tibetan character. -Returns non-nil if CH is Tibetan. Otherwise, returns nil." +Returns non-nil if CH is Tibetan. Otherwise, returns nil." (memq (char-charset ch) '(tibetan tibetan-1-column))) ;;; Functions for Tibetan <-> Tibetan-transcription. @@ -122,42 +126,42 @@ The returned string has no composition information." (setq t-str-list (cons (substring str idx) t-str-list))) (apply 'concat (nreverse t-str-list)))) -;;; +;; ;;; Functions for composing/decomposing Tibetan sequence. -;;; -;;; A Tibetan syllable is typically structured as follows: -;;; -;;; [Prefix] C [C+] V [M] [Suffix [Post suffix]] -;;; -;;; where C's are all vertically stacked, V appears below or above -;;; consonant cluster and M is always put above the C[C+]V combination. -;;; (Sanskrit visarga, though it is a vowel modifier, is considered -;;; to be a punctuation.) -;;; -;;; Here are examples of the words "bsgrubs" and "hfauM" -;;; -;;; བསྒྲུབས ཧཱུཾ -;;; -;;; M -;;; b s b s h -;;; g fa -;;; r u -;;; u -;;; -;;; Consonants `'' (འ), `w' (ཝ), `y' (ཡ), `r' (ར) take special -;;; forms when they are used as subjoined consonant. Consonant `r' -;;; takes another special form when used as superjoined in such a case -;;; as "rka", while it does not change its form when conjoined with -;;; subjoined `'', `w' or `y' as in "rwa", "rya". - -;; Append a proper composition rule and glyph to COMPONENTS to compose -;; CHAR with a composition that has COMPONENTS. +;; +;; A Tibetan syllable is typically structured as follows: +;; +;; [Prefix] C [C+] V [M] [Suffix [Post suffix]] +;; +;; where C's are all vertically stacked, V appears below or above +;; consonant cluster and M is always put above the C[C+]V combination. +;; (Sanskrit visarga, though it is a vowel modifier, is considered +;; to be a punctuation.) +;; +;; Here are examples of the words "bsgrubs" and "hfauM" +;; +;; བསྒྲུབས ཧཱུཾ +;; +;; M +;; b s b s h +;; g fa +;; r u +;; u +;; +;; Consonants `'' (འ), `w' (ཝ), `y' (ཡ), `r' (ར) take special +;; forms when they are used as subjoined consonant. Consonant `r' +;; takes another special form when used as superjoined in such a case +;; as "rka", while it does not change its form when conjoined with +;; subjoined `'', `w' or `y' as in "rwa", "rya". + +; Append a proper composition rule and glyph to COMPONENTS to compose +; CHAR with a composition that has COMPONENTS. (defun tibetan-add-components (components char) (let ((last (last components)) (stack-upper '(tc . bc)) (stack-under '(bc . tc)) - rule comp-vowel tmp) + rule comp-vowel) ;; Special treatment for 'a chung. ;; If 'a follows a consonant, turn it into the subjoined form. ;; * Disabled by Tomabechi 2000/06/09 * @@ -242,7 +246,7 @@ The returned string has no composition information." (defun tibetan-compose-region (beg end) "Compose Tibetan text the region BEG and END." (interactive "r") - (let (str result chars) + ;; (let (str result chars) (save-excursion (save-restriction (narrow-to-region beg end) @@ -268,17 +272,18 @@ The returned string has no composition information." (while (< (point) to) (tibetan-add-components components (following-char)) (forward-char 1)) - (compose-region from to components))))))) + (compose-region from to components)))))) ;; ) (defvar tibetan-decompose-precomposition-alist - (mapcar (function (lambda (x) (cons (string-to-char (cdr x)) (car x)))) + (mapcar (lambda (x) (cons (string-to-char (cdr x)) (car x))) tibetan-precomposition-rule-alist)) ;;;###autoload (defun tibetan-decompose-region (from to) "Decompose Tibetan text in the region FROM and TO. -This is different from decompose-region because precomposed Tibetan characters -are decomposed into normal Tibetan character sequences." +This is different from `decompose-region' because precomposed +Tibetan characters are decomposed into normal Tibetan character +sequences." (interactive "r") (save-restriction (narrow-to-region from to) @@ -297,8 +302,9 @@ are decomposed into normal Tibetan character sequences." ;;;###autoload (defun tibetan-decompose-string (str) "Decompose Tibetan string STR. -This is different from decompose-string because precomposed Tibetan characters -are decomposed into normal Tibetan character sequences." +This is different from `decompose-string' because precomposed +Tibetan characters are decomposed into normal Tibetan character +sequences." (let ((new "") (len (length str)) (idx 0) @@ -328,7 +334,7 @@ See also the documentation of the function `tibetan-decompose-region'." ;;;###autoload (defun tibetan-compose-buffer () "Composes Tibetan character components in the buffer. -See also docstring of the function tibetan-compose-region." +See also docstring of the function `tibetan-compose-region'." (interactive) (make-local-variable 'tibetan-decomposed) (tibetan-compose-region (point-min) (point-max)) diff --git a/lisp/language/tibetan.el b/lisp/language/tibetan.el index 962dd2bee5b..0262798bb27 100644 --- a/lisp/language/tibetan.el +++ b/lisp/language/tibetan.el @@ -1,6 +1,6 @@ -;;; tibetan.el --- support for Tibetan language -*- coding: utf-8-emacs; -*- +;;; tibetan.el --- support for Tibetan language -*- coding: utf-8-emacs; lexical-binding: t; -*- -;; Copyright (C) 1997, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1997, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ;; 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -326,7 +326,9 @@ (defconst tibetan-subjoined-transcription-alist - (sort '(("+k" . "ྐ") + (sort + (copy-sequence + '(("+k" . "ྐ") ("+kh" . "ྑ") ("+g" . "ྒ") ("+gh" . "ྒྷ") @@ -371,8 +373,8 @@ ("+W" . "ྺ") ;; fixed form subscribed WA ("+Y" . "ྻ") ;; fixed form subscribed YA ("+R" . "ྼ") ;; fixed form subscribed RA - ) - (lambda (x y) (> (length (car x)) (length (car y)))))) + )) + (lambda (x y) (> (length (car x)) (length (car y)))))) ;;; ;;; alist for Tibetan base consonant <-> subjoined consonant conversion. @@ -451,7 +453,7 @@ ;;; (includes some punctuation conversion rules) ;;; (defconst tibetan-precomposition-rule-alist - `(("ཕྱྭ" . "") + '(("ཕྱྭ" . "") ("གྲྭ" . "") ("ཚྭ" . "") ("རྩྭ" . "") @@ -549,19 +551,16 @@ ("སྨ" . ""))) (defconst tibetan-regexp - (let ((l (list tibetan-precomposed-transcription-alist - tibetan-consonant-transcription-alist - tibetan-vowel-transcription-alist - tibetan-modifier-transcription-alist - tibetan-subjoined-transcription-alist)) - (separator "\\|") - tail pattern) - (while l - (setq tail (car l) l (cdr l)) - (while tail - (setq pattern (cons separator (cons (car (car tail)) pattern)) - tail (cdr tail)))) - (apply 'concat (nreverse (cdr pattern)))) + (let (pattern) + (dolist (alist (list tibetan-precomposed-transcription-alist + tibetan-consonant-transcription-alist + tibetan-vowel-transcription-alist + tibetan-modifier-transcription-alist + tibetan-subjoined-transcription-alist) + (apply #'concat (nreverse (cdr pattern)))) + (dolist (key-val alist) + (setq pattern (cons "\\|" (cons (regexp-quote (car key-val)) + pattern)))))) "Regexp matching a Tibetan transcription of a composable Tibetan sequence. The result of matching is to be used for indexing alists at conversion from a roman transcription to the corresponding Tibetan character.") @@ -594,8 +593,8 @@ from an input method is converted to the corresponding precomposed glyph.") (setq temp (concat temp "\\|" (car (car l)))) (setq l (cdr l))) (concat temp "\\)"))) - "Regexp string to match a sequence of Tibetan consonantic components, i.e., -one base consonant and one or more subjoined consonants. + "Regexp string to match a sequence of Tibetan consonantic components. +That is, one base consonant and one or more subjoined consonants. The result of matching is to be used for indexing alist when the component sequence is converted to the corresponding precomposed glyph. This also matches some punctuation characters which need conversion.") @@ -606,7 +605,7 @@ This also matches some punctuation characters which need conversion.") ;; For automatic composition. (set-char-table-range composition-function-table '(#xF00 . #xFD1) - (list (vector tibetan-composable-pattern 0 'font-shape-gstring))) + (list (vector tibetan-composable-pattern 0 #'font-shape-gstring))) (provide 'tibetan) diff --git a/lisp/language/tv-util.el b/lisp/language/tv-util.el index a667956a060..b0527060db0 100644 --- a/lisp/language/tv-util.el +++ b/lisp/language/tv-util.el @@ -1,4 +1,4 @@ -;;; tv-util.el --- support for Tai Viet -*- coding: utf-8 -*- +;;; tv-util.el --- support for Tai Viet -*- lexical-binding: t; -*- ;; Copyright (C) 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -21,12 +21,13 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -;;; Code +;;; Commentary: -;; Regexp matching with a sequence of Tai Viet characters. -(defconst tai-viet-re "[\xaa80-\xaac2\xaadb-\xaadf]+") +;;; Code: + +(defconst tai-viet-re "[\xaa80-\xaac2\xaadb-\xaadf]+" + "Regexp matching with a sequence of Tai Viet characters.") -;; Char-table of information about glyph type of Tai Viet characters. (defconst tai-viet-glyph-info (let ((table (make-char-table nil)) (specials '((right-overhang . "ꪊꪋꪌꪍꪏꪓꪖꪜꪞꪡꪤꪨ") @@ -43,7 +44,8 @@ (chars (cdr elt))) (dotimes (i (length chars)) (aset table (aref chars i) category)))) - table)) + table) + "Char-table of information about glyph type of Tai Viet characters.") (defun tai-viet-compose-string (from to string) "Compose Tai Viet characters in STRING between indices FROM and TO." @@ -128,7 +130,7 @@ ;;;###autoload -(defun tai-viet-composition-function (from to font-object string) +(defun tai-viet-composition-function (from _to _font-object string _direction) (if string (if (string-match tai-viet-re string from) (tai-viet-compose-string from (match-end 0) string)) @@ -136,5 +138,6 @@ (if (looking-at tai-viet-re) (tai-viet-compose-region from (match-end 0))))) -;; (provide 'tai-viet-util) + +;;; tv-util.el ends here diff --git a/lisp/language/utf-8-lang.el b/lisp/language/utf-8-lang.el index 4156bf5766b..f709f6fbd87 100644 --- a/lisp/language/utf-8-lang.el +++ b/lisp/language/utf-8-lang.el @@ -1,6 +1,6 @@ -;;; utf-8-lang.el --- generic UTF-8 language environment +;;; utf-8-lang.el --- generic UTF-8 language environment -*- lexical-binding: t -*- -;; Copyright (C) 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 2001-2022 Free Software Foundation, Inc. ;; Author: Dave Love <fx@gnu.org> ;; Keywords: i18n @@ -25,24 +25,24 @@ ;;; Code: (set-language-info-alist - "UTF-8" `((coding-system utf-8) + "UTF-8" '((coding-system utf-8) (coding-priority utf-8) (charset unicode-bmp unicode) -;; Presumably not relevant now. -;; (setup-function -;; . (lambda () -;; ;; Use Unicode font under Windows. Jason Rumney fecit. -;; (if (and (fboundp 'w32-add-charset-info) -;; (not (boundp 'w32-unicode-charset-defined))) -;; (w32-add-charset-info "iso10646-1" 'w32-charset-ansi t)))) -;; Is this appropriate? -;; (exit-function -;; . (lambda () -;; (if (and (fboundp 'w32-add-charset-info) -;; (not (boundp 'w32-unicode-charset-defined))) -;; (setq w32-charset-info-alist -;; (delete (assoc "iso10646-1") -;; w32-charset-info-alist))))) + ;; Presumably not relevant now. + ;; (setup-function + ;; . (lambda () + ;; ;; Use Unicode font under Windows. Jason Rumney fecit. + ;; (if (and (fboundp 'w32-add-charset-info) + ;; (not (boundp 'w32-unicode-charset-defined))) + ;; (w32-add-charset-info "iso10646-1" 'w32-charset-ansi t)))) + ;; Is this appropriate? + ;; (exit-function + ;; . (lambda () + ;; (if (and (fboundp 'w32-add-charset-info) + ;; (not (boundp 'w32-unicode-charset-defined))) + ;; (setq w32-charset-info-alist + ;; (delete (assoc "iso10646-1") + ;; w32-charset-info-alist))))) (input-method . "rfc1345") ; maybe not the best choice (documentation . "\ This language environment is a generic one for the Unicode character set diff --git a/lisp/language/viet-util.el b/lisp/language/viet-util.el index f1946f6b69f..9751fc0e393 100644 --- a/lisp/language/viet-util.el +++ b/lisp/language/viet-util.el @@ -1,6 +1,6 @@ -;;; viet-util.el --- utilities for Vietnamese -*- coding: utf-8; -*- +;;; viet-util.el --- utilities for Vietnamese -*- lexical-binding: t; -*- -;; Copyright (C) 1998, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) diff --git a/lisp/language/vietnamese.el b/lisp/language/vietnamese.el index c170216062d..cd574bb5d5e 100644 --- a/lisp/language/vietnamese.el +++ b/lisp/language/vietnamese.el @@ -1,6 +1,6 @@ -;;; vietnamese.el --- support for Vietnamese -*- coding: utf-8; -*- +;;; vietnamese.el --- support for Vietnamese -*- coding: utf-8; lexical-binding: t -*- -;; Copyright (C) 1998, 2001-2017 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001-2022 Free Software Foundation, Inc. ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; National Institute of Advanced Industrial Science and Technology (AIST) @@ -72,9 +72,9 @@ (define-coding-system-alias 'viqr 'vietnamese-viqr) (set-language-info-alist - "Vietnamese" `((charset viscii) + "Vietnamese" '((charset viscii) (coding-system vietnamese-viscii vietnamese-vscii - vietnamese-tcvn vietnamese-viqr windows-1258) + vietnamese-tcvn vietnamese-viqr windows-1258) (nonascii-translation . viscii) (coding-priority vietnamese-viscii) (input-method . "vietnamese-viqr") |