From: Jihyun Cho <jihyun.jo@gmail.com>
To: emacs-devel@gnu.org
Subject: [PATCH] adjusting korean key bindings
Date: Thu, 11 Jun 2009 23:27:14 +0900 [thread overview]
Message-ID: <9d644d9b0906110727r7fc75080gf8f10ea47623db7f@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 212 bytes --]
I adjusted a keymap.
Many korean people are using a `Hanja' key to convert Hangul to Hanja
and a `Hangul' key to toggle input method.
As a keymap was adjusted, I modified a `hangul-to-hanja-conversion' function.
[-- Attachment #2: emacs-hanja.patch --]
[-- Type: application/octet-stream, Size: 4025 bytes --]
? lisp/mail/subdirs.el
? lisp/nxml/char-name/subdirs.el
Index: leim/quail/hangul.el
===================================================================
RCS file: /sources/emacs/emacs/leim/quail/hangul.el,v
retrieving revision 1.27
diff -u -8 -p -r1.27 hangul.el
--- leim/quail/hangul.el 8 Jan 2009 04:00:28 -0000 1.27
+++ leim/quail/hangul.el 10 Jun 2009 01:19:26 -0000
@@ -86,16 +86,17 @@
57 62 29 68 6 59 55 16 28 20 60 26 91 92 93 94 95 96 23 78 70 85 71
65 83 90 109 115 87 116 122 113 118 121 21 66 4 69 99 73 9 1 101 17
123 124 125 126])
(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)
map)
"Keymap for Hangul method. It is used by all Hangul input methods.")
;; Current input character buffer. Store separated hangul character.
;; The first and second are Choseong position.
;; The third and forth are Jungseong position.
;; The fifth and sixth are Jongseong position.
;; The second, forth and sixth are double Jamo position.
@@ -354,22 +355,28 @@ Other parts are the same as a `hangul3-i
(delete-backward-char 1)))
(defun hangul-to-hanja-conversion ()
"Convert the previous hangul character to the corresponding hanja character."
(interactive)
(let ((echo-keystrokes 0)
delete-func
hanja-character)
- (setq hanja-character (hangul-to-hanja-char (preceding-char)))
+ (if (and (overlayp quail-overlay) (overlay-start quail-overlay))
+ (progn
+ (setq hanja-character (hangul-to-hanja-char (preceding-char)))
+ (setq delete-func (lambda () (delete-backward-char 1))))
+ (setq hanja-character (hangul-to-hanja-char (following-char)))
+ (setq delete-func (lambda () (delete-char 1))))
(when hanja-character
- (delete-backward-char 1)
+ (funcall delete-func)
(insert hanja-character)
(setq hangul-queue (make-vector 6 0))
- (move-overlay quail-overlay (point) (point)))))
+ (if (and (overlayp quail-overlay) (overlay-start quail-overlay))
+ (move-overlay quail-overlay (point) (point))))))
;; Support function for `hangul2-input-method'. Actually, this
;; function handles the Hangul 2-Bulsik. KEY is an entered key code
;; used for looking up `hangul2-keymap'."
(defun hangul2-input-method-internal (key)
(let ((char (+ (aref hangul2-keymap (1- (% key 32)))
(cond ((or (= key ?O) (= key ?P)) 2)
((or (= key ?E) (= key ?Q) (= key ?R)
Index: lisp/language/korea-util.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/language/korea-util.el,v
retrieving revision 1.19
diff -u -8 -p -r1.19 korea-util.el
--- lisp/language/korea-util.el 5 Jan 2009 03:22:27 -0000 1.19
+++ lisp/language/korea-util.el 10 Jun 2009 01:19:27 -0000
@@ -92,19 +92,22 @@
(setq isearch-input-method-function input-method-function
isearch-input-method-local-p t)
(setq input-method-function nil)
(isearch-update))
;; Information for setting and exiting Korean environment.
(defvar korean-key-bindings
`((global [?\S- ] toggle-korean-input-method nil)
+ (global [Hangul] toggle-korean-input-method nil)
(global [C-f9] quail-hangul-switch-symbol-ksc nil)
- (global [f9] quail-hangul-switch-hanja nil)
+ (global [f9] hangul-to-hanja-conversion nil)
+ (global [Hangul_Hanja] hangul-to-hanja-conversion nil)
(,isearch-mode-map [?\S- ] isearch-toggle-korean-input-method nil)
+ (,isearch-mode-map [Hangul] isearch-toggle-korean-input-method nil)
(,isearch-mode-map [C-f9] isearch-hangul-switch-symbol-ksc nil)
(,isearch-mode-map [f9] isearch-hangul-switch-hanja nil)))
;;;###autoload
(defun setup-korean-environment-internal ()
(let ((key-bindings korean-key-bindings))
(while key-bindings
(let* ((this (car key-bindings))
next reply other threads:[~2009-06-11 14:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-11 14:27 Jihyun Cho [this message]
2009-06-12 1:09 ` [PATCH] adjusting korean key bindings Kenichi Handa
2009-06-12 2:05 ` Jason Rumney
2009-06-12 2:54 ` Jihyun Cho
2009-06-15 2:16 ` Kenichi Handa
2009-06-15 12:21 ` Jihyun Cho
2009-06-16 6:43 ` Kenichi Handa
2009-06-17 8:06 ` Jihyun Cho
2009-06-17 11:44 ` Kenichi Handa
2009-06-17 15:34 ` Chong Yidong
2009-06-18 1:32 ` Kenichi Handa
2009-06-18 1:42 ` Kenichi Handa
2009-06-23 3:46 ` Kenichi Handa
2009-06-12 21:22 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9d644d9b0906110727r7fc75080gf8f10ea47623db7f@mail.gmail.com \
--to=jihyun.jo@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).