SFC
These 3 topics are quite relatable in my point of view.
It’s been a few months since I joined SFC, and here’s something I realized, which is pretty obvious considering the characteristics of SFC: In this campus, most international students can read and write in at least 3 languages. They consist of the following three: native language, Japanese, and English. Pretty cool, huh? I bet it’s hard to find a university where the majority of students are trilingual.
In my case, I’m South Korean (yes, SOUTH). So I can use both English and Korean, and I’m also learning some Japanese writing in SFC’s Japanese course. I like the course and professors, and I think I’m doing quite well (not really sure how professors are thinking about this hypothesis, wish me luck).
Emacs (and some opinion about IME)
Emacs is a good editor, mate! It’s challengin’ config, outta OS. I guarantee you’ll not go bored…’cause at the end of the day, long as there’s two people left on the network, someone is gonna want someone’s code modified (professionals have standards, though).
I personally think that Emacs’ philosophy fits with SFC’s environment as well. And I reckon that many Emacs users in SFC would face the 3-input-method problem. This relates with even some non-emacs users, because one thing is clear: switching between 3 IME is so complicated and unintuitive.
I’m using the integrated IME of Emacs, ’cause that works smoothly with all the elisp defined keybindings. I had English (which is just nil
in elisp, since that’s the default) and Korean IME in my ring. However, now it’s like EN-JP-KR (alphabetically ordered). So, which keybinding would you choose? C-x C-l C-J
for Japanese or M-x set-input-method "English"
? I reckon those’re not a very good idea. Multilingual, or trilingual people will understand what I’m talking about. It’s so time-consuming. I wanted some intuitive method, at least something like OS level IME, or better than that.
Then I found a solution from KLDP (Korean Linux Documentation Project, which is the most professional open source community in Korea, at least in my point of view). A user named slomo made a cool elisp script named RoFIME for handy IME switching between EN-JP-KR, about 12 years ago.
This was brilliant, so I added this to my config, and it worked smoothly. There were some things I wanted to modify, though. Like some keybindings and ring (IME list) logic. The thing is, I rarely switch between Korean and Japanese. I always use English as my default for the sake of eshell commands, so my presets are like “EN<->KR” and “EN<->JP”. I can say that EN is my main-IME and others are sub-IME.
Therefore I modified it a bit and replaced/added/removed some functions, so that I can switch between main-IME and sub-IME with S-SPC
and change my sub-IME with C-S-SPC
. Also, the sub-IME will always come up when you change it. So you can actively switch between Japanese and Korean as well.
Since I refactored and simplified some functionality of the original RoFIME, I named this LightRoFIME.
;; LightRoFIME: Ring of Favorite Input MEthods, modified by shchoi
;; RoFIME created by slomo at KLDP https://kldp.org/node/109184
;; Modified by shchoi https://web.sfc.keio.ac.jp/~t21526hc/blog/
;; Set your favorite input methods
(setq favorite-input-methods
'(nil "korean-hangul" "japanese"))
(setq default-input-method "korean-hangul")
;; Set key bindings
(global-set-key (kbd "S-SPC") 'toggle-the-other-input-method)
(global-set-key (kbd "C-S-SPC") 'toggle-ring-structure)
;; load settings
(cond
((boundp 'favorite-input-methods)
(setq input-method-ring favorite-input-methods))
(T (setq input-method-ring () )))
(cond
((boundp 'default-input-method)
(add-to-list 'input-method-ring default-input-method)))
;; functions
(defun rofime-swap-heads (ring)
(cons (cadr ring)
(cons (car ring)
(cddr ring))))
(defun rofime-swap-the-ends (ring)
(append (last ring)
(append (reverse (cdr (reverse (cdr ring))))
(list (car ring)))))
(defun rofime-rotate (ring)
(if (< (length ring) 2) ring
(append (cdr ring) (list (car ring)))))
(defun rofime-add (ime)
(add-to-list 'input-method-ring ime))
(defun rofime-message () (interactive)
(message "%S" input-method-ring))
(defun toggle-the-other-input-method() (interactive)
(rofime-add current-input-method)
(setq input-method-ring
(rofime-swap-heads input-method-ring))
(set-input-method (car input-method-ring))
(rofime-message))
(defun rofime-rotate-the-others (ring)
(cons (car ring)
(rofime-rotate (cdr ring))))
(defun toggle-ring-structure () (interactive)
(if (equal (car input-method-ring) nil)
(setq input-method-ring
(rofime-rotate-the-others (reverse input-method-ring)))
(setq input-method-ring
(rofime-swap-the-ends input-method-ring)))
(set-input-method (car input-method-ring))
(rofime-message))