The problem is when file path is pretty long each time I save it, minibuffer height grows and basically immediately shrinks. Kind of annoying because happens so often.
So I want to either shorten (basename?) the “wrote: …” message or make default (starting) minibuffer height of 2 lines. Or maybe enable truncation in minibuffer only but that’s not really good.
Is there a way?
Edit: I just noticed the
message-truncate-linesvariable and, unlikeresize-mini-windowsandmax-mini-window-height, I can actually make this one behave the way I want:original answer follows (and I’m interested to know why setting the other variables with similar advice doesn’t have the desired effect, if anyone can elaborate on that?)
I think messing with the message itself is going to be pretty hairy (and in any case a bad idea).
write-region(in fileio.c) does say of its argumentsIf VISIT is neither t nor nil nor a string, that means do not display the "Wrote file" message, but I strongly doubt that enforcing that would be sensible.I think the only sane approach is to prevent the minibuffer from resizing regardless of the message length. The following will do this, but for more situations than just saving a file:
My normal approach here would be to write some around advice for the function we’re interested in (I was thinking
save-buffer), to temporarily set that value, but for whatever reason that’s not having the desired effect.Similarly with using
before-save-hookandafter-save-hookto set and restore it.There’s also the
max-mini-window-heightvariable, but that appears to be subject to the same issue when attempting to set it temporarily.