そうか、xyzzy.ini があったか
これで色の設定がとれますね。
(require "foreign") (require "wip/winapi") (c:define-dll-entry winapi:DWORD GetPrivateProfileString (winapi:LPCSTR winapi:LPCSTR winapi:LPCSTR winapi:LPSTR winapi:DWORD winapi:LPCSTR) "kernel32" "GetPrivateProfileStringA") (defun read-ini-file (ini-f sect key default) (let ((csize 256)) (let ((ini-f* (si:make-string-chunk ini-f)) (sect* (si:make-string-chunk sect)) (key* (si:make-string-chunk key)) (default* (si:make-string-chunk default)) (ret-v* (si:make-chunk nil csize))) (let ((ret-api-v (GetPrivateProfileString sect* key* default* ret-v* csize ini-f*))) (si:unpack-string ret-v* 0 ret-api-v))))) (defun get-user-config-file-path () (let ((ini-f (si:getenv "XYZZYINIFILE")) (ini-f-def (merge-pathnames "xyzzy.ini" (user-config-path)))) (if (not ini-f) ini-f-def (if (not (file-exist-p ini-f)) (if (pathname-device ini-f) ini-f-def (progn (setq ini-f (merge-pathnames ini-f (user-config-path))) (if (file-exist-p ini-f) ini-f ini-f-def))) ini-f) ))) (defun test-read-user-config () (let ((ini-f (get-user-config-file-path))) (read-ini-file ini-f "Colors" "kwdColor1" "")))
実行結果:
(test-read-user-config)
=>"#ff0000"
| 固定リンク

コメント