--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -5123,2 +5123,2 @@ -;; etags information structures (class xref-etags-location) will be -;; translated to our own structures which include arity (class --- +;; etags information structures (struct xref-etags-location) will be +;; translated to our own structures which include arity (struct @@ -5132,0 +5132,5 @@ +;; NOTE: Around Sept 2021, the xrefs package changed all of its defined types +;; (i.e. xref-location, xref-file-location) from EIEIO classes to CL-Lib +;; structures. These are both supported. Older Emacsen with earlier versions of +;; xref will continue to use defclass. Newer Emacsen will use cl-defstruct. + @@ -5140,0 +5145,1 @@ + (erlang-soft-require 'cl-lib) @@ -5168,4 +5174,14 @@ - (defclass erlang-xref-location (xref-file-location) - ((arity :type fixnum :initarg :arity - :reader erlang-xref-location-arity)) - :documentation "An erlang location is a file location plus arity.") --- + ;; Xref 1.3.1 bundled with Emacs 28+ switched from using EIEIO classes to + ;; using CL-Lib structs. + (if (find-class 'xref-file-location) + (progn + (defclass erlang-xref-location (xref-file-location) + ((arity :type fixnum :initarg :arity + :reader erlang-xref-location-arity)) + :documentation "An erlang location is a file location plus arity.") + ;; Make a constructor with the same name that a CL structure would have. + (defalias 'make-erlang-xref-location 'erlang-xref-location)) + (cl-defstruct (erlang-xref-location + (:include xref-file-location)) + "An erlang location is a file location plus arity." + (arity 0 :type fixnum))) @@ -5334,2 +5350,1 @@ - (fboundp 'xref-location-group) - (fboundp 'slot-value)) --- + (fboundp 'xref-location-group)) @@ -5360,1 +5375,2 @@ - (when (fboundp 'make-instance) --- + (when (and (fboundp 'make-erlang-xref-location) + (fboundp 'xref-make)) @@ -5372,5 +5388,5 @@ - for loc = (make-instance 'erlang-xref-location - :file file - :line (line-number-at-pos) - :column 0 - :arity arity) --- + for loc = (make-erlang-xref-location + :file file + :line (line-number-at-pos) + :column 0 + :arity arity) @@ -5380,3 +5396,1 @@ - collect (make-instance 'xref-item - :summary sum - :location loc) --- + collect (xref-make sum loc) @@ -6304,0 +6318,1 @@ +