> Or maybe there was some kind of implicit loop, where confirming the
> save after some timer ran out caused another confirmation request. I
> don't know. But there's no customization to let the user decide whether
> they want this intrusive behavior.
It would be good to understand the problem and its causes before we
discuss the possible solutions. Especially since your proposed
solution is quite a blunt weapon. These functions are placed on
write-file-functions for a reason.
I did not anticipate this behavior has been in place 20+ years (just looked at the blame). I understand a Makefile may be regarded as a previous component of a build system rather than a programming language, but this intrusive approach is unlike any other programming language mode I recall using in emacs. I understand why it might be the default, but for that to not even be configurable was jarring.
So, I thought this had to be a recent addition I was just pushing back on, as I am manually setting this hook to nil as a stop-gap now, for every buffer I am using to actively develop a Makefile. I didn't object to it being the default behavior.
Another approach would be to have a customization variable to treat Makefiles as precious or not by default. Then have a Boolean buffer local variable initialized to that setting that is consulted by those functions, and a command to flip that treatment in a particular buffer, so they can be freely hacked upon before they are actually in use. For extra credit, commands that are use to build a project might detect the Makefile is open and set the flag to t while the build is running to prevent a race.
> diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
> index d5fdd063825..ec1ac4e9d4f 100644
> --- a/lisp/progmodes/make-mode.el
> +++ b/lisp/progmodes/make-mode.el
> @@ -188,6 +188,15 @@ makefile-cleanup-continuations
> to MODIFY A FILE WITHOUT YOUR CONFIRMATION when \"it seems necessary\"."
> :type 'boolean)
>
> +(defcustom makefile-write-check-hooks
> + '(makefile-warn-suspicious-lines
> + makefile-warn-continuations
> + makefile-cleanup-continuations)
> + "List of functions to run when writing the buffer to a file.
> +The defaults on the list require confirmation to save when a
> +suspicious line or line continuation is detected."
> + :type 'list)
The :version tag is missing. Also, this kind of change warrants a
NEWS entry.
(But I'm still not sure this change is TRT for solving the problems
you described, for lack of details.)