File 9526-Add-declare-function-for-xref-functions-in-erlang.el.patch of Package erlang
From e97f13757ee12e214d311db3b580cd8cce116c72 Mon Sep 17 00:00:00 2001
From: Bozhidar Batsov <bozhidar@batsov.dev>
Date: Fri, 20 Mar 2026 13:54:55 +0200
Subject: [PATCH 16/17] Add declare-function for xref functions in erlang.el
The byte-compiler warns about xref-item-location, xref-location-group,
and xref-location-origin potentially being undefined at runtime. Add
declare-function forms to silence these warnings.
---
lib/tools/emacs/erlang.el | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index 6d8d95ec60..e8c8e74737 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -5645,6 +5645,10 @@ return XREFS as is."
(and file
(file-truename file))))
+(declare-function xref-item-location "xref" (item))
+(declare-function xref-location-group "xref" (location))
+(declare-function xref-location-origin "xref" (location))
+
(defun erlang-xref-file (xref)
(let ((location (xref-item-location xref)))
(cond ((fboundp 'xref-location-origin) ; Emacs 30+
--
2.51.0