-
Notifications
You must be signed in to change notification settings - Fork 92
add customizable variables to configure which part of a goal the goal buffer will focus on #654
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
Open
cipher1024
wants to merge
2
commits into
ProofGeneral:master
Choose a base branch
from
cipher1024:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,6 +115,18 @@ Namely, goals that do not fit in the goals window." | |
:type 'boolean | ||
:group 'coq) | ||
|
||
(defcustom coq-goal-conclusion-marker "========" | ||
"Marks the part of interest in each goal to focus the goal buffer on" | ||
:type 'regexp | ||
:group 'coq | ||
) | ||
|
||
(defcustom coq-center-goal-after-focus 'top | ||
"Where to display the goal marker after rendering a proof goal" | ||
:type '(radio | ||
(const :tag "move conclusion marker to the top of the window" top) | ||
(const :tag "move conclusion marker to the middle of the window" middle) | ||
(const :tag "move conclusion marker to the bottom of the window" bottom))) | ||
|
||
(defconst coq-shell-init-cmd | ||
(append | ||
|
@@ -3163,7 +3175,10 @@ buffer." | |
(goto-char (match-beginning 0)) | ||
(buffer-substring p (point))))))) | ||
|
||
|
||
(defun coq-recenter-goal (loc) | ||
(cond ((eq loc 'top) (recenter 0)) | ||
((eq loc 'middle) (recenter nil)) | ||
((eq loc 'bottom) (recenter -1)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let us have something like a |
||
|
||
(defun coq-show-first-goal () | ||
"Scroll the goal buffer so that the first goal is visible. | ||
|
@@ -3192,10 +3207,11 @@ number of hypothesis displayed, without hiding the goal" | |
;; if the top of concl is hidden we may want to show it instead | ||
;; of bottom of concl | ||
(when (and coq-prefer-top-of-conclusion | ||
;; return nil if === is not visible | ||
(not (save-excursion (re-search-backward "========" (window-start) t)))) | ||
(re-search-backward "========" nil t) | ||
(recenter 0)) | ||
;; return nil if conclusion marker is not visible | ||
(not (save-excursion (re-search-backward coq-goal-conclusion-marker | ||
(window-start) t)))) | ||
(re-search-backward coq-goal-conclusion-marker nil t) | ||
(coq-recenter-goal coq-center-goal-after-focus)) | ||
(beginning-of-line)))))))) | ||
|
||
(defvar coq-modeline-string2 ")") | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For better user configuration should we merge this preference with
coq-prefer-top-of-conclusion
?Currently if this one is nil then we show the end of the conclusion (of the first goal). Something like:
coq-prefer-top-of-conclusion
could be left for compatibilty.@cipher1024 what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! Let's do it