| 228 |
"" |
"" |
| 229 |
(concat "^\\(" |
(concat "^\\(" |
| 230 |
(cond |
(cond |
| 231 |
((string-match "\\cj$" string) |
((string-match "\\Ca$" string) |
| 232 |
string) |
string) |
| 233 |
((and (string-match "\\Cj+$" string) |
((and (string-match "\\ca+$" string) |
| 234 |
(< 0 (match-beginning 0))) |
(< 0 (match-beginning 0))) |
| 235 |
(concat (substring string 0 (match-beginning 0)) |
(concat (substring string 0 (match-beginning 0)) |
| 236 |
"\\(" |
"\\(" |
| 267 |
candidate))) |
candidate))) |
| 268 |
(t |
(t |
| 269 |
(if (null (delete nil (mapcar (lambda (candidate) |
(if (null (delete nil (mapcar (lambda (candidate) |
| 270 |
(string-match "\\cj" candidate)) |
(string-match "\\Ca" candidate)) |
| 271 |
candidates))) |
candidates))) |
| 272 |
;; 全ての候補が日本語を含んでいない場合、通常通り |
;; 全ての候補が日本語を含んでいない場合、通常通り |
| 273 |
;; `try-completion' を呼んでまかせる。 |
;; `try-completion' を呼んでまかせる。 |
| 422 |
(setq files (directory-files dir nil nil 'nosort)) |
(setq files (directory-files dir nil nil 'nosort)) |
| 423 |
(setq kogiku-minibuffer-prompt-advocate-files |
(setq kogiku-minibuffer-prompt-advocate-files |
| 424 |
(cons (cons dir files) kogiku-minibuffer-prompt-advocate-files))) |
(cons (cons dir files) kogiku-minibuffer-prompt-advocate-files))) |
| 425 |
(if (or (and (string= file "") (setq fileregex "^\\cj")) |
(if (or (and (string= file "") (setq fileregex "^\\Ca")) |
| 426 |
(and (string-match "\\cj$" file) |
(and (string-match "\\Ca$" file) |
| 427 |
(setq fileregex (concat "^" (regexp-quote file) "\\cj")))) |
(setq fileregex (concat "^" (regexp-quote file) "\\Ca")))) |
| 428 |
(while (and files (not (input-pending-p))) |
(while (and files (not (input-pending-p))) |
| 429 |
(when (string-match fileregex (car files)) |
(when (string-match fileregex (car files)) |
| 430 |
(throw 'advocate t)) |
(throw 'advocate t)) |
| 431 |
(setq files (cdr files))) |
(setq files (cdr files))) |
| 432 |
(unless (input-pending-p) |
(unless (input-pending-p) |
| 433 |
(setq tmpfiles files) |
(setq tmpfiles files) |
| 434 |
(setq fileregex (concat "^" (regexp-quote file) "\\Cj" |
(setq fileregex (concat "^" (regexp-quote file) "\\ca" |
| 435 |
"\\|^" (regexp-quote file) "$")) |
"\\|^" (regexp-quote file) "$")) |
| 436 |
(while (and tmpfiles (not (input-pending-p))) |
(while (and tmpfiles (not (input-pending-p))) |
| 437 |
(when (string-match fileregex (car tmpfiles)) |
(when (string-match fileregex (car tmpfiles)) |
| 440 |
(unless (input-pending-p) |
(unless (input-pending-p) |
| 441 |
(setq fileregex |
(setq fileregex |
| 442 |
(concat "^\\(" |
(concat "^\\(" |
| 443 |
(if (string-match "^\\(\\(\\Cj*\\)?\\cj+\\)\\(\\Cj+\\)$" file) |
(if (and (string-match "\\ca+$" file) |
| 444 |
(concat (match-string 1 file) |
(< 0 (match-beginning 0))) |
| 445 |
|
(concat (substring file 0 (match-beginning 0)) |
| 446 |
"\\(" |
"\\(" |
| 447 |
(kogiku-migemo-get-pattern (match-string 3 file)) |
(kogiku-migemo-get-pattern (match-string 0 file)) |
| 448 |
"\\)") |
"\\)") |
| 449 |
(kogiku-migemo-get-pattern file)) |
(kogiku-migemo-get-pattern file)) |
| 450 |
"\\)")) |
"\\)")) |