Fix Emacs 26 support in xref.el
* lisp/progmodes/xref.el (xref--defstruct): New macro. (xref-item, xref-match-item): Use it in definitions.
This commit is contained in:
parent
f6826800ea
commit
cd4bb98540
1 changed files with 14 additions and 7 deletions
|
|
@ -195,16 +195,23 @@ is not known."
|
|||
|
||||
;;; Cross-reference
|
||||
|
||||
(cl-defstruct (xref-item
|
||||
(:constructor xref-make (summary location))
|
||||
(:noinline t))
|
||||
(defmacro xref--defstruct (name &rest fields)
|
||||
(declare (indent 1))
|
||||
`(cl-defstruct ,(if (>= emacs-major-version 27)
|
||||
name
|
||||
(remq (assq :noinline name) name))
|
||||
,@fields))
|
||||
|
||||
(xref--defstruct (xref-item
|
||||
(:constructor xref-make (summary location))
|
||||
(:noinline t))
|
||||
"An xref item describes a reference to a location somewhere."
|
||||
summary location)
|
||||
|
||||
(cl-defstruct (xref-match-item
|
||||
(:include xref-item)
|
||||
(:constructor xref-make-match (summary location length))
|
||||
(:noinline t))
|
||||
(xref--defstruct (xref-match-item
|
||||
(:include xref-item)
|
||||
(:constructor xref-make-match (summary location length))
|
||||
(:noinline t))
|
||||
"A match xref item describes a search result."
|
||||
length)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue