summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-06-17 03:14:45 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-06-17 03:14:45 +0200
commit157aaf018dd876c00819d75fda7791fc244513be (patch)
tree9cec03d94770ecc1a1c9cba8e6ea0150e0eb1f9f /elisp
parente9b6d59467d736d89588c7575d9ff9f4c921c34a (diff)
downloadgeiser-157aaf018dd876c00819d75fda7791fc244513be.tar.gz
geiser-157aaf018dd876c00819d75fda7791fc244513be.tar.bz2
PLT: buttonize errors implemented.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-plt.el39
1 files changed, 38 insertions, 1 deletions
diff --git a/elisp/geiser-plt.el b/elisp/geiser-plt.el
index 44312b9..6c50c99 100644
--- a/elisp/geiser-plt.el
+++ b/elisp/geiser-plt.el
@@ -24,6 +24,8 @@
;;; Code:
+(require 'geiser-edit)
+(require 'geiser-doc)
(require 'geiser-eval)
(require 'geiser-syntax)
(require 'geiser-custom)
@@ -121,13 +123,48 @@ This function uses `geiser-plt-init-file' if it exists."
;;; External help
+
(defun geiser-plt-external-help (symbol module)
(message "Requesting help for '%s'..." symbol)
- (geiser-eval--send/wait `(:eval (get-help ',symbol (:module ,module)) geiser/autodoc))
+ (geiser-eval--send/wait
+ `(:eval (get-help ',symbol (:module ,module)) geiser/autodoc))
(minibuffer-message "%s done" (current-message))
t)
+;;; Error display
+
+(defconst geiser-plt--file-rx-0 "^\\([^:\n\"]+\\):\\([0-9]+\\):\\([0-9]+\\)")
+(defconst geiser-plt--file-rx-1 "path:\"?\\([^>\"\n]+\\)\"?>")
+(defconst geiser-plt--file-rx-2 "module: \"\\([^>\"\n]+\\)\"")
+
+(defun geiser-plt--find-files (rx)
+ (save-excursion
+ (while (re-search-forward rx nil t)
+ (geiser-edit--make-link (match-beginning 1)
+ (match-end 1)
+ (match-string 1)
+ (match-string 2)
+ (match-string 3)))))
+
+(defun geiser-plt-display-error (module key msg)
+ (insert "Error: ")
+ (when key (geiser-doc--insert-button key nil 'plt))
+ (newline 2)
+ (when msg
+ (let ((p (point)))
+ (insert msg)
+ (let ((end (point)))
+ (goto-char p)
+ (geiser-plt--find-files geiser-plt--file-rx-0)
+ (geiser-plt--find-files geiser-plt--file-rx-1)
+ (geiser-plt--find-files geiser-plt--file-rx-2)
+ (goto-char end)
+ (fill-region p end)
+ (newline))))
+ t)
+
+
;;; Trying to ascertain whether a buffer is mzscheme scheme:
(defun geiser-plt-guess ()