* lisp/leim/quail: Use lexical-binding

* lisp/leim/quail/hangul.el:
* lisp/leim/quail/indian.el:
* lisp/leim/quail/ipa.el:
* lisp/leim/quail/japanese.el:
* lisp/leim/quail/lao.el:
* lisp/leim/quail/latin-ltx.el:
* lisp/leim/quail/lrt.el:
* lisp/leim/quail/sisheng.el:
* lisp/leim/quail/thai.el:
* lisp/leim/quail/tibetan.el: Use lexical-binding.
* lisp/leim/quail/uni-input.el (ucs-input-method): Remove unused var `str`.
This commit is contained in:
Stefan Monnier 2021-02-10 17:37:25 -05:00
parent 8d33cc53a2
commit 1b4435e6ea
10 changed files with 41 additions and 40 deletions

View file

@ -1,4 +1,4 @@
;;; hangul.el --- Korean Hangul input method
;;; hangul.el --- Korean Hangul input method -*- lexical-binding: t; -*-
;; Copyright (C) 2008-2021 Free Software Foundation, Inc.
@ -88,9 +88,9 @@
(defvar hangul-im-keymap
(let ((map (make-sparse-keymap)))
(define-key map "\d" 'hangul-delete-backward-char)
(define-key map [f9] 'hangul-to-hanja-conversion)
(define-key map [Hangul_Hanja] 'hangul-to-hanja-conversion)
(define-key map "\d" #'hangul-delete-backward-char)
(define-key map [f9] #'hangul-to-hanja-conversion)
(define-key map [Hangul_Hanja] #'hangul-to-hanja-conversion)
map)
"Keymap for Hangul method. It is used by all Hangul input methods.")
@ -337,7 +337,7 @@ Other parts are the same as a `hangul3-input-method-cho'."
char)))))
(aset hangul-queue 5 char)))
(hangul-insert-character hangul-queue)
(if (zerop (apply '+ (append hangul-queue nil)))
(if (zerop (apply #'+ (append hangul-queue nil)))
(hangul-insert-character (setq hangul-queue (vector 0 0 0 0 char 0)))
(hangul-insert-character hangul-queue
(setq hangul-queue (vector 0 0 0 0 char 0))))))
@ -349,7 +349,7 @@ Other parts are the same as a `hangul3-input-method-cho'."
(while (and (> i 0) (zerop (aref hangul-queue i)))
(setq i (1- i)))
(aset hangul-queue i 0))
(if (notzerop (apply '+ (append hangul-queue nil)))
(if (notzerop (apply #'+ (append hangul-queue nil)))
(hangul-insert-character hangul-queue)
(delete-char -1)))
@ -514,16 +514,16 @@ When a Korean input method is off, convert the following hangul character."
(defvar-local hangul-input-method-help-text nil)
;;;###autoload
(defun hangul-input-method-activate (input-method func help-text &rest args)
(defun hangul-input-method-activate (_input-method func help-text &rest _args)
"Activate Hangul input method INPUT-METHOD.
FUNC is a function to handle input key.
HELP-TEXT is a text set in `hangul-input-method-help-text'."
(setq deactivate-current-input-method-function 'hangul-input-method-deactivate
describe-current-input-method-function 'hangul-input-method-help
(setq deactivate-current-input-method-function #'hangul-input-method-deactivate
describe-current-input-method-function #'hangul-input-method-help
hangul-input-method-help-text help-text)
(quail-delete-overlays)
(if (eq (selected-window) (minibuffer-window))
(add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer))
(add-hook 'minibuffer-exit-hook #'quail-exit-from-minibuffer))
(setq-local input-method-function func))
(defun hangul-input-method-deactivate ()
@ -538,7 +538,7 @@ HELP-TEXT is a text set in `hangul-input-method-help-text'."
(define-obsolete-function-alias
'hangul-input-method-inactivate
'hangul-input-method-deactivate "24.3")
#'hangul-input-method-deactivate "24.3")
(defun hangul-input-method-help ()
"Describe the current Hangul input method."

View file

@ -1,4 +1,4 @@
;;; ipa.el --- Quail package for inputting IPA characters -*-coding: utf-8;-*-
;;; ipa.el --- Quail package for inputting IPA characters -*- lexical-binding: t; -*-
;; Copyright (C) 2009-2021 Free Software Foundation, Inc.
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@ -276,7 +276,7 @@ string."
(cl-assert (vectorp quail-keymap) t)
(setq quail-keymap (append quail-keymap nil))))
(list
(apply 'vector
(apply #'vector
(mapcar
#'(lambda (entry)
(cl-assert (char-or-string-p entry) t)
@ -502,9 +502,9 @@ of the mapping.")
;; diacritic. To avoid this, handle the input specially with the function
;; ipa-x-sampa-underscore-implosive.
(dolist (implosive-x-sampa (mapcar 'car ipa-x-sampa-implosive-submap))
(dolist (implosive-x-sampa (mapcar #'car ipa-x-sampa-implosive-submap))
(setq implosive-x-sampa (car (split-string implosive-x-sampa "_")))
(quail-defrule (format "%s_" implosive-x-sampa)
'ipa-x-sampa-underscore-implosive))
#'ipa-x-sampa-underscore-implosive))
;;; ipa.el ends here

View file

@ -1,4 +1,4 @@
;;; japanese.el --- Quail package for inputting Japanese
;;; japanese.el --- Quail package for inputting Japanese -*- lexical-binding: t; -*-
;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@ -412,7 +412,7 @@ C-h kkc-help
List these key bindings.
"
nil t t nil nil nil nil nil
'quail-japanese-update-translation
#'quail-japanese-update-translation
'(("K" . quail-japanese-toggle-kana)
(" " . quail-japanese-kanji-kkc)
("\C-m" . quail-no-conversion)
@ -491,7 +491,7 @@ qh: shift to the input method `japanese',
qq: toggle between this input method and the input method `japanese-ascii'.
"
nil t t nil nil nil nil nil
'quail-japanese-hankaku-update-translation)
#'quail-japanese-hankaku-update-translation)
(dolist (elt quail-japanese-transliteration-rules)
(quail-defrule (car elt)
@ -517,7 +517,7 @@ qq: toggle between this input method and the input method `japanese-ascii'.
nil
"Japanese hiragana input method by Roman transliteration."
nil t t nil nil nil nil nil
'quail-japanese-update-translation)
#'quail-japanese-update-translation)
;; Use the same map as that of `japanese'.
(setcar (cdr (cdr quail-current-package))
@ -538,7 +538,7 @@ qq: toggle between this input method and the input method `japanese-ascii'.
nil
"Japanese katakana input method by Roman transliteration."
nil t t nil nil nil nil nil
'quail-japanese-katakana-update-translation)
#'quail-japanese-katakana-update-translation)
(dolist (elt quail-japanese-transliteration-rules)
(quail-defrule (car elt)

View file

@ -1,4 +1,4 @@
;;; lao.el --- Quail package for inputting Lao characters -*-coding: utf-8;-*-
;;; lao.el --- Quail package for inputting Lao characters -*- lexical-binding: t; -*-
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007, 2008, 2009, 2010, 2011
@ -195,7 +195,7 @@ you need to re-load it to properly re-initialize related alists.")
(quail-define-package
"lao" "Lao" "" t
"Lao input method simulating Lao keyboard layout based on Thai TIS620"
nil t t t t nil nil nil 'quail-lao-update-translation nil t)
nil t t t t nil nil nil #'quail-lao-update-translation nil t)
(quail-install-map
(quail-map-from-table

View file

@ -1,4 +1,4 @@
;;; latin-ltx.el --- Quail package for TeX-style input -*-coding: utf-8;-*-
;;; latin-ltx.el --- Quail package for TeX-style input -*- lexical-binding: t; -*-
;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,

View file

@ -1,4 +1,4 @@
;;; lrt.el --- Quail package for inputting Lao characters by LRT method -*-coding: utf-8;-*-
;;; lrt.el --- Quail package for inputting Lao characters by LRT method -*- lexical-binding: t; -*-
;; Copyright (C) 1998, 2001-2021 Free Software Foundation, Inc.
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@ -60,7 +60,7 @@
`\\' (backslash) + `$' => LAO ELLIPSIS
"
nil 'forget-last-selection 'deterministic 'kbd-translate 'show-layout
nil nil nil 'quail-lrt-update-translation nil t)
nil nil nil #'quail-lrt-update-translation nil t)
;; LRT (Lao Roman Transcription) input method accepts the following
;; key sequence:

View file

@ -1,4 +1,4 @@
;;; sisheng.el --- sisheng input method for Chinese pinyin transliteration
;;; sisheng.el --- sisheng input method for Chinese pinyin transliteration -*- lexical-binding: t; -*-
;; Copyright (C) 2004-2021 Free Software Foundation, Inc.

View file

@ -1,4 +1,4 @@
;;; thai.el --- Quail package for inputting Thai characters -*-coding: utf-8;-*-
;;; thai.el --- Quail package for inputting Thai characters -*- lexical-binding: t; -*-
;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011

View file

@ -1,4 +1,4 @@
;;; tibetan.el --- Quail package for inputting Tibetan characters -*-coding: utf-8-emacs;-*-
;;; tibetan.el --- Quail package for inputting Tibetan characters -*-coding: utf-8-emacs; lexical-binding: t; -*-
;; Copyright (C) 1997, 2001-2021 Free Software Foundation, Inc.
;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@ -158,7 +158,7 @@
Tsheg is assigned to SPC. Space is assigned to period `.'.
"
nil nil nil nil nil nil nil nil
'quail-tibetan-update-translation)
#'quail-tibetan-update-translation)
;; Here we build up a Quail map for a Tibetan sequence the whole of
;; which can be one composition.
@ -371,7 +371,7 @@
(setq trans-list (cons trans trans-list)
i last)
(setq trans-list nil i len))))
(apply 'concat (nreverse trans-list))))
(apply #'concat (nreverse trans-list))))
(defvar quail-tibkey-characters nil)
@ -440,7 +440,7 @@
I hope I'll complete in a future revision.
"
nil nil nil nil nil nil nil nil
'quail-tibkey-update-translation)
#'quail-tibkey-update-translation)
(quail-install-map
(quail-map-from-table

View file

@ -1,4 +1,4 @@
;;; uni-input.el --- Hex Unicode input method
;;; uni-input.el --- Hex Unicode input method -*- lexical-binding: t; -*-
;; Copyright (C) 2001-2021 Free Software Foundation, Inc.
;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
@ -57,11 +57,12 @@
(echo-keystrokes 0)
(help-char nil)
(events (list key))
(str " "))
;; (str " ")
)
(unwind-protect
(catch 'non-digit
(progn
(dotimes (i 4)
(dotimes (_ 4)
(let ((seq (read-key-sequence nil))
key)
(if (and (stringp seq)
@ -76,7 +77,7 @@
(throw 'non-digit (append (reverse events)
(listify-key-sequence seq))))))
(quail-delete-region)
(let ((n (string-to-number (apply 'string
(let ((n (string-to-number (apply #'string
(cdr (nreverse events)))
16)))
(if (characterp n)
@ -100,12 +101,12 @@ While this input method is active, the variable
(quail-delete-overlays)
(setq describe-current-input-method-function nil))
(kill-local-variable 'input-method-function))
(setq deactivate-current-input-method-function 'ucs-input-deactivate)
(setq describe-current-input-method-function 'ucs-input-help)
(setq deactivate-current-input-method-function #'ucs-input-deactivate)
(setq describe-current-input-method-function #'ucs-input-help)
(quail-delete-overlays)
(if (eq (selected-window) (minibuffer-window))
(add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer))
(setq-local input-method-function 'ucs-input-method)))
(add-hook 'minibuffer-exit-hook #'quail-exit-from-minibuffer))
(setq-local input-method-function #'ucs-input-method)))
(defun ucs-input-deactivate ()
"Deactivate UCS input method."
@ -114,7 +115,7 @@ While this input method is active, the variable
(define-obsolete-function-alias
'ucs-input-inactivate
'ucs-input-deactivate "24.3")
#'ucs-input-deactivate "24.3")
(defun ucs-input-help ()
(interactive)