|
8 | 8 | (in-package :lem-skk-mode/dictionary) |
9 | 9 |
|
10 | 10 | (defvar *skk-dictionary-paths* |
11 | | - '("/usr/share/skk/SKK-JISYO.L" |
| 11 | + '("~/.skk/SKK-JISYO.L" |
| 12 | + "/usr/share/skk/SKK-JISYO.L" |
12 | 13 | "/usr/share/skk/SKK-JISYO.M" |
13 | 14 | "/usr/local/share/skk/SKK-JISYO.L" |
14 | | - "/usr/local/share/skk/SKK-JISYO.M" |
15 | | - "~/.skk/SKK-JISYO.L") |
16 | | - "List of paths to search for SKK dictionary files.") |
| 15 | + "/usr/local/share/skk/SKK-JISYO.M") |
| 16 | + "List of paths to search for SKK dictionary files. |
| 17 | +User dictionary (~/.skk/SKK-JISYO.L) is searched first.") |
17 | 18 |
|
18 | 19 | (defvar *skk-user-dictionary-path* |
19 | 20 | "~/.skk/user-jisyo" |
@@ -103,13 +104,19 @@ SKK-JISYO format: reading /candidate1/candidate2;annotation/.../" |
103 | 104 | (clrhash *skk-dictionary*) |
104 | 105 | (setf *skk-dictionary* (make-hash-table :test 'equal))) |
105 | 106 | ;; Load main dictionary |
106 | | - (let ((dict-path (find-dictionary-file))) |
| 107 | + (let ((dict-path (find-dictionary-file)) |
| 108 | + (loaded nil)) |
107 | 109 | (when dict-path |
108 | | - (load-dictionary-file dict-path *skk-dictionary*))) |
109 | | - ;; Load user dictionary (higher priority - loaded after main) |
110 | | - (let ((user-path (expand-path *skk-user-dictionary-path*))) |
111 | | - (load-dictionary-file user-path *skk-dictionary*)) |
112 | | - (setf *dictionary-loaded-p* t))) |
| 110 | + (setf loaded (load-dictionary-file dict-path *skk-dictionary*))) |
| 111 | + ;; Load user dictionary (higher priority - loaded after main) |
| 112 | + (let ((user-path (expand-path *skk-user-dictionary-path*))) |
| 113 | + (when (load-dictionary-file user-path *skk-dictionary*) |
| 114 | + (setf loaded t))) |
| 115 | + ;; Only mark as loaded if at least one dictionary was found |
| 116 | + (setf *dictionary-loaded-p* loaded) |
| 117 | + (unless loaded |
| 118 | + (warn "SKK: No dictionary found. Searched paths: ~{~A~^, ~}" |
| 119 | + *skk-dictionary-paths*))))) |
113 | 120 |
|
114 | 121 | (defun lookup-candidates (reading) |
115 | 122 | "Look up conversion candidates for READING. |
|
0 commit comments