*** The built-in ada-mode is now deleted. The Gnu ELPA package is a
good replacement, even in very large source files.
+** xref
+
+---
+*** Imenu support has been added to 'xref--xref-buffer-mode'.
+
\f
* New Modes and Packages in Emacs 27.1
"Mode for displaying cross-references."
(setq buffer-read-only t)
(setq next-error-function #'xref--next-error-function)
- (setq next-error-last-buffer (current-buffer)))
+ (setq next-error-last-buffer (current-buffer))
+ (setq imenu-prev-index-position-function
+ #'xref--imenu-prev-index-position)
+ (setq imenu-extract-index-name-function
+ #'xref--imenu-extract-index-name))
(defvar xref--transient-buffer-mode-map
(let ((map (make-sparse-keymap)))
xref--xref-buffer-mode
"XREF Transient")
+(defun xref--imenu-prev-index-position ()
+ "Move point to previous line in `xref' buffer.
+This function is used as a value for
+`imenu-prev-index-position-function'."
+ (if (bobp)
+ nil
+ (xref--search-property 'xref-group t)))
+
+(defun xref--imenu-extract-index-name ()
+ "Return imenu name for line at point.
+This function is used as a value for
+`imenu-extract-index-name-function'. Point should be at the
+beginning of the line."
+ (buffer-substring-no-properties (line-beginning-position)
+ (line-end-position)))
+
(defun xref--next-error-function (n reset?)
(when reset?
(goto-char (point-min)))
for line-format = (and max-line-width
(format "%%%dd: " max-line-width))
do
- (xref--insert-propertized '(face xref-file-header) group "\n")
+ (xref--insert-propertized '(face xref-file-header 'xref-group t)
+ group "\n")
(cl-loop for (xref . more2) on xrefs do
(with-slots (summary location) xref
(let* ((line (xref-location-line location))