diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-06-17 03:25:44 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-06-17 03:25:44 +0200 |
commit | 59bacc785505fff98d0bc4b05ce9fa51464f832e (patch) | |
tree | 989ab1d69c078f17e3a52265e4097347215a26b5 | |
parent | 157aaf018dd876c00819d75fda7791fc244513be (diff) | |
download | geiser-59bacc785505fff98d0bc4b05ce9fa51464f832e.tar.gz geiser-59bacc785505fff98d0bc4b05ce9fa51464f832e.tar.bz2 |
Refactoring.
-rw-r--r-- | elisp/geiser-plt.el | 17 |
1 files changed, 8 insertions, 9 deletions
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)))) |