Skip to content
Newer
Older
100644 721 lines (648 sloc) 30.7 KB
4418871 New file.
monnier authored Nov 24, 2004
1 ;;; inf-haskell.el --- Interaction with an inferior Haskell process.
2
d549980 (inferior-haskell-type, inferior-haskell-info):
monnier authored Feb 2, 2009
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
4418871 New file.
monnier authored Nov 25, 2004
4
5 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
6 ;; Keywords: Haskell
7
8 ;; This file is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
30d658f (displayed-month): Remove declaration since it's not used here.
monnier authored Jul 30, 2007
10 ;; the Free Software Foundation; either version 3, or (at your option)
4418871 New file.
monnier authored Nov 25, 2004
11 ;; any later version.
12
13 ;; This file is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs; see the file COPYING. If not, write to
20 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
22
23 ;;; Commentary:
24
25 ;; The code is made of 2 parts: a major mode for the buffer that holds the
225a7c5 (inferior-haskell-load-file): Quote file name.
monnier authored Jan 26, 2005
26 ;; inferior process's session and a minor mode for use in source buffers.
4418871 New file.
monnier authored Nov 25, 2004
27
3e6c2e0 *** empty log message ***
monnier authored Aug 29, 2007
28 ;; Todo:
29
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 6, 2007
30 ;; - Check out Shim for ideas.
9ed46b1 (inferior-haskell-load-file): Re-add the `reload' arg.
monnier authored Aug 29, 2007
31 ;; - i-h-load-buffer and i-h-send-region.
3e6c2e0 *** empty log message ***
monnier authored Aug 29, 2007
32
4418871 New file.
monnier authored Nov 25, 2004
33 ;;; Code:
34
35 (require 'comint)
36 (require 'shell) ;For directory tracking.
37 (require 'compile)
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 9, 2007
38 (require 'haskell-mode)
7410480 (inferior-haskell-wait-for-prompt): New fun, extracted
monnier authored May 18, 2006
39 (eval-when-compile (require 'cl))
4418871 New file.
monnier authored Nov 25, 2004
40
4456be9 (subst-char-in-string, make-temp-file): Add fallback definitions for …
monnier authored Feb 28, 2008
41 ;; XEmacs compatibility.
42
43 (unless (fboundp 'subst-char-in-string)
44 (defun subst-char-in-string (fromchar tochar string &optional inplace)
45 ;; This is Haskell-mode, we don't want no stinkin' `aset'.
46 (apply 'string (mapcar (lambda (c) (if (eq c fromchar) tochar c)) string))))
47
48 (unless (fboundp 'make-temp-file)
49 (defun make-temp-file (prefix &optional dir-flag)
50 (catch 'done
51 (while t
52 (let ((f (make-temp-name (expand-file-name prefix (temp-directory)))))
53 (condition-case ()
54 (progn
55 (if dir-flag (make-directory f)
56 (write-region "" nil f nil 'silent nil))
57 (throw 'done f))
58 (file-already-exists t)))))))
947a32d (inferior-haskell-info-xref-re): Allow a column-range.
monnier authored May 12, 2008
59
94ad4fc (inferior-haskell-cabal-of-buf): Don't return
monnier authored Jul 3, 2008
60 (unless (fboundp 'replace-regexp-in-string)
61 (defun replace-regexp-in-string (regexp rep string)
62 (replace-in-string string regexp rep)))
4456be9 (subst-char-in-string, make-temp-file): Add fallback definitions for …
monnier authored Feb 28, 2008
63
4418871 New file.
monnier authored Nov 25, 2004
64 ;; Here I depart from the inferior-haskell- prefix.
65 ;; Not sure if it's a good idea.
27cc26c (haskell-program-name): Use ghci if hugs is absent.
monnier authored Dec 10, 2004
66 (defcustom haskell-program-name
67 ;; Arbitrarily give preference to hugs over ghci.
68 (or (cond
69 ((not (fboundp 'executable-find)) nil)
70 ((executable-find "hugs") "hugs \"+.\"")
71 ((executable-find "ghci") "ghci"))
72 "hugs \"+.\"")
4418871 New file.
monnier authored Nov 25, 2004
73 "The name of the command to start the inferior Haskell process.
74 The command can include arguments."
8b661ca (haskell-program-name): Fix defcustom delcaration.
monnier authored Jul 18, 2005
75 ;; Custom only supports the :options keyword for a few types, e.g. not
76 ;; for string.
77 ;; :options '("hugs \"+.\"" "ghci")
4418871 New file.
monnier authored Nov 25, 2004
78 :group 'haskell
79 :type '(choice string (repeat string)))
80
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
81 (defconst inferior-haskell-info-xref-re
947a32d (inferior-haskell-info-xref-re): Allow a column-range.
monnier authored May 13, 2008
82 "\t-- Defined at \\(.+\\):\\([0-9]+\\):\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?$")
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
83
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
84 (defconst inferior-haskell-module-re
85 "\t-- Defined in \\(.+\\)$"
86 "Regular expression for matching module names in :info.")
87
4418871 New file.
monnier authored Nov 25, 2004
88 (defconst inferior-haskell-error-regexp-alist
89 ;; The format of error messages used by Hugs.
e19bf49 (inferior-haskell-error-regexp-alist): Fix GHCi regexp, support warni…
monnier authored Nov 14, 2005
90 `(("^ERROR \"\\(.+?\\)\"\\(:\\| line \\)\\([0-9]+\\) - " 1 3)
4418871 New file.
monnier authored Nov 25, 2004
91 ;; Format of error messages used by GHCi.
a9fe15b (inferior-haskell-error-regexp-alist): Be more careful
monnier authored Jun 12, 2007
92 ("^\\(.+?\\):\\([0-9]+\\):\\(\\([0-9]+\\):\\)?\\( \\|\n *\\)\\(Warning\\)?"
93 1 2 4 ,@(if (fboundp 'compilation-fake-loc)
94 '((6) nil (5 '(face nil font-lock-multiline t)))))
5a72afa (inferior-haskell-error-regexp-alist): Add entries for GHCI's excepti…
monnier authored Jun 7, 2007
95 ;; Runtime exceptions, from ghci.
96 ("^\\*\\*\\* Exception: \\(.+?\\):(\\([0-9]+\\),\\([0-9]+\\))-(\\([0-9]+\\),\\([0-9]+\\)): .*"
97 1 ,@(if (fboundp 'compilation-fake-loc) '((2 . 4) (3 . 5)) '(2 3)))
a9fe15b (inferior-haskell-error-regexp-alist): Be more careful
monnier authored Jun 12, 2007
98 ;; GHCi uses two different forms for line/col ranges, depending on
ff46f40 (inferior-haskell-error-regexp-alist):
monnier authored Jun 26, 2007
99 ;; whether it's all on the same line or not :-( In Emacs-23, I could use
100 ;; explicitly numbered subgroups to merge the two patterns.
5a72afa (inferior-haskell-error-regexp-alist): Add entries for GHCI's excepti…
monnier authored Jun 7, 2007
101 ("^\\*\\*\\* Exception: \\(.+?\\):\\([0-9]+\\):\\([0-9]+\\)-\\([0-9]+\\): .*"
102 1 2 ,(if (fboundp 'compilation-fake-loc) '(3 . 4) 3))
a9fe15b (inferior-haskell-error-regexp-alist): Be more careful
monnier authored Jun 12, 2007
103 ;; Info messages. Not errors per se.
ff46f40 (inferior-haskell-error-regexp-alist):
monnier authored Jun 27, 2007
104 ,@(when (fboundp 'compilation-fake-loc)
105 `(;; Other GHCi patterns used in type errors.
106 ("^[ \t]+at \\(.+\\):\\([0-9]+\\):\\([0-9]+\\)-\\([0-9]+\\)$"
107 1 2 (3 . 4) 0)
108 ;; Foo.hs:318:80:
109 ;; Ambiguous occurrence `Bar'
110 ;; It could refer to either `Bar', defined at Zork.hs:311:5
111 ;; or `Bar', imported from Bars at Frob.hs:32:0-16
112 ;; (defined at Location.hs:97:5)
113 ("[ (]defined at \\(.+\\):\\([0-9]+\\):\\([0-9]+\\))?$" 1 2 3 0)
114 ("imported from .* at \\(.+\\):\\([0-9]+\\):\\([0-9]+\\)-\\([0-9]+\\)$"
115 1 2 (3 . 4) 0)
116 ;; Info xrefs.
947a32d (inferior-haskell-info-xref-re): Allow a column-range.
monnier authored May 13, 2008
117 (,inferior-haskell-info-xref-re 1 2 (3 . 4) 0))))
4418871 New file.
monnier authored Nov 25, 2004
118 "Regexps for error messages generated by inferior Haskell processes.
119 The format should be the same as for `compilation-error-regexp-alist'.")
120
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
121 (defcustom inferior-haskell-find-project-root t
122 "If non-nil, try and find the project root directory of this file.
123 This will either look for a Cabal file or a \"module\" statement in the file."
68daaf2 @loveshack Add missing `:group's to defcustoms.
loveshack authored Nov 11, 2009
124 :group 'haskell
c7c6278 (inferior-haskell-use-cabal): New custom var.
monnier authored May 8, 2007
125 :type 'boolean)
126
4418871 New file.
monnier authored Nov 25, 2004
127 (define-derived-mode inferior-haskell-mode comint-mode "Inf-Haskell"
128 "Major mode for interacting with an inferior Haskell process."
129 (set (make-local-variable 'comint-prompt-regexp)
1d2f932 @loveshack Allow non-ASCII names.
loveshack authored Nov 5, 2009
130 ;; Whay the backslash in [\\._[:alnum:]]?
131 "^\\*?[[:upper:]][\\._[:alnum:]]*\\(?: \\*?[[:upper:]][\\._[:alnum:]]*\\)*> ")
4418871 New file.
monnier authored Nov 25, 2004
132 (set (make-local-variable 'comint-input-autoexpand) nil)
ce971bb (inferior-haskell-spot-prompt): New function.
monnier authored May 12, 2008
133 (add-hook 'comint-output-filter-functions 'inferior-haskell-spot-prompt nil t)
4418871 New file.
monnier authored Nov 25, 2004
134
135 ;; Setup directory tracking.
136 (set (make-local-variable 'shell-cd-regexp) ":cd")
bbbe054 (inferior-haskell-mode): Use shell-dirtrack-mode if possible.
monnier authored May 17, 2006
137 (condition-case nil
138 (shell-dirtrack-mode 1)
139 (error ;The minor mode function may not exist or not accept an arg.
140 (set (make-local-variable 'shell-dirtrackp) t)
141 (add-hook 'comint-input-filter-functions 'shell-directory-tracker
142 nil 'local)))
4418871 New file.
monnier authored Nov 25, 2004
143
144 ;; Setup `compile' support so you can just use C-x ` and friends.
145 (set (make-local-variable 'compilation-error-regexp-alist)
146 inferior-haskell-error-regexp-alist)
5a72afa (inferior-haskell-error-regexp-alist): Add entries for GHCI's excepti…
monnier authored Jun 7, 2007
147 (set (make-local-variable 'compilation-first-column) 0) ;GHCI counts from 0.
bfd15e1 (inferior-haskell-mode): Hide compilation-mode bindings.
monnier authored Nov 4, 2005
148 (if (and (not (boundp 'minor-mode-overriding-map-alist))
149 (fboundp 'compilation-shell-minor-mode))
150 ;; If we can't remove compilation-minor-mode bindings, at least try to
151 ;; use compilation-shell-minor-mode, so there are fewer
152 ;; annoying bindings.
153 (compilation-shell-minor-mode 1)
154 ;; Else just use compilation-minor-mode but without its bindings because
155 ;; things like mouse-2 are simply too annoying.
156 (compilation-minor-mode 1)
157 (let ((map (make-sparse-keymap)))
158 (dolist (keys '([menu-bar] [follow-link]))
159 ;; Preserve some of the bindings.
160 (define-key map keys (lookup-key compilation-minor-mode-map keys)))
161 (add-to-list 'minor-mode-overriding-map-alist
162 (cons 'compilation-minor-mode map)))))
4418871 New file.
monnier authored Nov 25, 2004
163
6784a8b (inferior-haskell-string-to-strings): Remove `separator' argument. Ca…
monnier authored May 8, 2007
164 (defun inferior-haskell-string-to-strings (string)
165 "Split the STRING into a list of strings."
166 (let ((i (string-match "[\"]" string)))
167 (if (null i) (split-string string) ; no quoting: easy
168 (append (unless (eq i 0) (split-string (substring string 0 i)))
4418871 New file.
monnier authored Nov 25, 2004
169 (let ((rfs (read-from-string string i)))
170 (cons (car rfs)
171 (inferior-haskell-string-to-strings
6784a8b (inferior-haskell-string-to-strings): Remove `separator' argument. Ca…
monnier authored May 8, 2007
172 (substring string (cdr rfs)))))))))
4418871 New file.
monnier authored Nov 25, 2004
173
174 (defun inferior-haskell-command (arg)
175 (inferior-haskell-string-to-strings
176 (if (null arg) haskell-program-name
6dd0f3a (inferior-haskell-command): Provide a default.
monnier authored Nov 11, 2005
177 (read-string "Command to run haskell: " haskell-program-name))))
4418871 New file.
monnier authored Nov 25, 2004
178
179 (defvar inferior-haskell-buffer nil
180 "The buffer in which the inferior process is running.")
181
182 (defun inferior-haskell-start-process (command)
183 "Start an inferior haskell process.
6784a8b (inferior-haskell-string-to-strings): Remove `separator' argument. Ca…
monnier authored May 8, 2007
184 With universal prefix \\[universal-argument], prompts for a COMMAND,
4418871 New file.
monnier authored Nov 25, 2004
185 otherwise uses `haskell-program-name'.
186 It runs the hook `inferior-haskell-hook' after starting the process and
187 setting up the inferior-haskell buffer."
188 (interactive (list (inferior-haskell-command current-prefix-arg)))
189 (setq inferior-haskell-buffer
190 (apply 'make-comint "haskell" (car command) nil (cdr command)))
191 (with-current-buffer inferior-haskell-buffer
192 (inferior-haskell-mode)
193 (run-hooks 'inferior-haskell-hook)))
194
195 (defun inferior-haskell-process (&optional arg)
196 (or (if (buffer-live-p inferior-haskell-buffer)
197 (get-buffer-process inferior-haskell-buffer))
198 (progn
199 (let ((current-prefix-arg arg))
200 (call-interactively 'inferior-haskell-start-process))
201 ;; Try again.
202 (inferior-haskell-process arg))))
203
204 ;;;###autoload
205 (defalias 'run-haskell 'switch-to-haskell)
206 ;;;###autoload
207 (defun switch-to-haskell (&optional arg)
208 "Show the inferior-haskell buffer. Start the process if needed."
209 (interactive "P")
210 (let ((proc (inferior-haskell-process arg)))
211 (pop-to-buffer (process-buffer proc))))
212
ce51306 (with-selected-window): Define while compiling.
monnier authored Feb 14, 2007
213 (eval-when-compile
214 (unless (fboundp 'with-selected-window)
215 (defmacro with-selected-window (win &rest body)
216 `(save-selected-window
217 (select-window ,win)
218 ,@body))))
6dd0f3a (inferior-haskell-command): Provide a default.
monnier authored Nov 11, 2005
219
7410480 (inferior-haskell-wait-for-prompt): New fun, extracted
monnier authored May 18, 2006
220 (defcustom inferior-haskell-wait-and-jump nil
221 "If non-nil, wait for file loading to terminate and jump to the error."
222 :type 'boolean
223 :group 'haskell)
224
ce971bb (inferior-haskell-spot-prompt): New function.
monnier authored May 13, 2008
225 (defvar inferior-haskell-seen-prompt nil)
226 (make-variable-buffer-local 'inferior-haskell-seen-prompt)
227
228 (defun inferior-haskell-spot-prompt (string)
229 (let ((proc (get-buffer-process (current-buffer))))
230 (when proc
231 (save-excursion
232 (goto-char (process-mark proc))
233 (if (re-search-backward comint-prompt-regexp
234 (line-beginning-position) t)
235 (setq inferior-haskell-seen-prompt t))))))
236
c6cbffc (inferior-haskell-wait-for-prompt): Add timeout arg.
monnier authored Feb 11, 2008
237 (defun inferior-haskell-wait-for-prompt (proc &optional timeout)
7410480 (inferior-haskell-wait-for-prompt): New fun, extracted
monnier authored May 18, 2006
238 "Wait until PROC sends us a prompt.
239 The process PROC should be associated to a comint buffer."
240 (with-current-buffer (process-buffer proc)
ce971bb (inferior-haskell-spot-prompt): New function.
monnier authored May 13, 2008
241 (while (progn
242 (goto-char comint-last-input-end)
243 (not (or inferior-haskell-seen-prompt
244 (setq inferior-haskell-seen-prompt
245 (re-search-forward comint-prompt-regexp nil t))
246 (not (accept-process-output proc timeout))))))
247 (unless inferior-haskell-seen-prompt
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
248 (error "Can't find the prompt"))))
7410480 (inferior-haskell-wait-for-prompt): New fun, extracted
monnier authored May 18, 2006
249
c7c6278 (inferior-haskell-use-cabal): New custom var.
monnier authored May 8, 2007
250 (defvar inferior-haskell-cabal-buffer nil)
251
252 (defun inferior-haskell-cabal-of-buf (buf)
253 (require 'haskell-cabal)
254 (with-current-buffer buf
94ad4fc (inferior-haskell-cabal-of-buf): Don't return
monnier authored Jul 4, 2008
255 (or (and (buffer-live-p inferior-haskell-cabal-buffer)
256 inferior-haskell-cabal-buffer)
439a89e (inferior-haskell-cabal-of-buf)
monnier authored Jan 31, 2008
257 (and (not (local-variable-p 'inferior-haskell-cabal-buffer
258 ;; XEmacs needs this argument.
837c948 (inferior-haskell-cabal-of-buf): Fix typo.
monnier authored Feb 18, 2008
259 (current-buffer)))
c7c6278 (inferior-haskell-use-cabal): New custom var.
monnier authored May 8, 2007
260 (set (make-local-variable 'inferior-haskell-cabal-buffer)
261 (haskell-cabal-find-file))))))
262
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
263 (defun inferior-haskell-find-project-root (buf)
264 (with-current-buffer buf
265 (let ((cabal (inferior-haskell-cabal-of-buf buf)))
266 (or (when cabal
267 (with-current-buffer cabal
f11a557 (inferior-haskell-find-project-root): Use it.
monnier authored Sep 26, 2007
268 (let ((hsd (haskell-cabal-get-setting "hs-source-dirs")))
269 (if (null hsd)
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
270 ;; If there's a Cabal file with no Hs-Source-Dirs, then
271 ;; just use the Cabal file's directory.
272 default-directory
273 ;; If there is an HSD, then check that it's an existing
274 ;; dir (otherwise, it may be a list of dirs and we don't
275 ;; know what to do with those). If it doesn't exist, then
276 ;; give up.
3afce2f (inferior-haskell-find-project-root): Minor simplification.
monnier authored Sep 26, 2007
277 (if (file-directory-p hsd) (expand-file-name hsd))))))
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
278 ;; If there's no Cabal file or it's not helpful, try to look for
279 ;; a "module" statement and count the number of "." in the
280 ;; module name.
281 (save-excursion
282 (goto-char (point-min))
283 (let ((case-fold-search nil))
284 (when (re-search-forward
285 "^module[ \t]+\\([^- \t\n]+\\.[^- \t\n]+\\)[ \t]+where\\>" nil t)
286 (let* ((dir default-directory)
287 (module (match-string 1))
288 (pos 0))
289 (while (string-match "\\." module pos)
290 (setq pos (match-end 0))
291 (setq dir (expand-file-name ".." dir)))
292 ;; Let's check that the module name matches the file name,
293 ;; otherwise the project root is probably not what we think.
294 (if (eq t (compare-strings
295 (file-name-sans-extension buffer-file-name)
296 nil nil
297 (expand-file-name
298 (replace-regexp-in-string "\\." "/" module)
299 dir)
300 nil nil t))
301 dir
302 ;; If they're not equal, it means the local directory
303 ;; hierarchy doesn't match the module name. This seems
304 ;; odd, so let's warn the user about it. May help us
305 ;; debug this code as well.
306 (message "Ignoring inconsistent `module' info: %s in %s"
307 module buffer-file-name)
308 nil)))))))))
947a32d (inferior-haskell-info-xref-re): Allow a column-range.
monnier authored May 13, 2008
309
310
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
311
4418871 New file.
monnier authored Nov 25, 2004
312 ;;;###autoload
9ed46b1 (inferior-haskell-load-file): Re-add the `reload' arg.
monnier authored Aug 30, 2007
313 (defun inferior-haskell-load-file (&optional reload)
0294d90 (inferior-haskell-load-file): Do reload if prefix arg.
monnier authored Sep 17, 2007
314 "Pass the current buffer's file to the inferior haskell process.
315 If prefix arg \\[universal-argument] is given, just reload the previous file."
8af5157 (inferior-haskell-load-file): Typo.
monnier authored Nov 11, 2007
316 (interactive "P")
2eaced4 (inferior-haskell-load-file): Save buffer before using buffer-file-name.
monnier authored May 3, 2007
317 ;; Save first, so we're sure that `buffer-file-name' is non-nil afterward.
318 (save-buffer)
c7c6278 (inferior-haskell-use-cabal): New custom var.
monnier authored May 8, 2007
319 (let ((buf (current-buffer))
320 (file buffer-file-name)
4418871 New file.
monnier authored Nov 25, 2004
321 (proc (inferior-haskell-process)))
322 (with-current-buffer (process-buffer proc)
323 (compilation-forget-errors)
c7c6278 (inferior-haskell-use-cabal): New custom var.
monnier authored May 8, 2007
324 (let ((parsing-end (marker-position (process-mark proc)))
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
325 root)
c7c6278 (inferior-haskell-use-cabal): New custom var.
monnier authored May 8, 2007
326 ;; Go to the root of the Cabal project, if applicable.
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
327 (when (and inferior-haskell-find-project-root
328 (setq root (inferior-haskell-find-project-root buf)))
c7c6278 (inferior-haskell-use-cabal): New custom var.
monnier authored May 8, 2007
329 ;; Not sure if it's useful/needed and if it actually works.
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
330 (unless (equal default-directory root)
331 (setq default-directory root)
c7c6278 (inferior-haskell-use-cabal): New custom var.
monnier authored May 8, 2007
332 (inferior-haskell-send-command
333 proc (concat ":cd " default-directory)))
334 (setq file (file-relative-name file)))
9ed46b1 (inferior-haskell-load-file): Re-add the `reload' arg.
monnier authored Aug 30, 2007
335 (inferior-haskell-send-command
bd32a3c (inferior-haskell-load-file): Escape backslashes (and quotes) in file…
monnier authored Aug 26, 2008
336 proc (if reload ":reload"
337 (concat ":load \""
338 ;; Espace the backslashes that may occur in file names.
339 (replace-regexp-in-string "[\\\"]" "\\\\\&" file)
340 "\"")))
30d658f (displayed-month): Remove declaration since it's not used here.
monnier authored Jul 30, 2007
341 ;; Move the parsing-end marker *after* sending the command so
d8a5cc8 (inferior-haskell-load-file): Fix the compilation-parsing-end fiddlin…
monnier authored Nov 20, 2005
342 ;; that it doesn't point just to the insertion point.
343 ;; Otherwise insertion may move the marker (if done with
344 ;; insert-before-markers) and we'd then miss some errors.
345 (if (boundp 'compilation-parsing-end)
346 (if (markerp compilation-parsing-end)
347 (set-marker compilation-parsing-end parsing-end)
348 (setq compilation-parsing-end parsing-end))))
1cda384 (inferior-haskell-load-file): Simplify and make more
monnier authored Oct 19, 2006
349 (with-selected-window (display-buffer (current-buffer))
7410480 (inferior-haskell-wait-for-prompt): New fun, extracted
monnier authored May 18, 2006
350 (goto-char (point-max)))
30d658f (displayed-month): Remove declaration since it's not used here.
monnier authored Jul 30, 2007
351 ;; Use compilation-auto-jump-to-first-error if available.
352 ;; (if (and (boundp 'compilation-auto-jump-to-first-error)
353 ;; compilation-auto-jump-to-first-error
354 ;; (boundp 'compilation-auto-jump-to-next))
355 ;; (setq compilation-auto-jump-to-next t)
356 (when inferior-haskell-wait-and-jump
357 (inferior-haskell-wait-for-prompt proc)
358 (ignore-errors ;Don't beep if there were no errors.
359 (next-error)))))) ;; )
8512ba1 (inferior-haskell-mode): Typo.
monnier authored Nov 25, 2004
360
3afdf6b (inferior-haskell-run-command): New var.
monnier authored Jun 29, 2007
361 (defvar inferior-haskell-run-command ":main")
362
363 (defun inferior-haskell-load-and-run (command)
9ed46b1 (inferior-haskell-load-file): Re-add the `reload' arg.
monnier authored Aug 30, 2007
364 "Pass the current buffer's file to haskell and then run a COMMAND."
3afdf6b (inferior-haskell-run-command): New var.
monnier authored Jun 29, 2007
365 (interactive
366 (list
367 (if (and inferior-haskell-run-command (not current-prefix-arg))
368 inferior-haskell-run-command
369 (read-string "Command to run: " nil nil inferior-haskell-run-command))))
370 (setq inferior-haskell-run-command command)
40fa207 * inf-haskell.el (inferior-haskell-load-and-run): Don't run if there
monnier authored Jul 3, 2008
371 (let* ((inferior-haskell-errors nil)
372 (neh (lambda () (setq inferior-haskell-errors t))))
373 (unwind-protect
374 (let ((inferior-haskell-wait-and-jump t))
375 (add-hook 'next-error-hook neh)
376 (inferior-haskell-load-file))
377 (remove-hook 'next-error-hook neh))
378 (unless inferior-haskell-errors
379 (inferior-haskell-send-command (inferior-haskell-process) command)
380 (switch-to-haskell))))
3afdf6b (inferior-haskell-run-command): New var.
monnier authored Jun 29, 2007
381
8512ba1 (inferior-haskell-mode): Typo.
monnier authored Nov 26, 2004
382 (defun inferior-haskell-send-command (proc str)
383 (setq str (concat str "\n"))
384 (with-current-buffer (process-buffer proc)
7410480 (inferior-haskell-wait-for-prompt): New fun, extracted
monnier authored May 18, 2006
385 (inferior-haskell-wait-for-prompt proc)
8512ba1 (inferior-haskell-mode): Typo.
monnier authored Nov 26, 2004
386 (goto-char (process-mark proc))
387 (insert-before-markers str)
388 (move-marker comint-last-input-end (point))
ce971bb (inferior-haskell-spot-prompt): New function.
monnier authored May 13, 2008
389 (setq inferior-haskell-seen-prompt nil)
8512ba1 (inferior-haskell-mode): Typo.
monnier authored Nov 26, 2004
390 (comint-send-string proc str)))
4418871 New file.
monnier authored Nov 25, 2004
391
9ed46b1 (inferior-haskell-load-file): Re-add the `reload' arg.
monnier authored Aug 30, 2007
392 (defun inferior-haskell-reload-file ()
393 "Tell the inferior haskell process to reread the current buffer's file."
394 (interactive)
395 (inferior-haskell-load-file 'reload))
396
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
397 ;;;###autoload
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
398 (defun inferior-haskell-type (expr &optional insert-value)
399 "Query the haskell process for the type of the given expression.
400 If optional argument `insert-value' is non-nil, insert the type above point
401 in the buffer. This can be done interactively with the \\[universal-argument] prefix.
402 The returned info is cached for reuse by `haskell-doc-mode'."
403 (interactive
404 (let ((sym (haskell-ident-at-point)))
405 (list (read-string (if (> (length sym) 0)
406 (format "Show type of (default %s): " sym)
407 "Show type of: ")
408 nil nil sym)
409 current-prefix-arg)))
410 (if (string-match "\\`\\s_+\\'" expr) (setq expr (concat "(" expr ")")))
411 (let* ((proc (inferior-haskell-process))
412 (type
413 (with-current-buffer (process-buffer proc)
414 (let ((parsing-end ; Remember previous spot.
415 (marker-position (process-mark proc))))
416 (inferior-haskell-send-command proc (concat ":type " expr))
417 ;; Find new point.
418 (inferior-haskell-wait-for-prompt proc)
d549980 (inferior-haskell-type, inferior-haskell-info):
monnier authored Feb 2, 2009
419 (goto-char (point-max))
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
420 ;; Back up to the previous end-of-line.
421 (end-of-line 0)
422 ;; Extract the type output
423 (buffer-substring-no-properties
424 (save-excursion (goto-char parsing-end)
425 (line-beginning-position 2))
426 (point))))))
f846b94 @Baughn Patch courtesy of Alex Ott
Baughn authored Nov 1, 2009
427 (if (not (string-match (concat "^\\(" (regexp-quote expr) "[ \t\n]+::[ \t\n]*\\(.\\|\n\\)*\\)")
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
428 type))
429 (error "No type info: %s" type)
f846b94 @Baughn Patch courtesy of Alex Ott
Baughn authored Nov 1, 2009
430 (progn
431 (setf type (match-string 1 type))
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
432 ;; Cache for reuse by haskell-doc.
433 (when (and (boundp 'haskell-doc-mode) haskell-doc-mode
434 (boundp 'haskell-doc-user-defined-ids)
435 ;; Haskell-doc only works for idents, not arbitrary expr.
436 (string-match "\\`(?\\(\\s_+\\|\\(\\sw\\|\\s'\\)+\\)?[ \t]*::[ \t]*"
437 type))
438 (let ((sym (match-string 1 type)))
439 (setq haskell-doc-user-defined-ids
440 (cons (cons sym (substring type (match-end 0)))
ce971bb (inferior-haskell-spot-prompt): New function.
monnier authored May 13, 2008
441 (delq (assoc sym haskell-doc-user-defined-ids)
442 haskell-doc-user-defined-ids)))))
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
443
011c502 (inferior-haskell-type): Fix call to message.
monnier authored Jul 31, 2007
444 (if (interactive-p) (message "%s" type))
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
445 (when insert-value
446 (beginning-of-line)
447 (insert type "\n"))
f846b94 @Baughn Patch courtesy of Alex Ott
Baughn authored Nov 1, 2009
448 type))))
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
449
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
450 ;;;###autoload
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
451 (defun inferior-haskell-info (sym)
452 "Query the haskell process for the info of the given expression."
453 (interactive
454 (let ((sym (haskell-ident-at-point)))
455 (list (read-string (if (> (length sym) 0)
456 (format "Show info of (default %s): " sym)
457 "Show info of: ")
458 nil nil sym))))
459 (let ((proc (inferior-haskell-process)))
460 (with-current-buffer (process-buffer proc)
461 (let ((parsing-end ; Remember previous spot.
462 (marker-position (process-mark proc))))
463 (inferior-haskell-send-command proc (concat ":info " sym))
464 ;; Find new point.
465 (inferior-haskell-wait-for-prompt proc)
d549980 (inferior-haskell-type, inferior-haskell-info):
monnier authored Feb 2, 2009
466 (goto-char (point-max))
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
467 ;; Move to previous end-of-line
468 (end-of-line 0)
469 (let ((result
470 (buffer-substring-no-properties
471 (save-excursion (goto-char parsing-end)
472 (line-beginning-position 2))
473 (point))))
474 ;; Move back to end of process buffer
475 (goto-char (point-max))
476 (if (interactive-p) (message "%s" result))
477 result)))))
478
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
479 ;;;###autoload
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
480 (defun inferior-haskell-find-definition (sym)
481 "Attempt to locate and jump to the definition of the given expression."
482 (interactive
483 (let ((sym (haskell-ident-at-point)))
484 (list (read-string (if (> (length sym) 0)
485 (format "Find definition of (default %s): " sym)
486 "Find definition of: ")
487 nil nil sym))))
488 (let ((info (inferior-haskell-info sym)))
489 (if (not (string-match inferior-haskell-info-xref-re info))
490 (error "No source information available")
491 (let ((file (match-string-no-properties 1 info))
492 (line (string-to-number
493 (match-string-no-properties 2 info)))
494 (col (string-to-number
495 (match-string-no-properties 3 info))))
496 (when file
c6cbffc (inferior-haskell-wait-for-prompt): Add timeout arg.
monnier authored Feb 11, 2008
497 (with-current-buffer (process-buffer (inferior-haskell-process))
498 ;; The file name is relative to the process's cwd.
499 (setq file (expand-file-name file)))
36dd8bd (inferior-haskell-info-xref-re): New cst.
monnier authored Feb 10, 2007
500 ;; Push current location marker on the ring used by `find-tag'
501 (require 'etags)
502 (ring-insert find-tag-marker-ring (point-marker))
503 (pop-to-buffer (find-file-noselect file))
504 (when line
505 (goto-line line)
506 (when col (move-to-column col))))))))
507
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
508 ;;; Functions to find the documentation of a given function.
509 ;;
947a32d (inferior-haskell-info-xref-re): Allow a column-range.
monnier authored May 13, 2008
510 ;; TODO for this section:
511 ;;
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
512 ;; * Support fetching of local Haddock docs pulled directly from source files.
513 ;; * Display docs locally? w3m?
514
515 (defcustom inferior-haskell-use-web-docs
516 'fallback
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
517 "Whether to use the online documentation. Possible values:
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
518 `never', meaning always use local documentation, unless the local
519 file doesn't exist, when do nothing, `fallback', which means only
520 use the online documentation when the local file doesn't exist,
521 or `always', meaning always use the online documentation,
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
522 regardless of existance of local files. Default is `fallback'."
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
523 :group 'haskell
524 :type '(choice (const :tag "Never" never)
525 (const :tag "As fallback" fallback)
526 (const :tag "Always" always)))
527
528 (defcustom inferior-haskell-web-docs-base
529 "http://haskell.org/ghc/docs/latest/html/libraries/"
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
530 "The base URL of the online libraries documentation.
531 This will only be used if the value of `inferior-haskell-use-web-docs'
532 is `always' or `fallback'."
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
533 :group 'haskell
534 :type 'string)
535
536 (defcustom haskell-package-manager-name "ghc-pkg"
537 "Name of the program to consult regarding package details."
538 :group 'haskell
539 :type 'string)
540
541 (defcustom haskell-package-conf-file
744f5ce (haskell-package-conf-file): Don't use `ignore-errors'
monnier authored Dec 12, 2007
542 (condition-case nil
543 (with-temp-buffer
544 (call-process "ghc" nil t nil "--print-libdir")
545 (expand-file-name "package.conf"
546 (buffer-substring (point-min) (1- (point-max)))))
547 ;; Don't use `ignore-errors' because this form is not byte-compiled :-(
548 (error nil))
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
549 "Where the package configuration file for the package manager resides.
550 By default this is set to `ghc --print-libdir`/package.conf."
551 :group 'haskell
552 :type 'string)
553
554 (defun inferior-haskell-get-module (sym)
555 "Fetch the module in which SYM is defined."
556 (let ((info (inferior-haskell-info sym)))
557 (unless (string-match inferior-haskell-module-re info)
947a32d (inferior-haskell-info-xref-re): Allow a column-range.
monnier authored May 13, 2008
558 (error
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
559 "No documentation information available. Did you forget to C-c C-l?"))
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
560 (match-string-no-properties 1 info)))
561
562 (defun inferior-haskell-query-ghc-pkg (&rest args)
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
563 "Send ARGS to `haskell-package-manager-name'.
564 Insert the output into the current buffer."
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
565 (apply 'call-process haskell-package-manager-name nil t nil args))
566
567 (defun inferior-haskell-get-package-list ()
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
568 "Get the list of packages from `haskell-package-manager-name'."
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
569 (with-temp-buffer
570 (inferior-haskell-query-ghc-pkg "--simple-output" "list")
571 (split-string (buffer-substring (point-min) (point-max)))))
572
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
573 (defun inferior-haskell-compute-module-alist ()
574 "Compute a list mapping modules to package names and haddock URLs using ghc-pkg."
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
575 (message "Generating module alist...")
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
576 (let ((module-alist ()))
577 (with-temp-buffer
578 (dolist (package (inferior-haskell-get-package-list))
579 (erase-buffer)
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
580 (inferior-haskell-query-ghc-pkg "describe" package)
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
581
582 (let ((package-w/o-version
583 (replace-regexp-in-string "[-.0-9]*\\'" "" package))
584 ;; Find the Haddock documentation URL for this package
585 (haddock
586 (progn
587 (goto-char (point-min))
bf80267 (inferior-haskell-compute-module-alist): Fix regexps.
monnier authored Jun 29, 2007
588 (when (re-search-forward "haddock-html:[ \t]+\\(.*[^ \t\n]\\)"
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
589 nil t)
590 (match-string 1)))))
591
592 ;; Fetch the list of exposed modules for this package
593 (goto-char (point-min))
bf80267 (inferior-haskell-compute-module-alist): Fix regexps.
monnier authored Jun 29, 2007
594 (when (re-search-forward "^exposed-modules:\\(.*\\(\n[ \t].*\\)*\\)"
595 nil t)
596 (dolist (module (split-string (match-string 1)))
597 (push (list module package-w/o-version haddock)
598 module-alist)))))
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
599
600 (message "Generating module alist... done")
601 module-alist)))
602
603
604 (defcustom inferior-haskell-module-alist-file
605 ;; (expand-file-name "~/.inf-haskell-module-alist")
bf80267 (inferior-haskell-compute-module-alist): Fix regexps.
monnier authored Jun 29, 2007
606 (expand-file-name (concat "inf-haskell-module-alist-"
607 (number-to-string (user-uid)))
439a89e (inferior-haskell-cabal-of-buf)
monnier authored Jan 31, 2008
608 (if (fboundp 'temp-directory)
609 (temp-directory)
610 temporary-file-directory))
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
611 "Where to save the module -> package lookup table.
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
612 Set this to nil to never cache to a file."
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
613 :group 'haskell
614 :type '(choice (const :tag "Don't cache to file" nil) string))
615
616 (defvar inferior-haskell-module-alist nil
617 "Association list of modules to their packages.
618 Each element is of the form (MODULE PACKAGE HADDOCK), where
619 MODULE is the name of a module,
620 PACKAGE is the package it belongs to, and
621 HADDOCK is the path to that package's Haddock documentation.
622
623 This is calculated on-demand using `inferior-haskell-compute-module-alist'.
624 It's also cached in the file `inferior-haskell-module-alist-file',
625 so that it can be obtained more quickly next time.")
626
627 (defun inferior-haskell-module-alist ()
628 "Get the module alist from cache or ghc-pkg's info."
629 (or
630 ;; If we already have computed the alist, use it...
631 inferior-haskell-module-alist
632 (setq inferior-haskell-module-alist
633 (or
634 ;; ...otherwise try to read it from the cache file...
635 (and
636 inferior-haskell-module-alist-file
637 (file-readable-p inferior-haskell-module-alist-file)
638 (file-newer-than-file-p inferior-haskell-module-alist-file
639 haskell-package-conf-file)
640 (with-temp-buffer
641 (insert-file-contents inferior-haskell-module-alist-file)
642 (goto-char (point-min))
643 (prog1 (read (current-buffer))
644 (message "Read module alist from file cache."))))
645
646 ;; ...or generate it again and save it in a file for later.
647 (let ((alist (inferior-haskell-compute-module-alist)))
648 (when inferior-haskell-module-alist-file
6e300b7 (inferior-haskell-find-project-root): New var, to
monnier authored Sep 7, 2007
649 (with-temp-buffer
650 (print alist (current-buffer))
651 ;; Do the write to a temp file first, then rename it.
652 ;; This makes it more atomic, and suffers from fewer security
653 ;; holes related to race conditions if the file is in /tmp.
654 (let ((tmp (make-temp-file inferior-haskell-module-alist-file)))
655 (write-region (point-min) (point-max) tmp)
656 (rename-file tmp inferior-haskell-module-alist-file
657 'ok-if-already-exists))))
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
658 alist)))))
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
659
3afdf6b (inferior-haskell-run-command): New var.
monnier authored Jun 29, 2007
660 (defvar inferior-haskell-ghc-internal-ident-alist
661 ;; FIXME: Fill this table, ideally semi-automatically.
662 '(("GHC.Base.return" . "Control.Monad.return")
663 ("GHC.List" . "Data.List")))
664
665 (defun inferior-haskell-map-internal-ghc-ident (ident)
666 "Try to translate some internal GHC identifier to its alter ego in haskell docs."
667 (let ((head ident)
668 (tail "")
669 remapped)
670 (while (and (not
671 (setq remapped
672 (cdr (assoc head
673 inferior-haskell-ghc-internal-ident-alist))))
674 (string-match "\\.[^.]+\\'" head))
675 (setq tail (concat (match-string 0 head) tail))
676 (setq head (substring head 0 (match-beginning 0))))
677 (concat (or remapped head) tail)))
678
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
679 ;;;###autoload
680 (defun inferior-haskell-find-haddock (sym)
681 "Find and open the Haddock documentation of SYM.
682 Make sure to load the file into GHCi or Hugs first by using C-c C-l.
683 Only works for functions in a package installed with ghc-pkg, or
684 whatever the value of `haskell-package-manager-name' is.
685
686 This function needs to find which package a given module belongs
687 to. In order to do this, it computes a module-to-package lookup
688 alist, which is expensive to compute (it takes upwards of five
689 seconds with more than about thirty installed packages). As a
690 result, we cache it across sessions using the cache file
691 referenced by `inferior-haskell-module-alist-file'. We test to
692 see if this is newer than `haskell-package-conf-file' every time
693 we load it."
694 (interactive
695 (let ((sym (haskell-ident-at-point)))
696 (list (read-string (if (> (length sym) 0)
697 (format "Find documentation of (default %s): " sym)
698 "Find documentation of: ")
699 nil nil sym))))
3afdf6b (inferior-haskell-run-command): New var.
monnier authored Jun 29, 2007
700 (setq sym (inferior-haskell-map-internal-ghc-ident sym))
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
701 (let* (;; Find the module and look it up in the alist
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
702 (module (inferior-haskell-get-module sym))
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
703 (alist-record (assoc module (inferior-haskell-module-alist)))
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
704 (package (nth 1 alist-record))
705 (file-name (concat (subst-char-in-string ?. ?- module) ".html"))
706 (local-path (concat (nth 2 alist-record) "/" file-name))
707 (url (if (or (eq inferior-haskell-use-web-docs 'always)
708 (and (not (file-exists-p local-path))
709 (eq inferior-haskell-use-web-docs 'fallback)))
f2fd5e5 (inferior-haskell-find-haddock): Jump to the symbol anchor within Had…
monnier authored Feb 28, 2008
710 (concat inferior-haskell-web-docs-base package "/" file-name
711 ;; Jump to the symbol anchor within Haddock.
712 "#v:" sym)
b74e553 (inferior-haskell-module-alist-file): Use a file in /tmp rather than ~/.
monnier authored Jun 29, 2007
713 (and (file-exists-p local-path)
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
714 (concat "file://" local-path)))))
2b067d9 @loveshack Comment/doc/message fixes.
loveshack authored Nov 5, 2009
715 (if url (browse-url url) (error "Local file doesn't exist"))))
c5f1425 (inferior-haskell-module-alist-file)
monnier authored Jun 29, 2007
716
4418871 New file.
monnier authored Nov 25, 2004
717 (provide 'inf-haskell)
bfd15e1 (inferior-haskell-mode): Hide compilation-mode bindings.
monnier authored Nov 4, 2005
718
719 ;; arch-tag: 61804287-63dd-4052-bc0e-90f691b34b40
4418871 New file.
monnier authored Nov 25, 2004
720 ;;; inf-haskell.el ends here
Something went wrong with that request. Please try again.