Subject: bug#79178: [Improvement] Allow auto-insert to have functions as conditions

From: Eli Zaretskii <[email-masked]>
Date: Thu, 07 Aug 2025 16:04:48 +0300

> Date: Wed, 6 Aug 2025 16:46:25 +0200
> Cc: [email-masked]
> From: Mattias <[email-masked]>
> 
> Thanks for the review!
> 
> I think I did everything you asked, let me know if there's something 
> missing or not done properly ;-)

Thanks, a couple of minor comments below.

> * lisp/autoinsert.el:
> (auto-insert-alist): Add the new condition type to the variable
> documentation
> (auto-insert): Change the way the condition is matched to allow for
> custom predicates

This should be formatted as below:

* lisp/autoinsert.el: (auto-insert-alist): Add the new condition
type to the variable documentation.
(auto-insert): Change the way the condition is matched to allow for
custom predicates.

It is best to use change-log-mode for formatting commit log messages,
as it will allow you to use M-q and other conveniences, and will obey
the formatting according to our conventions.  Also, don't forget the
periods at the end of each sentence (I added them above).

> +** Autoinsert
> +
> +*** New condition for 'auto-insert-alist'.
> +'auto-insert-alist' now also allows to have a predicate taking no argument
> +as conditions. This allows to trigger 'auto-insert' with finer grained control.

Our convention is to leave 2 spaces between sentences.  Also, since
the manual was updated, the NEWS entry should be marked with "+++"
(see the explanation at the beginning of NEWS).