|
;; -*- mode:lisp -*- |
|
|
|
;;; Lem editor setting file (init.lisp) |
|
;;; 2021-4-18 v2.04 |
|
;;; |
|
;;; Usage : copy to ~/.lem/init.lisp |
|
|
|
(in-package :lem-user) |
|
|
|
;(load-theme "emacs-light") |
|
(load-theme "emacs-dark") |
|
|
|
;; for frame |
|
(progn |
|
;(defun lem-frame-multiplexer::enable-frame-multiplexer ()) |
|
;(define-key *global-keymap* "C-z c" 'lem-frame-multiplexer::frame-multiplexer-create-with-new-buffer-list) |
|
;(define-key *global-keymap* "C-z d" 'lem-frame-multiplexer::frame-multiplexer-delete) |
|
;(define-key *global-keymap* "C-z p" 'lem-frame-multiplexer::frame-multiplexer-prev) |
|
;(define-key *global-keymap* "C-z n" 'lem-frame-multiplexer::frame-multiplexer-next) |
|
(define-key *global-keymap* "C-x z c" 'lem-frame-multiplexer::frame-multiplexer-create-with-new-buffer-list) |
|
(define-key *global-keymap* "C-x z d" 'lem-frame-multiplexer::frame-multiplexer-delete) |
|
(define-key *global-keymap* "C-x z p" 'lem-frame-multiplexer::frame-multiplexer-prev) |
|
(define-key *global-keymap* "C-x z n" 'lem-frame-multiplexer::frame-multiplexer-next) |
|
) |
|
|
|
;; for logical line move |
|
(progn |
|
;(setf lem::*use-new-vertical-move-function* t) |
|
;(setf lem::*use-cursor-movement-workaround* t) |
|
#+(and (not win32) lem-ncurses) |
|
(progn |
|
;(lem-ncurses::defkeycode "M-up" 564 (make-key :meta t :sym "Up")) |
|
(lem-ncurses::defkeycode "M-down" 523 (make-key :meta t :sym "Down")) |
|
(lem-ncurses::defkeycode "M-left" 543 (make-key :meta t :sym "Left")) |
|
(lem-ncurses::defkeycode "M-right" 558 (make-key :meta t :sym "Right")) |
|
) |
|
(define-key *global-keymap* "M-Up" 'previous-logical-line) |
|
(define-key *global-keymap* "M-Down" 'next-logical-line) |
|
(when (fboundp 'move-to-beginning-of-logical-line) |
|
(define-key *global-keymap* "M-Left" 'move-to-beginning-of-logical-line) |
|
(define-key *global-keymap* "M-Right" 'move-to-end-of-logical-line)) |
|
) |
|
|
|
;; for lisp-mode |
|
(progn |
|
;; indentation setting |
|
(lem-lisp-syntax:set-indentation "alexandria:when-let" 1) |
|
) |
|
|
|
;; for scheme-mode |
|
(progn |
|
;; scheme process |
|
;(setf lem-scheme-mode:*use-scheme-process* t) |
|
;(setf lem-scheme-mode:*scheme-run-command* '("gosh" "-i")) |
|
;(setf lem-scheme-mode:*scheme-load-command* "load") |
|
|
|
;; scheme slime |
|
;(setf lem-scheme-mode:*use-scheme-slime* :auto) |
|
;(setf lem-scheme-mode:*use-scheme-set-library* :repl) |
|
;(setf lem-scheme-mode:*use-scheme-autodoc* t) |
|
(setf lem-scheme-mode:*scheme-swank-server-run-command* |
|
;'("c:/Program Files (x86)/Gauche098/bin/gosh" "-r7" "-AC:/work/r7rs-swank-Gauche-custom" |
|
;'("gosh" "-r7" "-A/home/(username)/devtool/r7rs-swank-Gauche-custom" |
|
'("gosh" "-r7" "-AC:/work/r7rs-swank-Gauche-custom" |
|
"-e(begin (import (gauche-swank)) (start-swank ,port))")) |
|
|
|
;; scheme repl |
|
;(setf lem-scheme-mode:*use-scheme-repl-shortcut* nil) |
|
|
|
;; scheme keyword data |
|
(setf (lem-scheme-mode:scheme-keyword-data) |
|
(append |
|
(lem-scheme-mode:scheme-keyword-data) |
|
;; name completion highlight indentation |
|
'(("reset" t t nil) |
|
("shift" t t 1) |
|
("call/pc" t t nil)))) |
|
) |
|
|
|
;; for ncurses (not windows) |
|
#+(and (not win32) lem-ncurses) |
|
(progn |
|
;; escape key delay setting |
|
;(setf (variable-value 'lem-ncurses::escape-delay :global) 100) |
|
(setf (variable-value 'lem-ncurses::escape-delay :global) 1000) |
|
) |
|
|
|
;; for windows pdcurses |
|
#+(and win32 lem-ncurses) |
|
(progn |
|
;; escape key delay setting |
|
;(setf (variable-value 'lem-ncurses::escape-delay :global) 1000) |
|
|
|
;; input polling interval (sec) |
|
;(setf (lem-ncurses:input-polling-interval) 0.001) |
|
|
|
;; reserve last lines setting |
|
;(setf (lem-ncurses::reserved-last-lines lem-ncurses::*windows-term-setting*) 1) |
|
;(setf (lem-ncurses::reserved-last-lines lem-ncurses::*windows-term-setting*) 0) |
|
|
|
;; write something to last line |
|
;(setf (lem-ncurses::write-last-line lem-ncurses::*windows-term-setting*) t) |
|
;(setf (lem-ncurses::write-last-line lem-ncurses::*windows-term-setting*) nil) |
|
|
|
;; color setting |
|
(when (or ;(eq (lem-ncurses::windows-term-type) :mintty) |
|
;(eq (lem-ncurses::windows-term-type) :conemu) |
|
(eq (lem-ncurses::windows-term-type) :winterm) |
|
;(eq (lem-ncurses::windows-term-type) :cmd.exe) |
|
) |
|
(lem.term:term-set-color 0 #x00 #x00 #x00) |
|
(lem.term:term-set-color 1 #x00 #x00 #x80) |
|
(lem.term:term-set-color 2 #x00 #x80 #x00) |
|
(lem.term:term-set-color 3 #x00 #x80 #x80) |
|
(lem.term:term-set-color 4 #x80 #x00 #x00) |
|
(lem.term:term-set-color 5 #x80 #x00 #x80) |
|
(lem.term:term-set-color 6 #x80 #x80 #x00) |
|
(lem.term:term-set-color 7 #xc0 #xc0 #xc0) |
|
(lem.term:term-set-color 8 #x80 #x80 #x80) |
|
(lem.term:term-set-color 9 #x00 #x00 #xff) |
|
(lem.term:term-set-color 10 #x00 #xff #x00) |
|
(lem.term:term-set-color 11 #x00 #xff #xff) |
|
(lem.term:term-set-color 12 #xff #x00 #x00) |
|
(lem.term:term-set-color 13 #xff #x00 #xff) |
|
(lem.term:term-set-color 14 #xff #xff #x00) |
|
(lem.term:term-set-color 15 #xff #xff #xff)) |
|
|
|
;; attribute setting |
|
(when (or (eq (lem-ncurses::windows-term-type) :mintty) |
|
;(eq (lem-ncurses::windows-term-type) :conemu) |
|
;(eq (lem-ncurses::windows-term-type) :winterm) |
|
(eq (lem-ncurses::windows-term-type) :cmd.exe) |
|
) |
|
(define-attribute modeline |
|
;(t :foreground "white" :background "#404040") |
|
(t :foreground "white" :background "#666666") |
|
) |
|
(define-attribute modeline-inactive |
|
;(t :foreground "gray" :background "#303030") |
|
;(t :foreground "gray" :background "#444444") |
|
(t :foreground "gray" :background "#666666") |
|
)) |
|
) |
|
|
|
;; wide characters setting |
|
#+(and win32 lem-ncurses) |
|
(progn |
|
;; initialize |
|
;; (this progn part is required to enable *features* modification) |
|
(defvar *conemu-font-is-ms-gothic* nil) |
|
(defvar *wide-char-disp-table* nil) |
|
(defvar *wide-char-cur-table* nil) |
|
(eval-when (:compile-toplevel :load-toplevel :execute) |
|
(when (find-package 'lem-base/string-width-utils) |
|
(pushnew :new-lem-string-lib *features*)))) |
|
#+(and win32 lem-ncurses) |
|
(progn |
|
;; Type A : for ConEmu and cmd.exe |
|
;; set wide characters table for display |
|
;; (EastAsianWidth A F W + Emoji + UTF-16 surrogate pair characters (code>=#x10000) |
|
;; are treated as wide characters) |
|
(defun set-wide-char-disp-table-A () |
|
(setf *wide-char-disp-table* |
|
(vector |
|
'(#x000a1 #x000a1) '(#x000a4 #x000a4) '(#x000a7 #x000a8) '(#x000aa #x000aa) |
|
'(#x000ad #x000ae) '(#x000b0 #x000b4) '(#x000b6 #x000ba) '(#x000bc #x000bf) |
|
'(#x000c6 #x000c6) '(#x000d0 #x000d0) '(#x000d7 #x000d8) '(#x000de #x000e1) |
|
'(#x000e6 #x000e6) '(#x000e8 #x000ea) '(#x000ec #x000ed) '(#x000f0 #x000f0) |
|
'(#x000f2 #x000f3) '(#x000f7 #x000fa) '(#x000fc #x000fc) '(#x000fe #x000fe) |
|
'(#x00101 #x00101) '(#x00111 #x00111) '(#x00113 #x00113) '(#x0011b #x0011b) |
|
'(#x00126 #x00127) '(#x0012b #x0012b) '(#x00131 #x00133) '(#x00138 #x00138) |
|
'(#x0013f #x00142) '(#x00144 #x00144) '(#x00148 #x0014b) '(#x0014d #x0014d) |
|
'(#x00152 #x00153) '(#x00166 #x00167) '(#x0016b #x0016b) '(#x001ce #x001ce) |
|
'(#x001d0 #x001d0) '(#x001d2 #x001d2) '(#x001d4 #x001d4) '(#x001d6 #x001d6) |
|
'(#x001d8 #x001d8) '(#x001da #x001da) '(#x001dc #x001dc) '(#x00251 #x00251) |
|
'(#x00261 #x00261) '(#x002c4 #x002c4) '(#x002c7 #x002c7) '(#x002c9 #x002cb) |
|
'(#x002cd #x002cd) '(#x002d0 #x002d0) '(#x002d8 #x002db) '(#x002dd #x002dd) |
|
'(#x002df #x002df) '(#x00300 #x0036f) '(#x00391 #x003a1) '(#x003a3 #x003a9) |
|
'(#x003b1 #x003c1) '(#x003c3 #x003c9) '(#x00401 #x00401) '(#x00410 #x0044f) |
|
'(#x00451 #x00451) '(#x01100 #x0115f) '(#x02010 #x02010) '(#x02013 #x02016) |
|
'(#x02018 #x02019) '(#x0201c #x0201d) '(#x02020 #x02022) '(#x02024 #x02027) |
|
'(#x02030 #x02030) '(#x02032 #x02033) '(#x02035 #x02035) '(#x0203b #x0203c) |
|
'(#x0203e #x0203e) '(#x02049 #x02049) '(#x02074 #x02074) '(#x0207f #x0207f) |
|
'(#x02081 #x02084) '(#x020ac #x020ac) '(#x02103 #x02103) '(#x02105 #x02105) |
|
'(#x02109 #x02109) '(#x02113 #x02113) '(#x02116 #x02116) '(#x02121 #x02122) |
|
'(#x02126 #x02126) '(#x0212b #x0212b) '(#x02139 #x02139) '(#x02153 #x02154) |
|
'(#x0215b #x0215e) '(#x02160 #x0216b) '(#x02170 #x02179) '(#x02189 #x02189) |
|
'(#x02190 #x02199) '(#x021a9 #x021aa) '(#x021b8 #x021b9) '(#x021d2 #x021d2) |
|
'(#x021d4 #x021d4) '(#x021e7 #x021e7) '(#x02200 #x02200) '(#x02202 #x02203) |
|
'(#x02207 #x02208) '(#x0220b #x0220b) '(#x0220f #x0220f) '(#x02211 #x02211) |
|
'(#x02215 #x02215) '(#x0221a #x0221a) '(#x0221d #x02220) '(#x02223 #x02223) |
|
'(#x02225 #x02225) '(#x02227 #x0222c) '(#x0222e #x0222e) '(#x02234 #x02237) |
|
'(#x0223c #x0223d) '(#x02248 #x02248) '(#x0224c #x0224c) '(#x02252 #x02252) |
|
'(#x02260 #x02261) '(#x02264 #x02267) '(#x0226a #x0226b) '(#x0226e #x0226f) |
|
'(#x02282 #x02283) '(#x02286 #x02287) '(#x02295 #x02295) '(#x02299 #x02299) |
|
'(#x022a5 #x022a5) '(#x022bf #x022bf) '(#x02312 #x02312) '(#x0231a #x0231b) |
|
'(#x02328 #x0232a) '(#x023cf #x023cf) '(#x023e9 #x023f3) '(#x023f8 #x023fa) |
|
'(#x02460 #x024e9) '(#x024eb #x0254b) '(#x02550 #x02573) '(#x02580 #x0258f) |
|
'(#x02592 #x02595) '(#x025a0 #x025a1) '(#x025a3 #x025ab) '(#x025b2 #x025b3) |
|
'(#x025b6 #x025b7) '(#x025bc #x025bd) '(#x025c0 #x025c1) '(#x025c6 #x025c8) |
|
'(#x025cb #x025cb) '(#x025ce #x025d1) '(#x025e2 #x025e5) '(#x025ef #x025ef) |
|
'(#x025fb #x025fe) '(#x02600 #x02606) '(#x02609 #x02609) '(#x0260e #x0260f) |
|
'(#x02611 #x02611) '(#x02614 #x02615) '(#x02618 #x02618) '(#x0261c #x0261e) |
|
'(#x02620 #x02620) '(#x02622 #x02623) '(#x02626 #x02626) '(#x0262a #x0262a) |
|
'(#x0262e #x0262f) '(#x02638 #x0263a) '(#x02640 #x02640) '(#x02642 #x02642) |
|
'(#x02648 #x02653) '(#x0265f #x02661) '(#x02663 #x0266a) '(#x0266c #x0266d) |
|
'(#x0266f #x0266f) '(#x0267b #x0267b) '(#x0267e #x0267f) '(#x02692 #x02697) |
|
'(#x02699 #x02699) '(#x0269b #x0269c) '(#x0269e #x026a1) '(#x026aa #x026ab) |
|
'(#x026b0 #x026b1) '(#x026bd #x026bf) '(#x026c4 #x026e1) '(#x026e3 #x026e3) |
|
'(#x026e8 #x026ff) '(#x02702 #x02702) '(#x02705 #x02705) '(#x02708 #x0270d) |
|
'(#x0270f #x0270f) '(#x02712 #x02712) '(#x02714 #x02714) '(#x02716 #x02716) |
|
'(#x0271d #x0271d) '(#x02721 #x02721) '(#x02728 #x02728) '(#x02733 #x02734) |
|
'(#x0273d #x0273d) '(#x02744 #x02744) '(#x02747 #x02747) '(#x0274c #x0274c) |
|
'(#x0274e #x0274e) '(#x02753 #x02755) '(#x02757 #x02757) '(#x02763 #x02764) |
|
'(#x02776 #x0277f) '(#x02795 #x02797) '(#x027a1 #x027a1) '(#x027b0 #x027b0) |
|
'(#x027bf #x027bf) '(#x02934 #x02935) '(#x02b05 #x02b07) '(#x02b1b #x02b1c) |
|
'(#x02b50 #x02b50) '(#x02b55 #x02b59) '(#x02e80 #x02e99) '(#x02e9b #x02ef3) |
|
'(#x02f00 #x02fd5) '(#x02ff0 #x02ffb) '(#x03000 #x0303e) '(#x03041 #x03096) |
|
'(#x03099 #x030ff) '(#x03105 #x0312f) '(#x03131 #x0318e) '(#x03190 #x031ba) |
|
'(#x031c0 #x031e3) '(#x031f0 #x0321e) '(#x03220 #x032fe) '(#x03300 #x04dbf) |
|
'(#x04e00 #x0a48c) '(#x0a490 #x0a4c6) '(#x0a960 #x0a97c) '(#x0ac00 #x0d7a3) |
|
'(#x0e000 #x0faff) '(#x0fe00 #x0fe19) '(#x0fe30 #x0fe52) '(#x0fe54 #x0fe66) |
|
'(#x0fe68 #x0fe6b) '(#x0ff01 #x0ff60) '(#x0ffe0 #x0ffe6) '(#x0fffd #x0fffd) |
|
'(#x10000 #xeffff)) |
|
)) |
|
;; Type A : for ConEmu |
|
;; set wide characters table for cursor movement |
|
;; (EastAsianWidth A F W + Emoji are treated as wide characters) |
|
(defun set-wide-char-cur-table-A () |
|
(setf *wide-char-cur-table* |
|
(vector |
|
'(#x000a1 #x000a1) '(#x000a4 #x000a4) '(#x000a7 #x000a8) '(#x000aa #x000aa) |
|
'(#x000ad #x000ae) '(#x000b0 #x000b4) '(#x000b6 #x000ba) '(#x000bc #x000bf) |
|
'(#x000c6 #x000c6) '(#x000d0 #x000d0) '(#x000d7 #x000d8) '(#x000de #x000e1) |
|
'(#x000e6 #x000e6) '(#x000e8 #x000ea) '(#x000ec #x000ed) '(#x000f0 #x000f0) |
|
'(#x000f2 #x000f3) '(#x000f7 #x000fa) '(#x000fc #x000fc) '(#x000fe #x000fe) |
|
'(#x00101 #x00101) '(#x00111 #x00111) '(#x00113 #x00113) '(#x0011b #x0011b) |
|
'(#x00126 #x00127) '(#x0012b #x0012b) '(#x00131 #x00133) '(#x00138 #x00138) |
|
'(#x0013f #x00142) '(#x00144 #x00144) '(#x00148 #x0014b) '(#x0014d #x0014d) |
|
'(#x00152 #x00153) '(#x00166 #x00167) '(#x0016b #x0016b) '(#x001ce #x001ce) |
|
'(#x001d0 #x001d0) '(#x001d2 #x001d2) '(#x001d4 #x001d4) '(#x001d6 #x001d6) |
|
'(#x001d8 #x001d8) '(#x001da #x001da) '(#x001dc #x001dc) '(#x00251 #x00251) |
|
'(#x00261 #x00261) '(#x002c4 #x002c4) '(#x002c7 #x002c7) '(#x002c9 #x002cb) |
|
'(#x002cd #x002cd) '(#x002d0 #x002d0) '(#x002d8 #x002db) '(#x002dd #x002dd) |
|
'(#x002df #x002df) '(#x00300 #x0036f) '(#x00391 #x003a1) '(#x003a3 #x003a9) |
|
'(#x003b1 #x003c1) '(#x003c3 #x003c9) '(#x00401 #x00401) '(#x00410 #x0044f) |
|
'(#x00451 #x00451) '(#x01100 #x0115f) '(#x02010 #x02010) '(#x02013 #x02016) |
|
'(#x02018 #x02019) '(#x0201c #x0201d) '(#x02020 #x02022) '(#x02024 #x02027) |
|
'(#x02030 #x02030) '(#x02032 #x02033) '(#x02035 #x02035) '(#x0203b #x0203c) |
|
'(#x0203e #x0203e) '(#x02049 #x02049) '(#x02074 #x02074) '(#x0207f #x0207f) |
|
'(#x02081 #x02084) '(#x020ac #x020ac) '(#x02103 #x02103) '(#x02105 #x02105) |
|
'(#x02109 #x02109) '(#x02113 #x02113) '(#x02116 #x02116) '(#x02121 #x02122) |
|
'(#x02126 #x02126) '(#x0212b #x0212b) '(#x02139 #x02139) '(#x02153 #x02154) |
|
'(#x0215b #x0215e) '(#x02160 #x0216b) '(#x02170 #x02179) '(#x02189 #x02189) |
|
'(#x02190 #x02199) '(#x021a9 #x021aa) '(#x021b8 #x021b9) '(#x021d2 #x021d2) |
|
'(#x021d4 #x021d4) '(#x021e7 #x021e7) '(#x02200 #x02200) '(#x02202 #x02203) |
|
'(#x02207 #x02208) '(#x0220b #x0220b) '(#x0220f #x0220f) '(#x02211 #x02211) |
|
'(#x02215 #x02215) '(#x0221a #x0221a) '(#x0221d #x02220) '(#x02223 #x02223) |
|
'(#x02225 #x02225) '(#x02227 #x0222c) '(#x0222e #x0222e) '(#x02234 #x02237) |
|
'(#x0223c #x0223d) '(#x02248 #x02248) '(#x0224c #x0224c) '(#x02252 #x02252) |
|
'(#x02260 #x02261) '(#x02264 #x02267) '(#x0226a #x0226b) '(#x0226e #x0226f) |
|
'(#x02282 #x02283) '(#x02286 #x02287) '(#x02295 #x02295) '(#x02299 #x02299) |
|
'(#x022a5 #x022a5) '(#x022bf #x022bf) '(#x02312 #x02312) '(#x0231a #x0231b) |
|
'(#x02328 #x0232a) '(#x023cf #x023cf) '(#x023e9 #x023f3) '(#x023f8 #x023fa) |
|
'(#x02460 #x024e9) '(#x024eb #x0254b) '(#x02550 #x02573) '(#x02580 #x0258f) |
|
'(#x02592 #x02595) '(#x025a0 #x025a1) '(#x025a3 #x025ab) '(#x025b2 #x025b3) |
|
'(#x025b6 #x025b7) '(#x025bc #x025bd) '(#x025c0 #x025c1) '(#x025c6 #x025c8) |
|
'(#x025cb #x025cb) '(#x025ce #x025d1) '(#x025e2 #x025e5) '(#x025ef #x025ef) |
|
'(#x025fb #x025fe) '(#x02600 #x02606) '(#x02609 #x02609) '(#x0260e #x0260f) |
|
'(#x02611 #x02611) '(#x02614 #x02615) '(#x02618 #x02618) '(#x0261c #x0261e) |
|
'(#x02620 #x02620) '(#x02622 #x02623) '(#x02626 #x02626) '(#x0262a #x0262a) |
|
'(#x0262e #x0262f) '(#x02638 #x0263a) '(#x02640 #x02640) '(#x02642 #x02642) |
|
'(#x02648 #x02653) '(#x0265f #x02661) '(#x02663 #x0266a) '(#x0266c #x0266d) |
|
'(#x0266f #x0266f) '(#x0267b #x0267b) '(#x0267e #x0267f) '(#x02692 #x02697) |
|
'(#x02699 #x02699) '(#x0269b #x0269c) '(#x0269e #x026a1) '(#x026aa #x026ab) |
|
'(#x026b0 #x026b1) '(#x026bd #x026bf) '(#x026c4 #x026e1) '(#x026e3 #x026e3) |
|
'(#x026e8 #x026ff) '(#x02702 #x02702) '(#x02705 #x02705) '(#x02708 #x0270d) |
|
'(#x0270f #x0270f) '(#x02712 #x02712) '(#x02714 #x02714) '(#x02716 #x02716) |
|
'(#x0271d #x0271d) '(#x02721 #x02721) '(#x02728 #x02728) '(#x02733 #x02734) |
|
'(#x0273d #x0273d) '(#x02744 #x02744) '(#x02747 #x02747) '(#x0274c #x0274c) |
|
'(#x0274e #x0274e) '(#x02753 #x02755) '(#x02757 #x02757) '(#x02763 #x02764) |
|
'(#x02776 #x0277f) '(#x02795 #x02797) '(#x027a1 #x027a1) '(#x027b0 #x027b0) |
|
'(#x027bf #x027bf) '(#x02934 #x02935) '(#x02b05 #x02b07) '(#x02b1b #x02b1c) |
|
'(#x02b50 #x02b50) '(#x02b55 #x02b59) '(#x02e80 #x02e99) '(#x02e9b #x02ef3) |
|
'(#x02f00 #x02fd5) '(#x02ff0 #x02ffb) '(#x03000 #x0303e) '(#x03041 #x03096) |
|
'(#x03099 #x030ff) '(#x03105 #x0312f) '(#x03131 #x0318e) '(#x03190 #x031ba) |
|
'(#x031c0 #x031e3) '(#x031f0 #x0321e) '(#x03220 #x032fe) '(#x03300 #x04dbf) |
|
'(#x04e00 #x0a48c) '(#x0a490 #x0a4c6) '(#x0a960 #x0a97c) '(#x0ac00 #x0d7a3) |
|
'(#x0e000 #x0faff) '(#x0fe00 #x0fe19) '(#x0fe30 #x0fe52) '(#x0fe54 #x0fe66) |
|
'(#x0fe68 #x0fe6b) '(#x0ff01 #x0ff60) '(#x0ffe0 #x0ffe6) '(#x0fffd #x0fffd) |
|
'(#x16fe0 #x16fe1) '(#x17000 #x187f1) '(#x18800 #x18af2) '(#x1b000 #x1b11e) |
|
'(#x1b170 #x1b2fb) '(#x1f004 #x1f004) '(#x1f0cf #x1f0cf) '(#x1f100 #x1f10a) |
|
'(#x1f110 #x1f12d) '(#x1f130 #x1f169) '(#x1f170 #x1f1ac) '(#x1f1e6 #x1f202) |
|
'(#x1f210 #x1f23b) '(#x1f240 #x1f248) '(#x1f250 #x1f251) '(#x1f260 #x1f265) |
|
'(#x1f300 #x1f321) '(#x1f324 #x1f393) '(#x1f396 #x1f397) '(#x1f399 #x1f39b) |
|
'(#x1f39e #x1f3f0) '(#x1f3f3 #x1f3f5) '(#x1f3f7 #x1f4fd) '(#x1f4ff #x1f53d) |
|
'(#x1f549 #x1f54e) '(#x1f550 #x1f567) '(#x1f56f #x1f570) '(#x1f573 #x1f57a) |
|
'(#x1f587 #x1f587) '(#x1f58a #x1f58d) '(#x1f590 #x1f590) '(#x1f595 #x1f596) |
|
'(#x1f5a4 #x1f5a5) '(#x1f5a8 #x1f5a8) '(#x1f5b1 #x1f5b2) '(#x1f5bc #x1f5bc) |
|
'(#x1f5c2 #x1f5c4) '(#x1f5d1 #x1f5d3) '(#x1f5dc #x1f5de) '(#x1f5e1 #x1f5e1) |
|
'(#x1f5e3 #x1f5e3) '(#x1f5e8 #x1f5e8) '(#x1f5ef #x1f5ef) '(#x1f5f3 #x1f5f3) |
|
'(#x1f5fa #x1f64f) '(#x1f680 #x1f6c5) '(#x1f6cb #x1f6d2) '(#x1f6e0 #x1f6e5) |
|
'(#x1f6e9 #x1f6e9) '(#x1f6eb #x1f6ec) '(#x1f6f0 #x1f6f0) '(#x1f6f3 #x1f6f9) |
|
'(#x1f910 #x1f93e) '(#x1f940 #x1f970) '(#x1f973 #x1f976) '(#x1f97a #x1f97a) |
|
'(#x1f97c #x1f9a2) '(#x1f9b0 #x1f9b9) '(#x1f9c0 #x1f9c2) '(#x1f9d0 #x1f9ff) |
|
'(#x20000 #x2fffd) '(#x30000 #x3fffd) '(#xe0100 #xe01ef)) |
|
)) |
|
|
|
;; Type B : for mintty |
|
;; set wide characters table for display |
|
;; (EastAsianWidth F W + UTF-16 surrogate pair characters (code>=#x10000) |
|
;; are treated as wide characters) |
|
(defun set-wide-char-disp-table-B () |
|
(setf *wide-char-disp-table* |
|
(vector |
|
'(#x01100 #x0115f) '(#x0231a #x0231b) '(#x02329 #x0232a) '(#x023e9 #x023ec) |
|
'(#x023f0 #x023f0) '(#x023f3 #x023f3) '(#x025fd #x025fe) '(#x02614 #x02615) |
|
'(#x02648 #x02653) '(#x0267f #x0267f) '(#x02693 #x02693) '(#x026a1 #x026a1) |
|
'(#x026aa #x026ab) '(#x026bd #x026be) '(#x026c4 #x026c5) '(#x026ce #x026ce) |
|
'(#x026d4 #x026d4) '(#x026ea #x026ea) '(#x026f2 #x026f3) '(#x026f5 #x026f5) |
|
'(#x026fa #x026fa) '(#x026fd #x026fd) '(#x02705 #x02705) '(#x0270a #x0270b) |
|
'(#x02728 #x02728) '(#x0274c #x0274c) '(#x0274e #x0274e) '(#x02753 #x02755) |
|
'(#x02757 #x02757) '(#x02795 #x02797) '(#x027b0 #x027b0) '(#x027bf #x027bf) |
|
'(#x02b1b #x02b1c) '(#x02b50 #x02b50) '(#x02b55 #x02b55) '(#x02e80 #x02e99) |
|
'(#x02e9b #x02ef3) '(#x02f00 #x02fd5) '(#x02ff0 #x02ffb) '(#x03000 #x0303e) |
|
'(#x03041 #x03096) '(#x03099 #x030ff) '(#x03105 #x0312f) '(#x03131 #x0318e) |
|
'(#x03190 #x031ba) '(#x031c0 #x031e3) '(#x031f0 #x0321e) '(#x03220 #x03247) |
|
'(#x03250 #x032fe) '(#x03300 #x04dbf) '(#x04e00 #x0a48c) '(#x0a490 #x0a4c6) |
|
'(#x0a960 #x0a97c) '(#x0ac00 #x0d7a3) '(#x0f900 #x0faff) '(#x0fe10 #x0fe19) |
|
'(#x0fe30 #x0fe52) '(#x0fe54 #x0fe66) '(#x0fe68 #x0fe6b) '(#x0ff01 #x0ff60) |
|
'(#x0ffe0 #x0ffe6) '(#x10000 #xeffff)) |
|
)) |
|
;; Type B : for mintty |
|
;; set wide characters table for cursor movement |
|
;; (EastAsianWidth F W are treated as wide characters) |
|
(defun set-wide-char-cur-table-B () |
|
(setf *wide-char-cur-table* |
|
(vector |
|
'(#x01100 #x0115f) '(#x0231a #x0231b) '(#x02329 #x0232a) '(#x023e9 #x023ec) |
|
'(#x023f0 #x023f0) '(#x023f3 #x023f3) '(#x025fd #x025fe) '(#x02614 #x02615) |
|
'(#x02648 #x02653) '(#x0267f #x0267f) '(#x02693 #x02693) '(#x026a1 #x026a1) |
|
'(#x026aa #x026ab) '(#x026bd #x026be) '(#x026c4 #x026c5) '(#x026ce #x026ce) |
|
'(#x026d4 #x026d4) '(#x026ea #x026ea) '(#x026f2 #x026f3) '(#x026f5 #x026f5) |
|
'(#x026fa #x026fa) '(#x026fd #x026fd) '(#x02705 #x02705) '(#x0270a #x0270b) |
|
'(#x02728 #x02728) '(#x0274c #x0274c) '(#x0274e #x0274e) '(#x02753 #x02755) |
|
'(#x02757 #x02757) '(#x02795 #x02797) '(#x027b0 #x027b0) '(#x027bf #x027bf) |
|
'(#x02b1b #x02b1c) '(#x02b50 #x02b50) '(#x02b55 #x02b55) '(#x02e80 #x02e99) |
|
'(#x02e9b #x02ef3) '(#x02f00 #x02fd5) '(#x02ff0 #x02ffb) '(#x03000 #x0303e) |
|
'(#x03041 #x03096) '(#x03099 #x030ff) '(#x03105 #x0312f) '(#x03131 #x0318e) |
|
'(#x03190 #x031ba) '(#x031c0 #x031e3) '(#x031f0 #x0321e) '(#x03220 #x03247) |
|
'(#x03250 #x032fe) '(#x03300 #x04dbf) '(#x04e00 #x0a48c) '(#x0a490 #x0a4c6) |
|
'(#x0a960 #x0a97c) '(#x0ac00 #x0d7a3) '(#x0f900 #x0faff) '(#x0fe10 #x0fe19) |
|
'(#x0fe30 #x0fe52) '(#x0fe54 #x0fe66) '(#x0fe68 #x0fe6b) '(#x0ff01 #x0ff60) |
|
'(#x0ffe0 #x0ffe6) '(#x16fe0 #x16fe1) '(#x17000 #x187f1) '(#x18800 #x18af2) |
|
'(#x1b000 #x1b11e) '(#x1b170 #x1b2fb) '(#x1f004 #x1f004) '(#x1f0cf #x1f0cf) |
|
'(#x1f18e #x1f18e) '(#x1f191 #x1f19a) '(#x1f200 #x1f202) '(#x1f210 #x1f23b) |
|
'(#x1f240 #x1f248) '(#x1f250 #x1f251) '(#x1f260 #x1f265) '(#x1f300 #x1f320) |
|
'(#x1f32d #x1f335) '(#x1f337 #x1f37c) '(#x1f37e #x1f393) '(#x1f3a0 #x1f3ca) |
|
'(#x1f3cf #x1f3d3) '(#x1f3e0 #x1f3f0) '(#x1f3f4 #x1f3f4) '(#x1f3f8 #x1f43e) |
|
'(#x1f440 #x1f440) '(#x1f442 #x1f4fc) '(#x1f4ff #x1f53d) '(#x1f54b #x1f54e) |
|
'(#x1f550 #x1f567) '(#x1f57a #x1f57a) '(#x1f595 #x1f596) '(#x1f5a4 #x1f5a4) |
|
'(#x1f5fb #x1f64f) '(#x1f680 #x1f6c5) '(#x1f6cc #x1f6cc) '(#x1f6d0 #x1f6d2) |
|
'(#x1f6eb #x1f6ec) '(#x1f6f4 #x1f6f9) '(#x1f910 #x1f93e) '(#x1f940 #x1f970) |
|
'(#x1f973 #x1f976) '(#x1f97a #x1f97a) '(#x1f97c #x1f9a2) '(#x1f9b0 #x1f9b9) |
|
'(#x1f9c0 #x1f9c2) '(#x1f9d0 #x1f9ff) '(#x20000 #x2fffd) '(#x30000 #x3fffd)) |
|
)) |
|
|
|
;; Type C : for Windows Terminal (windows 10) |
|
;; set wide characters table for display |
|
;; (EastAsianWidth F W + Emoji + UTF-16 surrogate pair characters (code>=#x10000) |
|
;; are treated as wide characters) |
|
(defun set-wide-char-disp-table-C () |
|
(setf *wide-char-disp-table* |
|
(vector |
|
'(#x01100 #x0115f) '(#x0203c #x0203c) '(#x02049 #x02049) '(#x02122 #x02122) |
|
'(#x02139 #x02139) '(#x02194 #x02199) '(#x021a9 #x021aa) '(#x0231a #x0231b) |
|
'(#x02328 #x0232a) '(#x023cf #x023cf) '(#x023e9 #x023f3) '(#x023f8 #x023fa) |
|
'(#x024c2 #x024c2) '(#x025aa #x025ab) '(#x025b6 #x025b6) '(#x025c0 #x025c0) |
|
'(#x025fb #x025fe) '(#x02600 #x02604) '(#x0260e #x0260e) '(#x02611 #x02611) |
|
'(#x02614 #x02615) '(#x02618 #x02618) '(#x0261d #x0261d) '(#x02620 #x02620) |
|
'(#x02622 #x02623) '(#x02626 #x02626) '(#x0262a #x0262a) '(#x0262e #x0262f) |
|
'(#x02638 #x0263a) '(#x02640 #x02640) '(#x02642 #x02642) '(#x02648 #x02653) |
|
'(#x0265f #x02660) '(#x02663 #x02663) '(#x02665 #x02666) '(#x02668 #x02668) |
|
'(#x0267b #x0267b) '(#x0267e #x0267f) '(#x02692 #x02697) '(#x02699 #x02699) |
|
'(#x0269b #x0269c) '(#x026a0 #x026a1) '(#x026a7 #x026a7) '(#x026aa #x026ab) |
|
'(#x026b0 #x026b1) '(#x026bd #x026be) '(#x026c4 #x026c5) '(#x026c8 #x026c8) |
|
'(#x026ce #x026cf) '(#x026d1 #x026d1) '(#x026d3 #x026d4) '(#x026e9 #x026ea) |
|
'(#x026f0 #x026f5) '(#x026f7 #x026fa) '(#x026fd #x026fd) '(#x02702 #x02702) |
|
'(#x02705 #x02705) '(#x02708 #x0270d) '(#x0270f #x0270f) '(#x02712 #x02712) |
|
'(#x02714 #x02714) '(#x02716 #x02716) '(#x0271d #x0271d) '(#x02721 #x02721) |
|
'(#x02728 #x02728) '(#x02733 #x02734) '(#x02744 #x02744) '(#x02747 #x02747) |
|
'(#x0274c #x0274c) '(#x0274e #x0274e) '(#x02753 #x02755) '(#x02757 #x02757) |
|
'(#x02763 #x02764) '(#x02795 #x02797) '(#x027a1 #x027a1) '(#x027b0 #x027b0) |
|
'(#x027bf #x027bf) '(#x02934 #x02935) '(#x02b05 #x02b07) '(#x02b1b #x02b1c) |
|
'(#x02b50 #x02b50) '(#x02b55 #x02b55) '(#x02e80 #x02e99) '(#x02e9b #x02ef3) |
|
'(#x02f00 #x02fd5) '(#x02ff0 #x02ffb) '(#x03000 #x0303e) '(#x03041 #x03096) |
|
'(#x03099 #x030ff) '(#x03105 #x0312f) '(#x03131 #x0318e) '(#x03190 #x031e3) |
|
'(#x031f0 #x0321e) '(#x03220 #x03247) '(#x03250 #x04dbf) '(#x04e00 #x0a48c) |
|
'(#x0a490 #x0a4c6) '(#x0a960 #x0a97c) '(#x0ac00 #x0d7a3) '(#x0f900 #x0faff) |
|
'(#x0fe10 #x0fe19) '(#x0fe30 #x0fe52) '(#x0fe54 #x0fe66) '(#x0fe68 #x0fe6b) |
|
'(#x0ff01 #x0ff60) '(#x0ffe0 #x0ffe6) '(#x10000 #xeffff)) |
|
)) |
|
;; Type C : for Windows Terminal (windows 10) |
|
;; set wide characters table for cursor movement |
|
;; (EastAsianWidth F W + Emoji are treated as wide characters) |
|
(defun set-wide-char-cur-table-C () |
|
(setf *wide-char-cur-table* |
|
(vector |
|
'(#x01100 #x0115f) '(#x0203c #x0203c) '(#x02049 #x02049) '(#x02122 #x02122) |
|
'(#x02139 #x02139) '(#x02194 #x02199) '(#x021a9 #x021aa) '(#x0231a #x0231b) |
|
'(#x02328 #x0232a) '(#x023cf #x023cf) '(#x023e9 #x023f3) '(#x023f8 #x023fa) |
|
'(#x024c2 #x024c2) '(#x025aa #x025ab) '(#x025b6 #x025b6) '(#x025c0 #x025c0) |
|
'(#x025fb #x025fe) '(#x02600 #x02604) '(#x0260e #x0260e) '(#x02611 #x02611) |
|
'(#x02614 #x02615) '(#x02618 #x02618) '(#x0261d #x0261d) '(#x02620 #x02620) |
|
'(#x02622 #x02623) '(#x02626 #x02626) '(#x0262a #x0262a) '(#x0262e #x0262f) |
|
'(#x02638 #x0263a) '(#x02640 #x02640) '(#x02642 #x02642) '(#x02648 #x02653) |
|
'(#x0265f #x02660) '(#x02663 #x02663) '(#x02665 #x02666) '(#x02668 #x02668) |
|
'(#x0267b #x0267b) '(#x0267e #x0267f) '(#x02692 #x02697) '(#x02699 #x02699) |
|
'(#x0269b #x0269c) '(#x026a0 #x026a1) '(#x026a7 #x026a7) '(#x026aa #x026ab) |
|
'(#x026b0 #x026b1) '(#x026bd #x026be) '(#x026c4 #x026c5) '(#x026c8 #x026c8) |
|
'(#x026ce #x026cf) '(#x026d1 #x026d1) '(#x026d3 #x026d4) '(#x026e9 #x026ea) |
|
'(#x026f0 #x026f5) '(#x026f7 #x026fa) '(#x026fd #x026fd) '(#x02702 #x02702) |
|
'(#x02705 #x02705) '(#x02708 #x0270d) '(#x0270f #x0270f) '(#x02712 #x02712) |
|
'(#x02714 #x02714) '(#x02716 #x02716) '(#x0271d #x0271d) '(#x02721 #x02721) |
|
'(#x02728 #x02728) '(#x02733 #x02734) '(#x02744 #x02744) '(#x02747 #x02747) |
|
'(#x0274c #x0274c) '(#x0274e #x0274e) '(#x02753 #x02755) '(#x02757 #x02757) |
|
'(#x02763 #x02764) '(#x02795 #x02797) '(#x027a1 #x027a1) '(#x027b0 #x027b0) |
|
'(#x027bf #x027bf) '(#x02934 #x02935) '(#x02b05 #x02b07) '(#x02b1b #x02b1c) |
|
'(#x02b50 #x02b50) '(#x02b55 #x02b55) '(#x02e80 #x02e99) '(#x02e9b #x02ef3) |
|
'(#x02f00 #x02fd5) '(#x02ff0 #x02ffb) '(#x03000 #x0303e) '(#x03041 #x03096) |
|
'(#x03099 #x030ff) '(#x03105 #x0312f) '(#x03131 #x0318e) '(#x03190 #x031e3) |
|
'(#x031f0 #x0321e) '(#x03220 #x03247) '(#x03250 #x04dbf) '(#x04e00 #x0a48c) |
|
'(#x0a490 #x0a4c6) '(#x0a960 #x0a97c) '(#x0ac00 #x0d7a3) '(#x0f900 #x0faff) |
|
'(#x0fe10 #x0fe19) '(#x0fe30 #x0fe52) '(#x0fe54 #x0fe66) '(#x0fe68 #x0fe6b) |
|
'(#x0ff01 #x0ff60) '(#x0ffe0 #x0ffe6) '(#x16fe0 #x16fe4) '(#x16ff0 #x16ff1) |
|
'(#x17000 #x187f7) '(#x18800 #x18cd5) '(#x18d00 #x18d08) '(#x1b000 #x1b11e) |
|
'(#x1b150 #x1b152) '(#x1b164 #x1b167) '(#x1b170 #x1b2fb) '(#x1f004 #x1f004) |
|
'(#x1f0cf #x1f0cf) '(#x1f170 #x1f171) '(#x1f17e #x1f17f) '(#x1f18e #x1f18e) |
|
'(#x1f191 #x1f19a) '(#x1f1e6 #x1f202) '(#x1f210 #x1f23b) '(#x1f240 #x1f248) |
|
'(#x1f250 #x1f251) '(#x1f260 #x1f265) '(#x1f300 #x1f321) '(#x1f324 #x1f393) |
|
'(#x1f396 #x1f397) '(#x1f399 #x1f39b) '(#x1f39e #x1f3f0) '(#x1f3f3 #x1f3f5) |
|
'(#x1f3f7 #x1f4fd) '(#x1f4ff #x1f53d) '(#x1f549 #x1f54e) '(#x1f550 #x1f567) |
|
'(#x1f56f #x1f570) '(#x1f573 #x1f57a) '(#x1f587 #x1f587) '(#x1f58a #x1f58d) |
|
'(#x1f590 #x1f590) '(#x1f595 #x1f596) '(#x1f5a4 #x1f5a5) '(#x1f5a8 #x1f5a8) |
|
'(#x1f5b1 #x1f5b2) '(#x1f5bc #x1f5bc) '(#x1f5c2 #x1f5c4) '(#x1f5d1 #x1f5d3) |
|
'(#x1f5dc #x1f5de) '(#x1f5e1 #x1f5e1) '(#x1f5e3 #x1f5e3) '(#x1f5e8 #x1f5e8) |
|
'(#x1f5ef #x1f5ef) '(#x1f5f3 #x1f5f3) '(#x1f5fa #x1f64f) '(#x1f680 #x1f6c5) |
|
'(#x1f6cb #x1f6d2) '(#x1f6d5 #x1f6d7) '(#x1f6e0 #x1f6e5) '(#x1f6e9 #x1f6e9) |
|
'(#x1f6eb #x1f6ec) '(#x1f6f0 #x1f6f0) '(#x1f6f3 #x1f6fc) '(#x1f7e0 #x1f7eb) |
|
'(#x1f90c #x1f93a) '(#x1f93c #x1f945) '(#x1f947 #x1f978) '(#x1f97a #x1f9cb) |
|
'(#x1f9cd #x1f9ff) '(#x1fa70 #x1fa74) '(#x1fa78 #x1fa7a) '(#x1fa80 #x1fa86) |
|
'(#x1fa90 #x1faa8) '(#x1fab0 #x1fab6) '(#x1fac0 #x1fac2) '(#x1fad0 #x1fad6) |
|
'(#x20000 #x2fffd) '(#x30000 #x3fffd)) |
|
)) |
|
|
|
;; set wide characters table |
|
(cond |
|
;; for windows 10 (pdcurses-win10-jp is required) |
|
((and (boundp 'lem-ncurses::*pdcurses-win10-jp*) |
|
lem-ncurses::*pdcurses-win10-jp*) |
|
(case (lem-ncurses::windows-term-type) |
|
(:mintty |
|
(set-wide-char-disp-table-A) |
|
(set-wide-char-cur-table-A)) |
|
(:conemu |
|
(set-wide-char-disp-table-A) |
|
;(set-wide-char-cur-table-A) |
|
) |
|
(:winterm |
|
(set-wide-char-disp-table-C) |
|
(set-wide-char-cur-table-C)) |
|
(t |
|
(set-wide-char-disp-table-A) |
|
(set-wide-char-cur-table-A)))) |
|
;; for windows 8.1 or earlier |
|
(t |
|
(case (lem-ncurses::windows-term-type) |
|
(:mintty |
|
(set-wide-char-disp-table-B) |
|
(set-wide-char-cur-table-B)) |
|
(:conemu |
|
(cond |
|
(*conemu-font-is-ms-gothic* |
|
(set-wide-char-disp-table-A) |
|
(set-wide-char-cur-table-A)) |
|
(t |
|
(set-wide-char-disp-table-B) |
|
(set-wide-char-cur-table-B)))) |
|
(t |
|
(set-wide-char-disp-table-A) |
|
;(set-wide-char-cur-table-A) |
|
)))) |
|
|
|
;; set wide characters function |
|
(progn |
|
;; set wide characters function for display |
|
(when *wide-char-disp-table* |
|
;; remake binary search function |
|
(#+sbcl sb-ext:without-package-locks #-sbcl progn |
|
(handler-bind (#+sbcl(sb-kernel:redefinition-warning #'muffle-warning)) |
|
#-new-lem-string-lib |
|
(lem-base::gen-binary-search-function 'lem-base::%binary-search |
|
*wide-char-disp-table*) |
|
#+new-lem-string-lib |
|
(lem-base/string-width-utils::gen-binary-search-function |
|
'lem-base/string-width-utils::%binary-search |
|
*wide-char-disp-table*) |
|
))) |
|
;; set wide characters function for cursor movement |
|
(when *wide-char-cur-table* |
|
;; make binary search function |
|
(progn |
|
#-new-lem-string-lib |
|
(lem-base::gen-binary-search-function 'wide-char-cursor-p |
|
*wide-char-cur-table*) |
|
#+new-lem-string-lib |
|
(lem-base/string-width-utils::gen-binary-search-function |
|
'wide-char-cursor-p |
|
*wide-char-cur-table*) |
|
) |
|
;; set custom function to lem |
|
(setf (lem-ncurses::windows-term-setting-cur-char-width |
|
lem-ncurses::*windows-term-setting*) |
|
(lambda (code) |
|
;; check zero-width-space character (#\u200b) |
|
(if (= code #x200b) |
|
0 |
|
(if (wide-char-cursor-p code) 2 1)))))) |
|
) |
|
|