136
136
; ; some modules, returning () instead. Remove this (and the
137
137
; ; surrounding (if fc)) after Idris 0.9.17, which contains a fix.
138
138
(idris-update-loaded-region
139
- `((:filename ,(cdr ( idris-filename-to-load) ))
139
+ `((:filename ,(idris-filename-to-load))
140
140
(:start 1 1 )
141
141
,`(:end ,(idris-get-line-num (point-max )) 1 )))))
142
142
168
168
(defun idris-filename-to-load ()
169
169
" Compute the working directory and filename to load in Idris.
170
170
Returning these as a cons."
171
- (let* ((fn (buffer-file-name ))
172
- (ipkg-srcdir (idris-ipkg-find-src-dir))
173
- (srcdir (or ipkg-srcdir (file-name-directory fn))))
174
- (when (and ; ; check that srcdir is prefix of filename - then load relative
175
- (> (length fn) (length srcdir))
176
- (string= (substring fn 0 (length srcdir)) srcdir))
177
- (setq fn (file-relative-name fn srcdir)))
178
- (cons srcdir fn)))
171
+ (buffer-file-name ))
179
172
180
173
(defun idris-load-file (&optional set-line )
181
174
" Pass the current buffer's file to the inferior Idris process.
@@ -201,12 +194,9 @@ A prefix argument SET-LINE forces loading but only up to the current line."
201
194
(with-current-buffer idris-notes-buffer-name
202
195
(let ((inhibit-read-only t )) (erase-buffer ))))
203
196
; ; Actually do the loading
204
- (let* ((dir-and-fn (idris-filename-to-load))
205
- (fn (cdr dir-and-fn))
206
- (srcdir (car dir-and-fn))
197
+ (let ((fn (idris-filename-to-load))
207
198
(idris-semantic-source-highlighting (idris-buffer-semantic-source-highlighting)))
208
199
(setq idris-currently-loaded-buffer nil )
209
- (idris-switch-working-directory srcdir)
210
200
(idris-delete-ibc t ) ; ; delete the ibc to avoid interfering with partial loads
211
201
(idris-toggle-semantic-source-highlighting)
212
202
(idris-eval-async
@@ -266,11 +256,9 @@ This sets the load position to point, if there is one."
266
256
(when (and idris-load-to-here
267
257
(< (marker-position idris-load-to-here) (point )))
268
258
(idris-load-to (point )))
269
- (let* ((dir-and-fn (idris-filename-to-load))
270
- (fn (cdr dir-and-fn))
271
- (srcdir (car dir-and-fn)))
259
+ (let ((fn (idris-filename-to-load)))
272
260
(setq idris-currently-loaded-buffer nil )
273
- (idris-switch-working-directory srcdir)
261
+ ; ; (idris-switch-working-directory srcdir)
274
262
(let ((result
275
263
(idris-eval
276
264
(if idris-load-to-here
0 commit comments