aboutsummaryrefslogtreecommitdiffhomepage
path: root/coq/coq-indent.el
diff options
context:
space:
mode:
authorGravatar Pierre Courtieu <Pierre.Courtieu@cnam.fr>2016-05-27 19:02:21 +0200
committerGravatar Pierre Courtieu <Pierre.Courtieu@cnam.fr>2016-05-27 19:02:21 +0200
commite2f1a90fb0061b6a1c969955f9957a8c8b1f7ed1 (patch)
treecb882d15e3cd8f3e758a60f481e162ee14ec337c /coq/coq-indent.el
parentaff6697e7c2ad645ad54d29da12d65aded5e038a (diff)
Fixing a smal glitch in indentation.
Diffstat (limited to 'coq/coq-indent.el')
-rw-r--r--coq/coq-indent.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/coq/coq-indent.el b/coq/coq-indent.el
index fddfc373..e5179390 100644
--- a/coq/coq-indent.el
+++ b/coq/coq-indent.el
@@ -96,8 +96,8 @@ detect if they start something or not."
(not (proof-string-match "{\\s-*\\(wf\\|measure\\)" str)))))))
-(defconst coq-simple-cmd-ender-regexp "[^.]\\|\\=\\|\\.\\."
- "Used internally. Matches the allow prefix of the coq \".\" command ending.")
+(defconst coq-simple-cmd-ender-prefix-regexp "[^.]\\|\\=\\|\\.\\."
+ "Used internally. Matches the allowed prefixes of coq \".\" command ending.")
(defconst coq-bullet-regexp-nospace "\\(-\\)+\\|\\(+\\)+\\|\\(\\*\\)+"
"Matches single bullet, WARNING: Lots of false positive.
@@ -109,14 +109,14 @@ No context checking.")
;; bullets and curlys and spaces). This is used when search backward.
;; This variable is the regexp of possible prefixes
(defconst coq-bullet-prefix-regexp
- (concat "\\(?:\\(?:" coq-simple-cmd-ender-regexp "\\)"
+ (concat "\\(?:\\(?:" coq-simple-cmd-ender-prefix-regexp "\\)"
"\\(?:\\.\\)\\(?:\\s-\\)\\(?:\\s-\\|{\\|}\\|-\\|+\\|\\*\\)*\\)"))
;; matches regular command end (. and ... followed by a space or buffer end)
;; ". " and "... " are command endings, ".. " is not, same as in
;; proof-script-command-end-regexp in coq.el
(defconst coq-period-end-command
- (concat "\\(?:\\(?2:" coq-simple-cmd-ender-regexp "\\)\\(?1:\\.\\)\\(?3:\\s-\\|\\'\\)\\)")
+ (concat "\\(?:\\(?2:" coq-simple-cmd-ender-prefix-regexp "\\)\\(?1:\\.\\)\\(?3:\\s-\\|\\'\\)\\)")
"Matches coq regular syntax for ending a command (except bullets and curlies).
This should match EXACTLY command ending syntax. No false
@@ -194,10 +194,14 @@ command ended by the bullet-like regexp is empty. This is done in
coq-smie.el, and see `coq-end-command-regexp-backward' for a more
precise regexp (but only when searching backward).")
+; Order here is significant, when two pattern match with the same
+; starting position, the first regexp is preferred. period-command is
+; the shorter one so let us have it at the end, but what about cury vs
+; bullets?
(defconst coq-end-command-regexp-backward
(concat coq-bullet-end-command-backward "\\|"
- coq-period-end-command "\\|"
- coq-curlybracket-end-command-backward)
+ coq-curlybracket-end-command-backward "\\|"
+ coq-period-end-command)
"Matches end of commands, including bullets and curlies.
There are 3 substrings (2 and 3 may be nil):