diff options
author | Pierre Courtieu <courtieu@lri.fr> | 2010-04-12 12:25:21 +0000 |
---|---|---|
committer | Pierre Courtieu <courtieu@lri.fr> | 2010-04-12 12:25:21 +0000 |
commit | cbdd9b5f5a42a16f0b8dc5c26d4f8fdd6925f5df (patch) | |
tree | 2d27457adf1c60d9800bcb10076208bcee71be85 | |
parent | cfdca88d6bfa41d0d51320f2d8de6e6483c3feb8 (diff) |
Fix coq error utf8 underlining with coq-8.3beta.
-rw-r--r-- | coq/coq.el | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1252,7 +1252,7 @@ buffer." ;; proof-shell-handle-error-or-interrupt-hook is called from shell buffer (with-current-buffer proof-response-buffer (goto-char (point-max)) - (when (re-search-backward "\n> \\(.*\\)\n> \\( *\\)\\(\\^+\\)\n" nil t) + (when (re-search-backward "\n> \\(.*\\)\n> \\([^^]*\\)\\(\\^+\\)\n" nil t) (let ((text (match-string 1)) (pos (length (match-string 2))) (len (length (match-string 3)))) @@ -1260,11 +1260,13 @@ buffer." ;; parsed above. Don't kill the first \n (let ((inhibit-read-only t)) (when clean (delete-region (+ (match-beginning 0) 1) (match-end 0)))) - (when proof-shell-unicode - ;; `pos' and `len' are actually specified in bytes, apparently. - ;; So let's convert them, assuming the encoding used is utf-8. + (when proof-shell-unicode ;; TODO: remove this (when...) when coq-8.3 is out. + ;; `pos' and `len' are actually specified in bytes, apparently. So + ;; let's convert them, assuming the encoding used is utf-8. ;; Presumably in Emacs-23 we could use `string-bytes' for that ;; since the internal encoding happens to use utf-8 as well. + ;; Actually in coq-8.3 one utf8 char = one space so we do not need + ;; this at all (let ((bytes (encode-coding-string text 'utf-8-unix))) ;; Check that pos&len make sense in `bytes', if not give up. (when (>= (length bytes) (+ pos len)) |