| @@ -2057,7 +2057,7 @@ Commands are searched from ALIST." | |||||
| (define-key ctl-x-map "c" 'compile) | (define-key ctl-x-map "c" 'compile) | ||||
| (set (defvar prompt-line-format nil | |||||
| (set (defvar prompt-text-format nil | |||||
| "Format text to be prepended to prompt texts of minibuffer. | "Format text to be prepended to prompt texts of minibuffer. | ||||
| The value should be a mode-line format: see `mode-line-fomat' for details.") | The value should be a mode-line format: see `mode-line-fomat' for details.") | ||||
| `(,(concat "[" | `(,(concat "[" | ||||
| @@ -2072,14 +2072,14 @@ The value should be a mode-line format: see `mode-line-fomat' for details.") | |||||
| (git-ps1-mode-get-current "[GIT:%s]"))) | (git-ps1-mode-get-current "[GIT:%s]"))) | ||||
| " ")) | " ")) | ||||
| (defmacro prompt-line--defadvice (&rest functions) | |||||
| "Set prompt-line advices for FUNCTIONS." | |||||
| (defmacro prompt-text--defadvice (&rest functions) | |||||
| "Set prompt-text advices for FUNCTIONS." | |||||
| `(progn | `(progn | ||||
| ,@(mapcar (lambda (f) | ,@(mapcar (lambda (f) | ||||
| `(defadvice ,f (before prompt-line-modify) | |||||
| `(defadvice ,f (before prompt-text-modify) | |||||
| "Show info in prompt." | "Show info in prompt." | ||||
| (let ((orig (ad-get-arg 0)) | (let ((orig (ad-get-arg 0)) | ||||
| (str (format-mode-line prompt-line-format))) | |||||
| (str (format-mode-line prompt-text-format))) | |||||
| (unless (string-match-p (concat "^" | (unless (string-match-p (concat "^" | ||||
| (regexp-quote str)) | (regexp-quote str)) | ||||
| orig) | orig) | ||||
| @@ -2088,19 +2088,19 @@ The value should be a mode-line format: see `mode-line-fomat' for details.") | |||||
| orig)))))) | orig)))))) | ||||
| functions))) | functions))) | ||||
| (prompt-line--defadvice read-from-minibuffer | |||||
| (prompt-text--defadvice read-from-minibuffer | |||||
| read-string | read-string | ||||
| completing-read) | completing-read) | ||||
| (define-minor-mode prompt-line-mode | |||||
| (define-minor-mode prompt-text-mode | |||||
| "Prepend some infomation to prompt of minibuffer. | "Prepend some infomation to prompt of minibuffer. | ||||
| Set `prompt-line-format' to configure what text to prepend." | |||||
| Set `prompt-text-format' to configure what text to prepend." | |||||
| :init-value nil | :init-value nil | ||||
| :global t | :global t | ||||
| :lighter "" | :lighter "" | ||||
| (if prompt-line-mode | |||||
| (ad-activate-regexp "^prompt-line-modify$") | |||||
| (ad-deactivate-regexp "^prompt-line-modify$"))) | |||||
| (if prompt-text-mode | |||||
| (ad-activate-regexp "^prompt-text-modify$") | |||||
| (ad-deactivate-regexp "^prompt-text-modify$"))) | |||||
| (prompt-line-mode 1) | (prompt-line-mode 1) | ||||