aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorDavid Aspinall2009-09-16 09:25:59 +0000
committerDavid Aspinall2009-09-16 09:25:59 +0000
commitadcd209ec76e6899c98518766f88f4e18a669cbe (patch)
tree5f0c77bcfbe6538b1362dc368bb63c52462d0352 /generic
parentb1472fb627a847b610ff82a2ebdf85241576169b (diff)
pg-last-output-displayform: protect against empty string
Diffstat (limited to 'generic')
-rw-r--r--generic/proof-script.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/generic/proof-script.el b/generic/proof-script.el
index 9ba6b46f..fac7c642 100644
--- a/generic/proof-script.el
+++ b/generic/proof-script.el
@@ -643,17 +643,18 @@ NAME does not need to be unique."
(defun pg-last-output-displayform ()
"Return displayable form of `proof-shell-last-output'."
- (let ((text (proof-shell-strip-output-markup
- (if (and (boundp 'unicode-tokens-mode)
- unicode-tokens-mode)
- (unicode-tokens-encode-str proof-shell-last-output)
- proof-shell-last-output))))
- ;; NOTE: hack for Isabelle which puts ugly leading \n's around proofstate.
- (if (string= (substring text 0 1) "\n")
- (setq text (substring text 1)))
- (if (string= (substring text -1) "\n")
- (setq text (substring text 0 -1)))
- text))
+ (if (string= proof-shell-last-output "") ""
+ (let ((text (proof-shell-strip-output-markup
+ (if (and (boundp 'unicode-tokens-mode)
+ unicode-tokens-mode)
+ (unicode-tokens-encode-str proof-shell-last-output)
+ proof-shell-last-output))))
+ ;; NOTE: hack for Isabelle which puts ugly leading \n's around proofstate.
+ (if (string= (substring text 0 1) "\n")
+ (setq text (substring text 1)))
+ (if (string= (substring text -1) "\n")
+ (setq text (substring text 0 -1)))
+ text)))
;;;###autoload
(defun pg-set-span-helphighlights (span &optional mouseface face)