[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/proof-general 57a9d9ea91 05/25: qrhl: support for several
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/proof-general 57a9d9ea91 05/25: qrhl: support for several commands on the same line. |
Date: |
Mon, 28 Feb 2022 07:58:43 -0500 (EST) |
branch: elpa/proof-general
commit 57a9d9ea9148f058a7a84566fd1a89c225c7cea5
Author: Dominique Unruh <unruh@ut.ee>
Commit: Dominique Unruh <unruh@ut.ee>
qrhl: support for several commands on the same line.
---
qrhl/qrhl.el | 40 ++++++++++++++++++++++++++++++++--------
1 file changed, 32 insertions(+), 8 deletions(-)
diff --git a/qrhl/qrhl.el b/qrhl/qrhl.el
index 7eef34d06e..bbd93b489d 100644
--- a/qrhl/qrhl.el
+++ b/qrhl/qrhl.el
@@ -16,12 +16,36 @@
)
focus-cmd))
+(defun qrhl-forward-regex (regex)
+ "If text starting at point matches REGEX, move to end of the match and
return t.
+ Otherwise return nil"
+ (and (looking-at regex) (goto-char (match-end 0)) t))
+
+(defun qrhl-parse-regular-command ()
+ "Finds the period-terminated command starting at the point (and moves to its
end).
+ Returns t if this worked."
+ (let ((pos
+ (save-excursion
+ (progn
+ (while (or
+ ; skip forward over regular chars, period with non-white,
quoted string
+ (qrhl-forward-regex "\\([^.{(\"]+\\|\\.[^
\t\n]\\|\"\\([^\"]+\\)\"\\)")
+ (and (looking-at "[{(]") (forward-list))
+ ))
+ (and (qrhl-forward-regex "\\.") (point))
+ ))))
+ (princ pos)
+ (and pos (goto-char pos) t)))
+
+(defun qrhl-parse-focus-command ()
+ (and (looking-at qrhl-focus-cmd-regexp)
+ (goto-char (match-end 0))))
+
(defun qrhl-proof-script-parse-function ()
- "Finds the command starting at the point"
- (or (and (looking-at qrhl-focus-cmd-regexp)
- (goto-char (match-end 0))
- 'cmd)
- (proof-script-generic-parse-cmdend)))
+ "Finds the command/comment starting at the point"
+ (or (and (qrhl-forward-regex "#[^\n]*\n") 'comment)
+ (and (qrhl-parse-focus-command) 'cmd)
+ (and (qrhl-parse-regular-command) 'cmd)))
(proof-easy-config 'qrhl "qRHL"
proof-prog-name (concat qrhl-home "bin/qrhl")
@@ -29,11 +53,11 @@
; as a shell command which leads to problems if the path
contains spaces
; (see the documentation for proof-prog-name)
qrhl-prog-args '("--emacs")
- proof-script-command-end-regexp "\\.[ \t]*$"
+ ;proof-script-command-end-regexp "\\.[ \t]*$"
proof-script-parse-function 'qrhl-proof-script-parse-function
proof-shell-annotated-prompt-regexp
"^\\(\\.\\.\\.\\|qrhl\\)> "
- proof-script-comment-start-regexp "#"
- proof-script-comment-end "\n"
+ ;proof-script-comment-start-regexp "#"
+ ;proof-script-comment-end "\n"
proof-shell-error-regexp "^\\(\\[ERROR\\]\\|Exception\\)"
proof-undo-n-times-cmd "undo %s."
proof-find-and-forget-fn 'qrhl-find-and-forget
- [nongnu] elpa/proof-general updated (df19c7ba0e -> fe8b9fccb3), ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general 57a9d9ea91 05/25: qrhl: support for several commands on the same line.,
ELPA Syncer <=
- [nongnu] elpa/proof-general 0aaf95edba 10/25: Removed setting proof-tree-external-display in `qrhl.el`., ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general b580e5f274 08/25: Updated autogenerated parts of PQ-adapting.texi., ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general 2d3f422b01 11/25: Mentioning qrhl-tool in README.md, ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general 553b2dc093 09/25: Added (require 'proof) to qrhl.el, ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general 543aa777d7 14/25: Made path to qrhl-tool customizable., ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general 232c7ccae1 18/25: qrhl: Ensure UTF-8 via `proof-shell-unicode` instead of `set-language-environment`., ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general ff22652025 17/25: qrhl: Font-lock support (keywords and sub/superscripts), ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general b49220f634 01/25: Added qRHL support from qrhl-tool repo, ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general 80aac72a7a 02/25: Fix: proof-tree-external-display := nil, otherwise ProofGeneral fails, ELPA Syncer, 2022/02/28
- [nongnu] elpa/proof-general ee01e75c66 03/25: qrhl-mode recognizes focus commands (e.g. '1-2: ++'), ELPA Syncer, 2022/02/28