[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#74361: [PATCH] New option xref-navigation-display-window-action
From: |
Juri Linkov |
Subject: |
bug#74361: [PATCH] New option xref-navigation-display-window-action |
Date: |
Fri, 15 Nov 2024 09:49:39 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) |
> This adds a capability to customize the destination window selection logic
> for navigation (xref-find-definitions, xref-go-back, xref-go-forward) by
> allowing a user-supplied display window function.
>
> Inspired by the Merlin package and its user option
> merlin-locate-in-new-window
> (https://github.com/ocaml/merlin/blob/a36f42a5b181d0c9cc84174e8eb241b11eeabc0f/emacs/merlin.el#L177C12-L177C39)
> - where the value 'diff' uses a different window if the destination is in
> an file different from the current one.
>
> With the attached patch the customization looks a bit noisier though:
>
> (setq xref-navigation-display-window-action
> '(display-buffer-reuse-window))
>
> ^ This makes it try to reuse an existing window and fall back to
> pop-to-window, but the effect is similar to what's described above.
>
> Comments welcome.
This option looks similar to 'display-comint-buffer-action'
whose addition was deemed to be a mistake, so we needed to declare it
obsolete and replace it with '(category . comint)'.
So instead of adding 'xref-navigation-display-window-action',
could you just add a category 'xref' to xref display function calls?
Then users will be able to customize it with e.g.:
(setq display-buffer-alist '(((category . xref)
(display-buffer-reuse-window))))
Or maybe I misunderstand other requirements for this feature.
Ok, meanwhile I'll play more with your patch to see if 'category'
could really help here.
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Dmitry Gutov, 2024/11/14
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Dmitry Gutov, 2024/11/14
- bug#74361: [PATCH] New option xref-navigation-display-window-action,
Juri Linkov <=
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Dmitry Gutov, 2024/11/15
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Juri Linkov, 2024/11/16
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Dmitry Gutov, 2024/11/17
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Juri Linkov, 2024/11/19
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Dmitry Gutov, 2024/11/19
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Juri Linkov, 2024/11/20
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Dmitry Gutov, 2024/11/20
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Juri Linkov, 2024/11/21
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Dmitry Gutov, 2024/11/24
- bug#74361: [PATCH] New option xref-navigation-display-window-action, Dmitry Gutov, 2024/11/26