summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-05-29 22:15:50 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-05-29 22:15:50 +0200
commitd019a07f14f4a76432d305eb8c4b0bb676b97e51 (patch)
tree61cd9f1318408bae5457ca38b11a7fdf8d32f808
parent4b4328f48bce55197e6511504e9c751b0c844529 (diff)
Adjust to changes in installation directories of Emacs packages in Guix.
-rw-r--r--guile-studio-configure.scm14
1 files changed, 12 insertions, 2 deletions
diff --git a/guile-studio-configure.scm b/guile-studio-configure.scm
index f5a2cc8..f91ed3b 100644
--- a/guile-studio-configure.scm
+++ b/guile-studio-configure.scm
@@ -5,6 +5,14 @@
(srfi srfi-1)
(srfi srfi-26))
+(define (emacs-package-directory root)
+ (define (directory? thing)
+ (eq? 'directory (stat:type (stat (string-append root "/" thing)))))
+ (match (scandir root directory?)
+ (("." ".." subdir . rest)
+ (string-append root "/" subdir))
+ (_ #false)))
+
(define (make-guile-studio-wrapper prefix share emacsdir emacs-package-dirs)
(let ((wrapper (string-append prefix "/bin/guile-studio")))
(with-output-to-file wrapper
@@ -14,8 +22,10 @@ EMACSLOADPATH=~a:
exec ~a/bin/emacs -mm --no-site-file --no-site-lisp --no-x-resources --no-init-file --load ~a/guile-studio.el
"
(string-join
- (map (cut string-append <> "/share/emacs/site-lisp")
- emacs-package-dirs) ":")
+ (filter-map (lambda (dir)
+ (emacs-package-directory
+ (string-append dir "/share/emacs/site-lisp")))
+ emacs-package-dirs) ":")
emacsdir share)))
(chmod wrapper #o555)))