@@ -180,7 +180,7 @@ A prefix argument SET-LINE forces loading but only up to the current line."
180
180
(idris-load-to (point ))
181
181
(idris-make-dirty))
182
182
(when (and set-line (= set-line 16 )) (idris-no-load-to))
183
- (if ( buffer-file-name )
183
+ (if-let ((fn (idris-filename-to-load)) )
184
184
(when (idris-current-buffer-dirty-p)
185
185
(when idris-prover-currently-proving
186
186
(if (y-or-n-p (format " %s is open in the prover. Abandon and load? "
@@ -194,8 +194,7 @@ A prefix argument SET-LINE forces loading but only up to the current line."
194
194
(with-current-buffer idris-notes-buffer-name
195
195
(let ((inhibit-read-only t )) (erase-buffer ))))
196
196
; ; Actually do the loading
197
- (let ((fn (idris-filename-to-load))
198
- (idris-semantic-source-highlighting (idris-buffer-semantic-source-highlighting)))
197
+ (let ((idris-semantic-source-highlighting (idris-buffer-semantic-source-highlighting)))
199
198
(setq idris-currently-loaded-buffer nil )
200
199
(idris-delete-ibc t ) ; ; delete the ibc to avoid interfering with partial loads
201
200
(idris-toggle-semantic-source-highlighting)
@@ -250,24 +249,22 @@ A prefix argument SET-LINE forces loading but only up to the current line."
250
249
This sets the load position to point, if there is one."
251
250
(save-buffer )
252
251
(idris-ensure-process-and-repl-buffer)
253
- (if ( buffer-file-name )
252
+ (if-let ((fn (idris-filename-to-load)) )
254
253
(unless (idris-position-loaded-p (point ))
255
254
(idris-warning-reset-all)
256
255
(when (and idris-load-to-here
257
256
(< (marker-position idris-load-to-here) (point )))
258
257
(idris-load-to (point )))
259
- (let ((fn (idris-filename-to-load)))
260
- (setq idris-currently-loaded-buffer nil )
261
- ; ; (idris-switch-working-directory srcdir)
262
- (let ((result
263
- (idris-eval
264
- (if idris-load-to-here
265
- `(:load-file , fn ,(idris-get-line-num idris-load-to-here))
266
- `(:load-file , fn )))))
267
- (idris-update-options-cache)
268
- (setq idris-currently-loaded-buffer (current-buffer ))
269
- (idris-make-clean)
270
- (idris-update-loaded-region (car result)))))
258
+ (setq idris-currently-loaded-buffer nil )
259
+ (let ((result
260
+ (idris-eval
261
+ (if idris-load-to-here
262
+ `(:load-file , fn ,(idris-get-line-num idris-load-to-here))
263
+ `(:load-file , fn )))))
264
+ (idris-update-options-cache)
265
+ (setq idris-currently-loaded-buffer (current-buffer ))
266
+ (idris-make-clean)
267
+ (idris-update-loaded-region (car result))))
271
268
(error " Cannot find file for current buffer " )))
272
269
273
270
0 commit comments