aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2019-01-21 17:20:00 -0500
committerStefan Monnier2019-01-21 17:20:00 -0500
commit5259fdf96073febd18e83785960c443bdf02a310 (patch)
tree3b6361712ecad8e187a9b7fc72cb4e17d996b84d
parentbe73ed4338b37973eb67e8fd91aaa9e1166c665c (diff)
downloademacs-5259fdf96073febd18e83785960c443bdf02a310.tar.gz
emacs-5259fdf96073febd18e83785960c443bdf02a310.zip
* lisp/international/titdic-cnv.el: Use lexical-binding
(tit-process-body): Remove unused vars 'template' and 'second'. (tsang-quick-converter): Remove unused args 'name' and 'title'. Remove unused var 'slot'. (tsang-b5-converter, quick-b5-converter, tsang-cns-converter) (quick-cns-converter, py-converter, ziranma-converter) (ctlau-converter, ctlau-gb-converter, ctlau-b5-converter): Remove unused args 'name' and 'title'. (miscdic-convert): Remove unused var 'dicbuf'. Don't pass 'name' and 'title' to the conversion function.
-rw-r--r--lisp/international/titdic-cnv.el49
1 files changed, 23 insertions, 26 deletions
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index f1a81018cb6..2ce2c527b95 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -1,4 +1,4 @@
1;;; titdic-cnv.el --- convert cxterm dictionary (TIT format) to Quail package -*- coding:utf-8-emacs -*- 1;;; titdic-cnv.el --- convert cxterm dictionary (TIT format) to Quail package -*- coding: utf-8-emacs; lexical-binding:t -*-
2 2
3;; Copyright (C) 1997-1998, 2000-2019 Free Software Foundation, Inc. 3;; Copyright (C) 1997-1998, 2000-2019 Free Software Foundation, Inc.
4;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 4;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
@@ -417,9 +417,7 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:陰平, 6:陽平, 3:上聲, 4:去聲,
417;; function call. 417;; function call.
418(defun tit-process-body () 418(defun tit-process-body ()
419 (message "Formatting translation rules...") 419 (message "Formatting translation rules...")
420 (let* ((template (list nil nil)) 420 (let* ((prev-key "")
421 (second (cdr template))
422 (prev-key "")
423 ch key translations pos) 421 ch key translations pos)
424 (princ "(quail-define-rules\n") 422 (princ "(quail-define-rules\n")
425 (while (null (eobp)) 423 (while (null (eobp))
@@ -735,7 +733,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"."
735;; input method is for inputting Big5 characters. Otherwise the input 733;; input method is for inputting Big5 characters. Otherwise the input
736;; method is for inputting CNS characters. 734;; method is for inputting CNS characters.
737 735
738(defun tsang-quick-converter (dicbuf name title tsang-p big5-p) 736(defun tsang-quick-converter (dicbuf tsang-p big5-p)
739 (let ((fulltitle (if tsang-p (if big5-p "倉頡" "倉頡") 737 (let ((fulltitle (if tsang-p (if big5-p "倉頡" "倉頡")
740 (if big5-p "簡易" "簡易"))) 738 (if big5-p "簡易" "簡易")))
741 dic) 739 dic)
@@ -780,7 +778,7 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"."
780 (while (not (eobp)) 778 (while (not (eobp))
781 (forward-char 5) 779 (forward-char 5)
782 (let ((trans (char-to-string (following-char))) 780 (let ((trans (char-to-string (following-char)))
783 key slot) 781 key)
784 (re-search-forward "\\([A-Z]+\\)\r*$" nil t) 782 (re-search-forward "\\([A-Z]+\\)\r*$" nil t)
785 (setq key (downcase 783 (setq key (downcase
786 (if (or tsang-p 784 (if (or tsang-p
@@ -831,23 +829,23 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\"."
831 (if big5-p (nth 1 elt) (nth 2 elt)))))) 829 (if big5-p (nth 1 elt) (nth 2 elt))))))
832 (insert ")\n"))) 830 (insert ")\n")))
833 831
834(defun tsang-b5-converter (dicbuf name title) 832(defun tsang-b5-converter (dicbuf)
835 (tsang-quick-converter dicbuf name title t t)) 833 (tsang-quick-converter dicbuf t t))
836 834
837(defun quick-b5-converter (dicbuf name title) 835(defun quick-b5-converter (dicbuf)
838 (tsang-quick-converter dicbuf name title nil t)) 836 (tsang-quick-converter dicbuf nil t))
839 837
840(defun tsang-cns-converter (dicbuf name title) 838(defun tsang-cns-converter (dicbuf)
841 (tsang-quick-converter dicbuf name title t nil)) 839 (tsang-quick-converter dicbuf t nil))
842 840
843(defun quick-cns-converter (dicbuf name title) 841(defun quick-cns-converter (dicbuf)
844 (tsang-quick-converter dicbuf name title nil nil)) 842 (tsang-quick-converter dicbuf nil nil))
845 843
846;; Generate a code of a Quail package in the current buffer from 844;; Generate a code of a Quail package in the current buffer from
847;; Pinyin dictionary in the buffer DICBUF. The input method name of 845;; Pinyin dictionary in the buffer DICBUF. The input method name of
848;; the Quail package is NAME, and the title string is TITLE. 846;; the Quail package is NAME, and the title string is TITLE.
849 847
850(defun py-converter (dicbuf name title) 848(defun py-converter (dicbuf)
851 (goto-char (point-max)) 849 (goto-char (point-max))
852 (insert (format "%S\n" "汉字输入∷拼音∷ 850 (insert (format "%S\n" "汉字输入∷拼音∷
853 851
@@ -922,14 +920,14 @@ method `chinese-tonepy' with which you must specify tones by digits
922;; Ziranma dictionary in the buffer DICBUF. The input method name of 920;; Ziranma dictionary in the buffer DICBUF. The input method name of
923;; the Quail package is NAME, and the title string is TITLE. 921;; the Quail package is NAME, and the title string is TITLE.
924 922
925(defun ziranma-converter (dicbuf name title) 923(defun ziranma-converter (dicbuf)
926 (let (dic) 924 (let (dic)
927 (with-current-buffer dicbuf 925 (with-current-buffer dicbuf
928 (goto-char (point-min)) 926 (goto-char (point-min))
929 (search-forward "\n%keyname end") 927 (search-forward "\n%keyname end")
930 (forward-line 1) 928 (forward-line 1)
931 (let ((table (make-hash-table :test 'equal)) 929 (let ((table (make-hash-table :test 'equal))
932 elt pos key trans val) 930 pos key trans val)
933 (while (not (eobp)) 931 (while (not (eobp))
934 (setq pos (point)) 932 (setq pos (point))
935 (skip-chars-forward "^ \t") 933 (skip-chars-forward "^ \t")
@@ -1031,7 +1029,7 @@ To input symbols and punctuation, type `/' followed by one of `a' to
1031;; method name of the Quail package is NAME, and the title string is 1029;; method name of the Quail package is NAME, and the title string is
1032;; TITLE. DESCRIPTION is the string shown by describe-input-method. 1030;; TITLE. DESCRIPTION is the string shown by describe-input-method.
1033 1031
1034(defun ctlau-converter (dicbuf name title description) 1032(defun ctlau-converter (dicbuf description)
1035 (goto-char (point-max)) 1033 (goto-char (point-max))
1036 (insert (format "%S\n" description)) 1034 (insert (format "%S\n" description))
1037 (insert " '((\"\C-?\" . quail-delete-last-char) 1035 (insert " '((\"\C-?\" . quail-delete-last-char)
@@ -1041,7 +1039,7 @@ To input symbols and punctuation, type `/' followed by one of `a' to
1041 (\"<\" . quail-prev-translation)) 1039 (\"<\" . quail-prev-translation))
1042 nil nil nil nil)\n\n") 1040 nil nil nil nil)\n\n")
1043 (insert "(quail-define-rules\n") 1041 (insert "(quail-define-rules\n")
1044 (let (dicbuf-start dicbuf-end key-start key (pos (point))) 1042 (let (dicbuf-start dicbuf-end key-start (pos (point)))
1045 ;; Find the dictionary, which starts below a horizontal rule and 1043 ;; Find the dictionary, which starts below a horizontal rule and
1046 ;; ends at the second to last line in the HTML file. 1044 ;; ends at the second to last line in the HTML file.
1047 (with-current-buffer dicbuf 1045 (with-current-buffer dicbuf
@@ -1080,8 +1078,8 @@ To input symbols and punctuation, type `/' followed by one of `a' to
1080 (forward-line 1))) 1078 (forward-line 1)))
1081 (insert ")\n")) 1079 (insert ")\n"))
1082 1080
1083(defun ctlau-gb-converter (dicbuf name title) 1081(defun ctlau-gb-converter (dicbuf)
1084 (ctlau-converter dicbuf name title 1082 (ctlau-converter dicbuf
1085"汉字输入∷刘锡祥式粤音∷ 1083"汉字输入∷刘锡祥式粤音∷
1086 1084
1087 刘锡祥式粤语注音方案 1085 刘锡祥式粤语注音方案
@@ -1094,8 +1092,8 @@ To input symbols and punctuation, type `/' followed by one of `a' to
1094 Some infrequent GB characters are accessed by typing \\, followed by 1092 Some infrequent GB characters are accessed by typing \\, followed by
1095 the Cantonese romanization of the respective radical (部首).")) 1093 the Cantonese romanization of the respective radical (部首)."))
1096 1094
1097(defun ctlau-b5-converter (dicbuf name title) 1095(defun ctlau-b5-converter (dicbuf)
1098 (ctlau-converter dicbuf name title 1096 (ctlau-converter dicbuf
1099"漢字輸入:劉錫祥式粵音: 1097"漢字輸入:劉錫祥式粵音:
1100 1098
1101 劉錫祥式粵語注音方案 1099 劉錫祥式粵語注音方案
@@ -1120,8 +1118,7 @@ the generated Quail package is saved."
1120 (let ((tail quail-misc-package-ext-info) 1118 (let ((tail quail-misc-package-ext-info)
1121 coding-system-for-write 1119 coding-system-for-write
1122 slot 1120 slot
1123 name title dicfile coding quailfile converter copyright 1121 name title dicfile coding quailfile converter copyright)
1124 dicbuf)
1125 (while tail 1122 (while tail
1126 (setq slot (car tail) 1123 (setq slot (car tail)
1127 dicfile (nth 2 slot) 1124 dicfile (nth 2 slot)
@@ -1171,7 +1168,7 @@ the generated Quail package is saved."
1171 (insert-file-contents filename) 1168 (insert-file-contents filename)
1172 (let ((dicbuf (current-buffer))) 1169 (let ((dicbuf (current-buffer)))
1173 (with-current-buffer dstbuf 1170 (with-current-buffer dstbuf
1174 (funcall converter dicbuf name title))))) 1171 (funcall converter dicbuf)))))
1175 (insert ";; Local Variables:\n" 1172 (insert ";; Local Variables:\n"
1176 ";; version-control: never\n" 1173 ";; version-control: never\n"
1177 ";; no-update-autoloads: t\n" 1174 ";; no-update-autoloads: t\n"