diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 18fdd963fb..750a090b84 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -607,16 +607,26 @@ xref-show-location-at-point (when xref (xref--show-location (xref-item-location xref))))) +(defun xref-next-line-no-display () + "Move to the next xref but don't display its source." + (interactive) + (xref--search-property 'xref-item)) + (defun xref-next-line () "Move to the next xref and display its source in the appropriate window." (interactive) - (xref--search-property 'xref-item) + (xref-next-line-no-display) (xref-show-location-at-point)) +(defun xref-prev-line-no-display () + "Move to the previous xref but don't display its source." + (interactive) + (xref--search-property 'xref-item t)) + (defun xref-prev-line () "Move to the previous xref and display its source in the appropriate window." (interactive) - (xref--search-property 'xref-item t) + (xref-prev-line-no-display) (xref-show-location-at-point)) (defun xref-next-group ()