|
3 | 3 | ;; Copyright (C) 2016–2024 Tamas K. Papp |
4 | 4 | ;; Author: Tamas Papp <tkpapp@gmail.com> |
5 | 5 | ;; Keywords: languages |
6 | | -;; Version: 1.5.1 |
| 6 | +;; Version: 1.5.2 |
7 | 7 | ;; Package-Requires: ((emacs "29.1")(s "1.12")) |
8 | 8 | ;; URL: https://github.com/tpapp/julia-repl |
9 | 9 |
|
@@ -268,14 +268,29 @@ When PASTE-P, “bracketed paste” mode will be used. When RET-P, terminate wit |
268 | 268 | (when ret-p |
269 | 269 | (eat-term-send-string eat-terminal "\^M"))))) |
270 | 270 |
|
| 271 | +;;; compiler output regexps for navigation |
| 272 | + |
| 273 | +(defconst julia-repl--CR-path |
| 274 | + (rx (+ (not (any space ">" "<" "(" ")" "\t" "\n" "," "'" "\"" ";" ":")))) |
| 275 | + "A regexp matching paths (in Julia stacktraces).") |
| 276 | + |
271 | 277 | (defconst julia-repl--CR-at |
272 | | - (rx "@" space |
273 | | - (? (group (one-or-more (or (any "._") alnum))) space) ; group 1: module name |
274 | | - (group (+ (not (any space ">" "<" "(" ")" "\t" "\n" "," "'" "\"" ";" ":")))) ; group 2: path |
275 | | - ":" |
276 | | - (group (+ num)) ; group 3: line number |
277 | | - ) |
278 | | - "Matches “@ Foo ~/code/Foo/src/Foo.jl:100”. This is what is used in Julia >= 1.6") |
| 278 | + (rx "@" space |
| 279 | + (? (group (one-or-more (or (any "._") alnum))) space) ; group 1: module name |
| 280 | + (group (regexp julia-repl--CR-path)) ; group 2: path |
| 281 | + ":" |
| 282 | + (group (+ num)) ; group 3: line number |
| 283 | + ) |
| 284 | + "Matches “@ Foo ~/code/Foo/src/Foo.jl:100”. This is what is used in Julia >= 1.6") |
| 285 | + |
| 286 | +(defconst julia-repl--CR-expression-starting |
| 287 | + (rx "in expression starting at" |
| 288 | + (+ space) |
| 289 | + (group (regexp julia-repl--CR-path)) ; group 1: path |
| 290 | + ":" |
| 291 | + (group (+ num)) ; group 2: line |
| 292 | + ) |
| 293 | + "Matches “in expression starting at ~/code/Foo/src/Foo.jl:100”.") |
279 | 294 |
|
280 | 295 | (defconst julia-repl--CR-filename |
281 | 296 | (rx (one-or-more (not (any " ><()\t\n,'\";:")))) |
@@ -394,7 +409,8 @@ a new Julia process is started.") |
394 | 409 | "Return an alist suitable for use in `compilation-error-regexp-alist' for recognizing Julia error locations. |
395 | 410 |
|
396 | 411 | Cf `julia-repl-compilation-location-legacy'." |
397 | | - (let ((regexp-alist `((,julia-repl--CR-at 2 3)))) |
| 412 | + (let ((regexp-alist `((,julia-repl--CR-at 2 3) |
| 413 | + (,julia-repl--CR-expression-starting 1 2)))) |
398 | 414 | (if julia-repl-compilation-location-legacy |
399 | 415 | (cons regexp-alist |
400 | 416 | `((,julia-repl--CR-load-error 1 2) (,julia-repl--CR-around 1 2))) |
@@ -644,7 +660,7 @@ This is the standard entry point for using this package." |
644 | 660 | "Switch to the buffer that was active before last call to `julia-repl'." |
645 | 661 | (interactive) |
646 | 662 | (when (buffer-live-p julia-repl--script-buffer) |
647 | | - (if julia-repl-pop-to-buffer |
| 663 | + (if julia-repl-pop-to-buffer |
648 | 664 | (switch-to-buffer-other-window julia-repl--script-buffer) |
649 | 665 | (switch-to-buffer julia-repl--script-buffer)))) |
650 | 666 |
|
|
0 commit comments