Develop and Download Open Source Software

Browse CVS Repository

Diff of /kogiku/kogiku/kogiku.el

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.19 by jet, Tue Feb 10 13:31:36 2004 UTC revision 1.20 by shirai, Tue Feb 10 16:20:15 2004 UTC
# Line 145  minibufferに制御が移ったときに`minibuffe Line 145  minibufferに制御が移ったときに`minibuffe
145  (defun kogiku-minibuffer-prompt ()  (defun kogiku-minibuffer-prompt ()
146    (if (fboundp 'field-beginning)    (if (fboundp 'field-beginning)
147        ;; Emacs 21        ;; Emacs 21
148        (let ((prompt (buffer-substring (point-min) (field-beginning)))        (let ((indicator (format "[%s]" kogiku-minibuffer-prompt-string))
149              (props (text-properties-at (point-min)))              (props (text-properties-at (point-min)))
             (indicator (format " [%s]" kogiku-minibuffer-prompt-string))  
150              (buffer-read-only nil)              (buffer-read-only nil)
151              (inhibit-read-only t)              (inhibit-read-only t))
             replace)  
152          (save-excursion          (save-excursion
153            (when (string-match (regexp-quote indicator) prompt)            (goto-char (point-min))
154              (setq replace t)            (cond
155              (setq prompt (replace-match "" nil nil prompt))             ((and (not (eq minibuffer-completion-table 'kogiku-read-file-name-internal))
156              (set-text-properties 0 (length prompt) props prompt))                   (looking-at (concat "^" (regexp-quote indicator) " ")))
157            (when (and (eq minibuffer-completion-table              (delete-region (point-min) (match-end 0)))
158                           'kogiku-read-file-name-internal)             ((and (eq minibuffer-completion-table 'kogiku-read-file-name-internal)
159                       (string-match ":[^:]*" prompt))                   (not (looking-at (concat "^" (regexp-quote indicator) " "))))
160              (setq replace t)              (setq indicator (concat indicator " "))
161              (set-text-properties 0 (length indicator) props indicator)              (insert indicator)
162              (add-text-properties 0 (length indicator)              (set-text-properties (point-min) (field-beginning) props)
163                                   '(face kogiku-indicator-face) indicator)              (add-text-properties (point-min) (+ -1 (point-min) (length indicator))
164              (setq prompt (concat (substring prompt 0 (match-beginning 0))                                   '(face kogiku-indicator-face))))))
                                  indicator  
                                  (substring prompt (match-beginning 0)))))  
           (when replace  
             (delete-region (point-min) (field-beginning))  
             (goto-char (point-min))  
             (insert prompt))))  
165      ;; Others      ;; Others
166      (if (eq minibuffer-completion-table 'kogiku-read-file-name-internal)      (if (eq minibuffer-completion-table 'kogiku-read-file-name-internal)
167          (let ((max (min (point-max) (1+ (point-min)))))          (let ((max (min (point-max) (1+ (point-min)))))

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26