Skip to content

Conversation

@dhalilov
Copy link
Contributor

This PR implements the coq-insert-named-goal-selectors function that automatically generates named goal selectors (of the form [name]: tac.) for each open named goal. I bound it to C-c C-a C-g by default.

The implementation is based on the output of Show Existentials, and notably checks for the absence of (only printing) in the output to distinguish focusable goal names from unfocusable goals (see rocq-prover/rocq#20809).

This feature is mainly intended to be used in conjunction with automatically named goals in Rocq 9.2.

Here's a demo:
demo

Copy link
Contributor

@rswarbrick rswarbrick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there! I was feeling enthusiastic about reading some elisp again, so I thought I'd go through and leave a review. I hope it's useful!

@dhalilov
Copy link
Contributor Author

Hi there! I was feeling enthusiastic about reading some elisp again, so I thought I'd go through and leave a review. I hope it's useful!

Hey @rswarbrick, thanks for the review! Agreeing with all of your comments, I'll make the appropriate changes promptly.

By the way, coq-insert-snippet-with-holes was extracted verbatim from the implementation of coq-insert-match to avoid code duplication, but I've just found out that holes.el provides holes-replace-string-by-holes-backward-jump which has exactly the same implementation, so I might use that instead :)

@dhalilov dhalilov force-pushed the insert-named-goal-selectors branch from 978141b to a74e5dc Compare December 22, 2025 18:31
@rswarbrick
Copy link
Contributor

This looks good to me. I did a re-review and realised that all the stuff that had made me raise my eyebrows is now deleted! :-D

@Matafou
Copy link
Contributor

Matafou commented Jan 6, 2026

Hi! Very nice idea! I want to merge but I have one question first.

I see that you sneaked into holes.el (which I thought nobody cared about). But I am planning to remove holes.el in a short future and rely on yasnippet instead (opt in). What do you think of that? I will adapt your code when this happens of course.

@dhalilov
Copy link
Contributor Author

dhalilov commented Jan 6, 2026

I see that you sneaked into holes.el (which I thought nobody cared about). But I am planning to remove holes.el in a short future and rely on yasnippet instead (opt in). What do you think of that?

I used holes.el since that was the solution used in coq-insert-match, but I would definitely be in favor of using yasnippet 😄

@Matafou Matafou merged commit 6278f97 into ProofGeneral:master Jan 6, 2026
140 checks passed
@Matafou
Copy link
Contributor

Matafou commented Jan 6, 2026

Thanks @dhalilov and @rswarbrick !

@dhalilov dhalilov deleted the insert-named-goal-selectors branch January 6, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants