File 9521-Handle-xref-location-group-rename-in-Emacs-30.patch of Package erlang
From e36e7a616725ca6220c55dd398de28e745eb03ad Mon Sep 17 00:00:00 2001
From: Bozhidar Batsov <bozhidar@batsov.dev>
Date: Fri, 20 Mar 2026 13:35:01 +0200
Subject: [PATCH 11/17] Handle xref-location-group rename in Emacs 30
xref-location-group was renamed to xref-location-origin in Emacs 30.
Try the new name first, falling back to the old one for Emacs 27-29.
---
lib/tools/emacs/erlang.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index a52dcd5728..54927757ab 100644
--- a/lib/tools/emacs/erlang.el
+++ b/lib/tools/emacs/erlang.el
@@ -5649,9 +5649,11 @@ return XREFS as is."
(file-truename file))))
(defun erlang-xref-file (xref)
- (and (fboundp 'xref-location-group)
- (fboundp 'xref-item-location)
- (xref-location-group (xref-item-location xref))))
+ (let ((location (xref-item-location xref)))
+ (cond ((fboundp 'xref-location-origin) ; Emacs 30+
+ (xref-location-origin location))
+ ((fboundp 'xref-location-group)
+ (xref-location-group location)))))
(defun erlang-visit-tags-table-buffer (cont cbuf)
(visit-tags-table-buffer cont cbuf))
--
2.51.0