diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2020-02-13 03:17:08 +0000 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2020-02-13 03:55:07 +0000 |
commit | f5e1a1085f3d033c68954bef7aa21b32bcc037c3 (patch) | |
tree | cac9dddc15a836ba616993bd7389705db0151cc1 | |
parent | 0494aacaefd8b37ef012227cb28317a8c427d085 (diff) | |
download | geiser-guile-f5e1a1085f3d033c68954bef7aa21b32bcc037c3.tar.gz geiser-guile-f5e1a1085f3d033c68954bef7aa21b32bcc037c3.tar.bz2 |
Guile: use load paths defined in dir-local variables (fixes #268)
A similar idea should probably be used with other schemes, but right
now i feel ashamed of having taken so long to fix this one (assuming
it's fixed!), so let's rush this commit for a change.
-rw-r--r-- | elisp/geiser-guile.el | 9 | ||||
-rw-r--r-- | elisp/geiser-repl.el | 17 |
2 files changed, 12 insertions, 14 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el index 198fde2..44d32e4 100644 --- a/elisp/geiser-guile.el +++ b/elisp/geiser-guile.el @@ -1,6 +1,6 @@ ;; geiser-guile.el -- guile's implementation of the geiser protocols -;; Copyright (C) 2009-2018 Jose Antonio Ortega Ruiz +;; Copyright (C) 2009-2018, 2020 Jose Antonio Ortega Ruiz ;; Copyright (C) 2017 Jan Nieuwenhuizen <janneke@gnu.org> ;; This program is free software; you can redistribute it and/or @@ -370,10 +370,13 @@ it spawn a server thread." (compilation-setup t) (font-lock-add-keywords nil `((,geiser-guile--path-rx 1 compilation-error-face))) - (let ((geiser-log-verbose-p t)) + (let ((geiser-log-verbose-p t) + (g-load-path (buffer-local-value 'geiser-guile-load-path + (or geiser-repl--last-scm-buffer + (current-buffer))))) (when remote (geiser-guile--set-geiser-load-path)) (geiser-eval--send/wait ",use (geiser emacs)\n'done") - (dolist (dir geiser-guile-load-path) + (dolist (dir g-load-path) (let ((dir (expand-file-name dir))) (geiser-eval--send/wait `(:eval (:ge add-to-load-path ,dir))))) (geiser-guile-update-warning-level))) diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index 1554698..54458e5 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -488,7 +488,9 @@ module command as a string") (defun geiser-repl--start-repl (impl address) (message "Starting Geiser REPL ...") (when (not address) (geiser-repl--check-version impl)) - (geiser-repl--to-repl-buffer impl) + (let ((buffer (current-buffer))) + (geiser-repl--to-repl-buffer impl) + (setq geiser-repl--last-scm-buffer buffer)) (sit-for 0) (goto-char (point-max)) (geiser-repl--autodoc-mode -1) @@ -881,9 +883,7 @@ buffer." "Start a new Geiser REPL." (interactive (list (geiser-repl--get-impl "Start Geiser for scheme implementation: "))) - (let ((buffer (current-buffer))) - (geiser-repl--start-repl impl nil) - (geiser-repl--maybe-remember-scm-buffer buffer))) + (geiser-repl--start-repl impl nil)) (defalias 'geiser 'run-geiser) @@ -891,10 +891,7 @@ buffer." "Start a new Geiser REPL connected to a remote Scheme process." (interactive (list (geiser-repl--get-impl "Connect to Scheme implementation: "))) - (let ((buffer (current-buffer))) - (geiser-repl--start-repl impl - (geiser-repl--read-address host port)) - (geiser-repl--maybe-remember-scm-buffer buffer))) + (geiser-repl--start-repl impl (geiser-repl--read-address host port))) (defun geiser-connect-local (impl socket) "Start a new Geiser REPL connected to a remote Scheme process @@ -902,9 +899,7 @@ over a Unix-domain socket." (interactive (list (geiser-repl--get-impl "Connect to Scheme implementation: ") (expand-file-name (read-file-name "Socket file name: ")))) - (let ((buffer (current-buffer))) - (geiser-repl--start-repl impl socket) - (geiser-repl--maybe-remember-scm-buffer buffer))) + (geiser-repl--start-repl impl socket)) (make-variable-buffer-local (defvar geiser-repl--last-scm-buffer nil)) |