From 4875c0bfd55d87a86f168b0bfb7bc98ae1142db6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 2 Jan 2016 00:10:59 +0900 Subject: [PATCH] Add minor-mode for info-in-prompt --- emacs.el | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index 983b6a6..a5825cd 100644 --- a/emacs.el +++ b/emacs.el @@ -2056,7 +2056,7 @@ Commands are searched from ALIST." "Set info-in-prompt advices for FUNCTIONS." `(progn ,@(mapcar (lambda (f) - `(defadvice ,f (before info-in-prompt activate) + `(defadvice ,f (before info-in-prompt-modify) "Show info in prompt." (let ((orig (ad-get-arg 0)) (str (format-mode-line info-in-prompt-format))) @@ -2072,6 +2072,15 @@ Commands are searched from ALIST." read-string completing-read) -() +(define-minor-mode info-in-prompt-mode + "Prepend some infomation to prompt of minibuffer." + :init-value nil + :global t + :lighter "" + (if info-in-prompt-mode + (ad-activate-regexp "^info-in-prompt-modify$") + (ad-deactivate-regexp "^info-in-prompt-modify$"))) + +(info-in-prompt-mode 1) ;;; emacs.el ends here