Skip to content

Instantly share code, notes, and snippets.

@tkosaka
Created February 6, 2011 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkosaka/813027 to your computer and use it in GitHub Desktop.
Save tkosaka/813027 to your computer and use it in GitHub Desktop.
SKK Without A Shift Modifier
;;; Use SKK without a Shift modifier.
;;;
;;; WARNING: You CANNOT use a shift modifer to set a conversion marker when you load this file in .skk.
;;;
;;; Note: I'm using the skk-tutcode. I do not assure that this setting works under other environments.
;;; Set the sticky-key here to load skk-sticky.el.
;;; This setting should be located before other sticky configurations,
;;; because functions must be defined before advising.
(setq skk-sticky-key ":")
;;; Set a sticky-key in the rule-list.
(add-to-list 'skk-rom-kana-rule-list (list ":" nil 'skk-sticky-set-henkan-point))
(defadvice skk-insert (around skk-sticky-ad activate)
"Change the character to be capitalized when it is just after '*' (the marker for okurigana).
The difference from the original advise is that this advise sets `skk-set-henkan-point-key' temporarily.
I do not use a Shift modifier as a marker for conversions at all in using SKK!"
(if (and skk-sticky-okuri-flag
(skk-sticky-looking-back-okuri-mark)
(string= "" skk-prefix))
(let ((skk-set-henkan-point-key '(?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?M ?N ?O ?P ?R ?S ?T ?U ?V ?W ?Y ?Z ?< ?>))
(pair (rassq (skk-last-command-char) skk-downcase-alist)))
(skk-set-last-command-char (if pair
(car pair)
(upcase (skk-last-command-char))))
ad-do-it)
ad-do-it
))
(defadvice skk-insert (before skk-sticky-ad activate)
"Readvise `skk-insert' to nullify the original advise in skk-sticky.el.
`ad-disable-advise' and `ad-remove-advise' should not be used.
because .skk will be loaded again in calling `skk-restart'.
When an advise has been already disabled or removed,
disabling or removing the advise causes an error."
)
;;; Disable shift-keys to start conversion.
(setq skk-set-henkan-point-key nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment