Conversation
6505583 to
2d37c8e
Compare
|
@jespercockx I think you missed this commit. |
8a61254 to
1869e66
Compare
|
Agda dev 2025-11-12: This PR should be tested by several users for the look-and-feel of the new behavior. |
|
Emacs complained when I tried to compile your code ( I'm using Emacs 27.1. |
|
I have tried this PR with Emacs 30.2 and it seems to work fine. The basic jump-to-definition function seems to behave the same as before. |
|
@nad Can you try upgrading xref from ELPA? I am not sure if the Makefile uses local packages when compiling. Otherwise I can look to redefine/backport the necessary definitions. |
|
There's a conflict here now after merging some of your other PRs @phikal, could you please take a look? |
|
Should be resolved. |
|
I still cannot do a clean rebase, I could squash and merge but then that would defeat the purpose of splitting it in three commits. |
|
I've now manually rebased the commit onto agda/master, lets see if that makes a difference. |
I don't think we should require users of Agda to do that. |
While I don't think that it is much to impose (especially if users install Agda via their package manager, then that can also install the newer version of Xref for them as well; but I'd also expect that most people are using releases of Emacs newer than 27), I can look into back-porting the newer definitions if you think that is the right way to go ahead. |
I pushed a commit doing this. The code is directly from Emacs, but as it is does not constitute a significant contribution, it shouldn't pose a copyright issue. |
|
@phikal the CI now gives an error on the elisp files: Could you take a look please? |
|
Looks like I just forgot to declare and require the right function, sorry about that! |
|
@nad could you check again if this PR works for you now? |
|
I'm pretty sure this broke the |
|
The CI failures appear to be unrelated to my change, right? Either way, I have built a local Emacs 27 instance to check it myself, and while the byte-compiler doesn't complain, it appears I have some issue with resolving the Xref method... I cannot say if this is my mistake or not, so I'll have to take another look at this. |
ce2ab8a to
e4e14bc
Compare
|
I have revised the PR onto master, throwing out the changes to annotation.el to make it less controversial (I recall that @nad was not happy with that) and change as little code as necessary. As the commit mostly just adds new code, the issues that @VojtechStep observed are also gone. |
1226e6e to
3a961f6
Compare
|
Fixed, was not aware that tabs were forbidden everywhere. BTW, has adding a EditorConfig ever been discussed? |
Not as far as I know, currently we just use fix-whitespace by @andreasabel but if we could replicate its functionality with a standard tool such as EditorConfig then I'd support that. The main question would be whether we can also integrate it into CI. |
|
I tested this PR now. I used the following code: A : Set₁
A = Set
B : Set₁
B = AIf I load the file, go to the final occurrence of Output from |
By replacing the custom go-to-definition implementation with the standard Xref interface, users may user familiar key bindings that also support searching for definitions via an apropos-like interface. By default Xref doesn't have a binding for mouse-clicks, so this change adds that to the 'agda2-mode-map' by hand.
|
I could reproduce that issue and debug it on a local Emacs 27 build. Turns out that in Emacs 27's |
|
Is there a backwards compatibility policy for how many versions of emacs |
Debian stable has Emacs 30.1, Ubuntu LTS has 29.3, but according to this site there still are supported distributions like Rocky Linux 8 that have 26.1. |
This was initially proposed in #6540, but I have now rebased it onto master with no additional dependencies (there might be merge-conflicts with the other PRs tough, not sure).
The idea here is the same as before, Xref is a standard Emacs UI for jumping to definition. Having a separate UI for the same thing inevitably runs up against minor paper cuts that annoy the user. As Xref supports a superset of what the annotation-based implementation provided, I hope that the approach is satisfactory and will not annoy anyone. IIRC new features we get for free include C-u M-. supporting prompting of identifiers and a grep-based backend to search for occurrences (eventually it would be better if we could replace this with a proper backend). A new feature is C-M-. (
xref-find-apropos) that searches all open buffers for their identifiers and allows you to issue queries involving subphrases that might occur in an identifier in any order or regular expressions.See #5917.
As mentioned in #6123 (comment) this merges annotations.el into agda2-highlight.el, as this changes makes the former become an unnecessary indirection.