Skip to content

Add Guile's %load-path to Emacs' compilation-search-path

The code below, taken from my configuration file, adds Guile's %load-path to Emacs' compilation-search-path.

(with-eval-after-load 'geiser-guile
  (require 'compile)
  (let* ((shell-command "guile -c '(write %load-path)'")
         (shell-output (shell-command-to-string shell-command))
         (load-paths (car (read-from-string shell-output))))
    (dolist (path load-paths)
      (add-to-list 'compilation-search-path path))))

As a result, compile-goto-error works for Guile modules, e.g.

Screen_Shot_2022-02-10_at_08.51.55

Perhaps geiser-guile could ship with something like this?

Edited by Rudolf Adamkovič