File tree Expand file tree Collapse file tree 4 files changed +26
-12
lines changed Expand file tree Collapse file tree 4 files changed +26
-12
lines changed Original file line number Diff line number Diff line change 22
22
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23
23
; ; Customization variables
24
24
25
+ (defcustom haskell-process-load-or-reload-prompt nil
26
+ " Nil means there will be no prompts on starting REPL. Defaults will be accepted."
27
+ :type 'boolean
28
+ :group 'haskell-interactive )
29
+
25
30
(defgroup haskell nil
26
31
" Major mode for editing Haskell programs."
27
32
:link '(custom-manual " (haskell-mode)" )
Original file line number Diff line number Diff line change @@ -150,11 +150,14 @@ with all relevant buffers)."
150
150
(haskell-session-get s 'name ))
151
151
152
152
(defun haskell-session-target (s )
153
- " Get the session build target."
153
+ " Get the session build target.
154
+ If `haskell-process-load-or-reload-prompt' is nil, accept `default' ."
154
155
(let* ((maybe-target (haskell-session-get s 'target ))
155
156
(target (if maybe-target maybe-target
156
157
(let ((new-target
157
- (read-string " build target (empty for default):" )))
158
+ (if haskell-process-load-or-reload-prompt
159
+ (read-string " build target (empty for default):" )
160
+ " " )))
158
161
(haskell-session-set-target s new-target)))))
159
162
(if (not (string= target " " )) target nil )))
160
163
Original file line number Diff line number Diff line change 38
38
; ; require/depend-on any other haskell-mode modules in order to
39
39
; ; stay at the bottom of the module dependency graph.
40
40
41
+ (require 'haskell-customize )
42
+
41
43
(defvar haskell-utils-async-post-command-flag nil
42
44
" Non-nil means some commands were triggered during async function execution." )
43
45
(make-variable-buffer-local 'haskell-utils-async-post-command-flag )
44
46
45
47
(defun haskell-utils-read-directory-name (prompt default )
46
48
" Read directory name and normalize to true absolute path.
47
49
Refer to `read-directory-name' for the meaning of PROMPT and
48
- DEFAULT."
50
+ DEFAULT. If `haskell-process-load-or-reload-prompt' is nil, accept `default' . "
49
51
(let ((filename (file-truename
50
- (read-directory-name prompt
51
- default
52
- default ))))
53
- (concat (replace-regexp-in-string " /$" " " filename)
54
- " /" )))
52
+ (if haskell-process-load-or-reload-prompt
53
+ (read-directory-name prompt
54
+ default
55
+ default )
56
+ default ))))
57
+ (concat (replace-regexp-in-string " /$" " " filename) " /" )))
55
58
56
59
(defun haskell-utils-parse-import-statement-at-point ()
57
60
" Return imported module name if on import statement or nil otherwise.
Original file line number Diff line number Diff line change 29
29
(require 'haskell-modules )
30
30
(require 'haskell-string )
31
31
(require 'haskell-completions )
32
+ (require 'haskell-utils )
33
+ (require 'haskell-customize )
32
34
33
35
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
36
; ; Basic configuration hooks
169
171
session))
170
172
171
173
(defun haskell-session-new-assume-from-cabal ()
172
- " Prompt to create a new project based on a guess from the nearest Cabal file."
174
+ " Prompt to create a new project based on a guess from the nearest Cabal file.
175
+ If `haskell-process-load-or-reload-prompt' is nil, accept `default' ."
173
176
(let ((name (haskell-session-default-name)))
174
177
(unless (haskell-session-lookup name)
175
- (when ( y-or-n-p ( format " Start a new project named “ %s ”? "
176
- name))
177
- (haskell-session-make name)))))
178
+ (if ( or ( not haskell-process-load-or-reload-prompt)
179
+ ( y-or-n-p ( format " Start a new project named “ %s ”? " name) ))
180
+ (haskell-session-make name)))))
178
181
179
182
;;;### autoload
180
183
(defun haskell-session ()
You can’t perform that action at this time.
0 commit comments