Make possible to move through English word pronunciation with single forward-word.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sun, 11 Sep 2016 15:06:41 +0300
changeset 1430 8380f91bc913
parent 1429 f918516ffeb0
child 1431 c78504ea530f
Make possible to move through English word pronunciation with single forward-word.
.emacs-my
--- a/.emacs-my	Sun Sep 11 11:37:20 2016 +0300
+++ b/.emacs-my	Sun Sep 11 15:06:41 2016 +0300
@@ -853,7 +853,7 @@
 (setq show-paren-style (quote parenthesis))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(message "keyboard, mouse")
+(message "input method")
 
 (setq mouse-yank-at-point t)
 
@@ -884,6 +884,28 @@
 
 (global-set-key (kbd "C-\\") 'my-toggle-input-method)
 
+;; I found this more quick method to allow `forward-word' across pronunciation
+;; as a whole word.
+(defconst my/ipa-chars (list ?ˈ ?ˌ ?ː ?ǁ ?ʲ ?θ ?ð ?ŋ ?ɡ ?ʒ ?ʃ ?ʧ ?ə ?ɜ ?ɛ ?ʌ ?ɒ ?ɔ ?ɑ ?æ ?ʊ ?ɪ))
+(mapc (lambda (ch)
+        (aset char-script-table ch 'latin)
+        (modify-syntax-entry ch "w"))
+      my/ipa-chars)
+;; Another option is to invent new category:
+;;
+;; (defconst my/ipa-chars (list ?ˈ ?ˌ ?ː ?ǁ ?ʲ ?θ ?ð ?ŋ ?ɡ ?ʒ ?ʃ ?ʧ ?ə ?ɜ ?ɛ ?ʌ ?ɒ ?ɔ ?ɑ ?æ ?ʊ ?ɪ))
+;; (define-category ?p "Phonetic")
+;; (mapc (lambda (ch)
+;;         (cond
+;;          ((eq (aref char-script-table ch) 'phonetic)
+;;           (modify-category-entry ch ?p)
+;;           (modify-category-entry ch ?l nil t))
+;;          ((eq (aref char-script-table ch) 'latin)   ; (aref char-script-table ?ˌ) is 'latin but (char-category-set ?ˌ) is ".j"
+;;           (modify-category-entry ch ?l))))
+;;       my/ipa-chars)
+;; (add-to-list 'word-combining-categories '(?p . ?l))
+;; (add-to-list 'word-combining-categories '(?l . ?p))
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 (message "mouse")