[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dynamic prompt
From: |
Stefan Monnier |
Subject: |
Re: dynamic prompt |
Date: |
Sun, 06 May 2012 10:56:45 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) |
>> > I'd like to have a prompt that shows the number of characters entered
>> > in the response
>> > Prompt (3): bla
>> > Prompt (7): bla bla
>> > Is that in any way possible?
>> Of course: the prompt is normal text present in the (mini)buffer, which
>> itself is a perfectly normal buffer (tho displayed in a special
>> (mini)window) and you can edit it like any other buffer text.
> I suspect he wants the character count to be updated automatically.
Of course. But that can use any of the standard hooks for that:
post-command-hook or after-change-functions.
> Seems like he needs to enable a hook when he goes into the mini-buffer,
> that modifies the prompt after each command.
minibuffer-setup-hook should do the trick, or minibuffer-with-setup-hook
depending on whether he wants it in one particular case or in all cases.
Stefan