From 59bacc785505fff98d0bc4b05ce9fa51464f832e Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Wed, 17 Jun 2009 03:25:44 +0200 Subject: Refactoring. --- elisp/geiser-plt.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'elisp') diff --git a/elisp/geiser-plt.el b/elisp/geiser-plt.el index 6c50c99..2fbfb22 100644 --- a/elisp/geiser-plt.el +++ b/elisp/geiser-plt.el @@ -134,9 +134,9 @@ This function uses `geiser-plt-init-file' if it exists." ;;; 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]+\\)\"") +(defconst geiser-plt--file-rxs '("^\\([^:\n\"]+\\):\\([0-9]+\\):\\([0-9]+\\)" + "path:\"?\\([^>\"\n]+\\)\"?>" + "module: \"\\([^>\"\n]+\\)\"")) (defun geiser-plt--find-files (rx) (save-excursion @@ -148,17 +148,16 @@ This function uses `geiser-plt-init-file' if it exists." (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 key + (insert "Error: ") + (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) + (mapc 'geiser-plt--find-files geiser-plt--file-rxs) (goto-char end) (fill-region p end) (newline)))) -- cgit v1.2.3