Subject: bug#65154: vhdl-mode bug

From: Gonzalo Larumbe <[email-masked]>
Date: Tue, 8 Aug 2023 19:55:59 +0200

Hello,

While developing some features for `vhdl-ext` MELPA package (
https://github.com/gmlarumbe/vhdl-ext) I believe I have come across a bug
in `vhdl-mode` function `vhdl-corresponding-begin`.

Inside the cond block, for the "end component" condition, it seems that the
enclosing parentheses to set capture group 1 in the `looking-at` string
argument are missing.

I attach a simple patch that fixes it.

Thanks!

Gonzalo
diff --git a/lisp/progmodes/vhdl-mode.el b/lisp/progmodes/vhdl-mode.el
index 77d862f1a17..ccbe04db1e8 100644
--- a/lisp/progmodes/vhdl-mode.el
+++ b/lisp/progmodes/vhdl-mode.el
@@ -6198,7 +6198,7 @@ vhdl-corresponding-begin
 		      (vhdl-first-word pos)
 		      "else\\|then\\|use" nil))
 	     ;; "end component":
-	     ((looking-at "component\\b[^_]")
+	     ((looking-at "\\(component\\)\\b[^_]")
 	      (vector (buffer-substring (match-beginning 1)
 					(match-end 1))
 		      (vhdl-first-word pos)