Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Outline mode with TOC #236

Open
ghost opened this issue Apr 23, 2020 · 3 comments
Open

Feature Request: Outline mode with TOC #236

ghost opened this issue Apr 23, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 23, 2020

See also: https://coq.discourse.group/t/pg-company-structured-outline-mode/798

Company/PG has the command M-x company-coq-occur (bound to C-c C-, in my case), which gives an outline of the curent lemmas/definitions/etc. However, it doesn’t follow the coqdoc structure. I use special comments to structure my script, like

(** * Title *)
(** ** Chapter *)
(** *** Section *)
(** **** etc *)

It would be nice to have an outline like this in PG/Company, like reftex's TOC (M-x reftex-toc). This would help navigating in large .v files.

@cpitclaudel
Copy link
Owner

Sure thing. The proper way to do this would probably be to move away from occur and do a proper TOC buffer, but for now you could start with changing the line that calls occur in company-coq-occur to (occur (format "\\(?:%s\\|%s\\)" company-coq-outline-regexp-base (caar company-coq-features/coqdoc--spec))). Do you want to try that?

@ghost
Copy link
Author

ghost commented Apr 24, 2020 via email

@ghost
Copy link
Author

ghost commented Apr 24, 2020

The screenshot was not properly uploaded, so here is what I saw in textual form:

XXX:
   :
   :
   :
   :
   :(** *** HL1 *)
   :
XXX:Definition ...
   :
   :(** *** HL2 *)
   :
XXX:Definition ...

: was displayed verbatimly, ... is omissed, XXX is a line number.

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

No branches or pull requests

1 participant