2

I am the author of the julia-repl package, which runs an inferior Julia REPL inside ansi-term. A full terminal is necessary because of color and terminal interactions. I need some help extending this to make error locations "clickable".

Julia error messages look like this:

julia> Foo.foo()
ERROR: DomainError:
Stacktrace:
 [1] foo() at /tmp/Foo.jl:2

I would like to make the /tmp/Foo.jl:2 "clickable", so that a mouse click takes the user to line 2 of /tmp/Foo.jl.

I started reading the relevant section of the Emacs manual but need some help implementing this. In particular,

  1. what's the best way to find these snippets of text with a regex?
  2. how to run this each time the buffer changes?
  3. can I run this on only the new output?
  4. how to specify a particular line of a file as a target?

I am happy to do some reading and study existing examples, but don't know where to start. A minimal example would help a lot.

Tamas Papp
  • 43
  • 3
  • I recommend looking at the sources of modes that do this, such as [grep.el](http://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/progmodes/grep.el). – Steve Vinoski Oct 30 '17 at 12:35
  • As a user I'm not sure I'd want a solution based on full terminal emulation. If your "terminal interactions" are sufficiently limited, maybe you should look into simply adding support for colors (it's a one-liner) and for those terminal interactions to comint (or replacement thereof). – Stefan Oct 30 '17 at 13:15

1 Answers1

0

Ideally you'd want to use something like compilation-shell-minor-mode. But I'm not sure how/if it can work in an ansi-term buffer.

Stefan
  • 27,908
  • 4
  • 53
  • 82