Mercurial > hg > xemacs-beta
annotate lisp/mule/korea-util.el @ 5753:dbd8305e13cb
Warn about non-string non-integer ARG to #'gensym, bytecomp.el.
lisp/ChangeLog addition:
2013-08-21 Aidan Kehoe <kehoea@parhasard.net>
* bytecomp.el:
* bytecomp.el (gensym):
* bytecomp.el (byte-compile-gensym): New.
Warn that gensym called in a for-effect context is unlikely to be
useful.
Warn about non-string non-integer ARGs, this is incorrect.
Am not changing the function to error with same, most code that
makes the mistake is has no problems, which is why it has survived
so long.
* window-xemacs.el (save-window-excursion/mapping):
* window.el (save-window-excursion):
Call #'gensym with a string, not a symbol.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 21 Aug 2013 19:02:59 +0100 |
parents | 308d34e9f07d |
children | ba0ff364bd94 |
rev | line source |
---|---|
771 | 1 ;;; korea-util.el --- utilities for Korean -*- coding: iso-2022-7bit; -*- |
2 | |
3 ;; Copyright (C) 1997 Free Software Foundation, Inc. | |
4 | |
5 ;; Keywords: mule, multilingual, Korean | |
6 | |
7 ;; This file is part of XEmacs. | |
8 | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
9 ;; XEmacs is free software: you can redistribute it and/or modify it |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
10 ;; under the terms of the GNU General Public License as published by the |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
11 ;; Free Software Foundation, either version 3 of the License, or (at your |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
12 ;; option) any later version. |
771 | 13 |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
14 ;; XEmacs is distributed in the hope that it will be useful, but WITHOUT |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
15 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
16 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
17 ;; for more details. |
771 | 18 |
19 ;; You should have received a copy of the GNU General Public License | |
5402
308d34e9f07d
Changed bulk of GPLv2 or later files identified by script
Mats Lidell <matsl@xemacs.org>
parents:
788
diff
changeset
|
20 ;; along with XEmacs. If not, see <http://www.gnu.org/licenses/>. |
771 | 21 |
778 | 22 ;;; Synched up with: Emacs 21.1 (language/korea-util.el). |
23 | |
24 ;;; Commentary: | |
771 | 25 |
26 ;;; Code: | |
27 | |
788 | 28 (globally-declare-boundp '(input-method-function |
29 isearch-input-method-function | |
30 isearch-input-method-local-p)) | |
31 | |
771 | 32 ;;;###autoload |
33 (defvar default-korean-keyboard | |
34 (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) | |
35 "3" | |
36 "") | |
37 "*The kind of Korean keyboard for Korean input method. | |
38 \"\" for 2, \"3\" for 3.") | |
39 | |
40 ;; functions useful for Korean text input | |
41 | |
42 (defun toggle-korean-input-method () | |
43 "Turn on or off a Korean text input method for the current buffer." | |
44 (interactive) | |
45 (if current-input-method | |
46 (inactivate-input-method) | |
47 (activate-input-method | |
48 (concat "korean-hangul" default-korean-keyboard)))) | |
49 | |
50 (defun quail-hangul-switch-symbol-ksc (&rest ignore) | |
51 "Swith to/from Korean symbol package." | |
52 (interactive "i") | |
53 (and current-input-method | |
54 (if (string-equal current-input-method "korean-symbol") | |
55 (activate-input-method (concat "korean-hangul" | |
56 default-korean-keyboard)) | |
57 (activate-input-method "korean-symbol")))) | |
58 | |
59 (defun quail-hangul-switch-hanja (&rest ignore) | |
60 "Swith to/from Korean hanja package." | |
61 (interactive "i") | |
62 (and current-input-method | |
63 (if (string-match "korean-hanja" current-input-method) | |
64 (activate-input-method (concat "korean-hangul" | |
65 default-korean-keyboard)) | |
66 (activate-input-method (concat "korean-hanja" | |
67 default-korean-keyboard))))) | |
68 | |
69 ;; The following three commands are set in isearch-mode-map. | |
70 | |
71 (defun isearch-toggle-korean-input-method () | |
72 (interactive) | |
73 (let ((overriding-terminal-local-map nil)) | |
74 (toggle-korean-input-method)) | |
75 (setq isearch-input-method-function input-method-function | |
76 isearch-input-method-local-p t) | |
77 (setq input-method-function nil) | |
78 (isearch-update)) | |
79 | |
80 (defun isearch-hangul-switch-symbol-ksc () | |
81 (interactive) | |
82 (let ((overriding-terminal-local-map nil)) | |
83 (quail-hangul-switch-symbol-ksc)) | |
84 (setq isearch-input-method-function input-method-function | |
85 isearch-input-method-local-p t) | |
86 (setq input-method-function nil) | |
87 (isearch-update)) | |
88 | |
89 (defun isearch-hangul-switch-hanja () | |
90 (interactive) | |
91 (let ((overriding-terminal-local-map nil)) | |
92 (quail-hangul-switch-hanja)) | |
93 (setq isearch-input-method-function input-method-function | |
94 isearch-input-method-local-p t) | |
95 (setq input-method-function nil) | |
96 (isearch-update)) | |
97 | |
98 ;; Information for setting and exiting Korean environment. | |
99 (defvar korean-key-bindings | |
100 `((global [?\S- ] toggle-korean-input-method nil) | |
101 (global [C-f9] quail-hangul-switch-symbol-ksc nil) | |
102 (global [f9] quail-hangul-switch-hanja nil) | |
103 (,isearch-mode-map [?\S- ] isearch-toggle-korean-input-method nil) | |
104 (,isearch-mode-map [C-f9] isearch-hangul-switch-symbol-ksc nil) | |
105 (,isearch-mode-map [f9] isearch-hangul-switch-hanja nil))) | |
106 | |
107 ;;;###autoload | |
108 (defun setup-korean-environment-internal () | |
109 (let ((key-bindings korean-key-bindings)) | |
110 (while key-bindings | |
111 (let* ((this (car key-bindings)) | |
112 (key (nth 1 this)) | |
113 (new-def (nth 2 this)) | |
114 old-def) | |
115 (if (eq (car this) 'global) | |
116 (progn | |
117 (setq old-def (global-key-binding key)) | |
118 (global-set-key key new-def)) | |
119 (setq old-def (lookup-key (car this) key)) | |
120 (define-key (car this) key new-def)) | |
121 (setcar (nthcdr 3 this) old-def)) | |
122 (setq key-bindings (cdr key-bindings))))) | |
123 | |
124 (defun exit-korean-environment () | |
125 "Exit Korean language environment." | |
126 (let ((key-bindings korean-key-bindings)) | |
127 (while key-bindings | |
128 (let* ((this (car key-bindings)) | |
129 (key (nth 1 this)) | |
130 (new-def (nth 2 this)) | |
131 (old-def (nth 3 this))) | |
132 (if (eq (car this) 'global) | |
133 (if (eq (global-key-binding key) new-def) | |
134 (global-set-key key old-def)) | |
135 (if (eq (lookup-key (car this) key) new-def) | |
136 (define-key (car this) key old-def)))) | |
137 (setq key-bindings (cdr key-bindings))))) | |
138 | |
139 ;; | |
140 (provide 'korea-util) | |
141 | |
778 | 142 ;;; korea-util.el ends here |