| 107 |
|
|
| 108 |
(defun kogiku-completion-complete (&optional arg) |
(defun kogiku-completion-complete (&optional arg) |
| 109 |
(interactive "P") |
(interactive "P") |
| 110 |
(if (and |
(when (and arg |
| 111 |
arg |
(eq minibuffer-completion-table 'read-file-name-internal)) |
| 112 |
(eq minibuffer-completion-table 'read-file-name-internal)) |
(setq minibuffer-completion-table 'kogiku-read-file-name-internal) |
| 113 |
(setq minibuffer-completion-table |
(kogiku-minibuffer-prompt)) |
| 114 |
'kogiku-read-file-name-internal)) |
(funcall kogiku-original-function-for-minibuffer-local-completion-map)) |
|
(funcall |
|
|
kogiku-original-function-for-minibuffer-local-completion-map)) |
|
| 115 |
|
|
| 116 |
(defun kogiku-must-match-complete (&optional arg) |
(defun kogiku-must-match-complete (&optional arg) |
| 117 |
(interactive "P") |
(interactive "P") |
| 118 |
(if (and |
(when (and arg |
| 119 |
arg |
(eq minibuffer-completion-table 'read-file-name-internal)) |
| 120 |
(eq minibuffer-completion-table 'read-file-name-internal)) |
(setq minibuffer-completion-table 'kogiku-read-file-name-internal) |
| 121 |
(setq minibuffer-completion-table |
(kogiku-minibuffer-prompt)) |
| 122 |
'kogiku-read-file-name-internal)) |
(funcall kogiku-original-function-for-minibuffer-local-must-match-map)) |
| 123 |
(funcall |
|
| 124 |
kogiku-original-function-for-minibuffer-local-must-match-map)) |
(defun kogiku-minibuffer-prompt () |
| 125 |
|
(when (fboundp 'field-beginning) |
| 126 |
|
(let ((prompt (buffer-substring (point-min) (field-beginning))) |
| 127 |
|
(buffer-read-only nil) |
| 128 |
|
(inhibit-read-only t) |
| 129 |
|
(props (text-properties-at (point-min)))) |
| 130 |
|
(save-excursion |
| 131 |
|
(when (string-match ":[^:]*" prompt) |
| 132 |
|
(setq prompt (concat (substring prompt 0 (match-beginning 0)) |
| 133 |
|
" (kogiku)" |
| 134 |
|
(substring prompt (match-beginning 0)))) |
| 135 |
|
(set-text-properties 0 (length prompt) props prompt) |
| 136 |
|
(delete-region (point-min) (field-beginning)) |
| 137 |
|
(goto-char (point-min)) |
| 138 |
|
(insert prompt)))))) |
| 139 |
|
|
| 140 |
(if (fboundp 'compare-strings) |
(if (fboundp 'compare-strings) |
| 141 |
(defalias 'kogiku-compare-strings 'compare-strings) |
(defalias 'kogiku-compare-strings 'compare-strings) |