Subject: Ansible inventory mode covers too many files

From: Juri Linkov <[email-masked]>
Date: Tue, 04 Aug 2020 02:56:47 +0300

Visiting a file with the word "inventory" in its name,
for example, "dynamic_inventory.html" or "inventory.jpg"
enables 'ansible-inventory-generic-mode' instead of
using html-mode or image-mode according to file extensions.

This is because the scope of ansible-inventory-generic-mode
is too wide: it matches the subword "inventory" in the file name.
This patch should restrict it:

diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index cd24f497c9..48ac123205 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -643,7 +643,7 @@ ansible-inventory-generic-mode
     ("\\([^ =\n\r]+\\)=\\([^ \n\r]*\\)"
      (1 font-lock-variable-name-face)
      (2 font-lock-keyword-face)))
-  '("inventory")
+  '("inventory\\'")
   (list
    (function
     (lambda ()