Subject: bug#46151: 28.0.50; Set revert-buffer-function in shell command output buffers

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 03 Feb 2021 19:36:48 +0100

Dmitry Gutov <[email-masked]> writes:

> I offered an alternative suggestion for how 'g' could work (prohibit
> free editing when the command finishes). Or perhaps some of the other
> suggestions could be taken and standardized on for similar
> circumstances ('C-c C-g' might be appropriate since it's major mode
> specific).
>
> I think it's a nice property that major modes that have this binding
> implement some special behavior for reverting. And all that do, have
> this binding.
>
> But now, if a global binding is added, I worry that people might
> abandon that convention.

I don't think modes will stop creating reversion functions, and I think
special modes will continue to bind `g' -- it's more convenient than
`C-x g', after all.  So I don't think this is much to worry about.

>> But I disagree that it's not a useful general command for non-power
>> users: A common question is "how do I reload a file?", and we didn't
>> have a key binding for that.  `C-x C-f' does not reliably reload a file,
>> since it has DWIM stuff going on.
>
> Isn't the answer to most such questions, 'enable global-auto-revert-mode'?

No, I think `global-auto-revert-mode' is something most people don't
want.  For instance, if you're looking at /var/log/exim4/mainlog in
Emacs (which I do sometimes), you do not want that to be reloaded all
the time, because that would make it difficult to get any work done in
that buffer.  But you do want to reload it occasionally.

> I do revert buffers explicitly from time to time too (especially when
> developing or debugging certain Elisp packages), but still not often
> enough to worry about having to type 'M-x revert-buffer'.

I do it quite often (both in the log file case and because I apply
patches a lot).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no