[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH
From: |
Miguel Ángel Arruga Vivas |
Subject: |
Re: [PATCH] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable. |
Date: |
Sun, 25 Oct 2020 22:01:05 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi!
I think that geiser should use something (project.el, wink wink) to fill
load-path automatically when that's possible. Nevertheless, I have some
comments for this.
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
> +
> + ;; Emacs-Guix
> + (eval . (setq guix-directory
> + (locate-dominating-file default-directory
> ".dir-locals.el")))
> +
> + ;; Geiser
> + ;; This allows automatically setting the `geiser-guile-load-path'
> + ;; variable when using various Guix checkouts (e.g., via git worktrees).
> + ;; The checkout root directory name should be prefixed by "guix" for it
> + ;; to work correctly.
> + (eval . (let* ((root-dir (expand-file-name
> + (locate-dominating-file
> + default-directory ".dir-locals.el")))
> + ;; Workaround for bug https://issues.guix.gnu.org/43818.
> + (root-dir* (if (string-suffix-p "/" root-dir)
> + (substring root-dir 0 -1)
> + root-dir))
This is already implemented by directory-file-name.
> + (clean-geiser-guile-load-path
> + (seq-remove (lambda (x)
> + (string-match "/guix" x))
> + geiser-guile-load-path)))
This fails if geiser-guile-load-path does not exist (void-variable).
The cleanup removes other guixes, isn't it? I suggest making the
variable buffer-local and forget about hard-coded names. :-)
> + (setq geiser-guile-load-path
> + (cons root-dir* clean-geiser-guile-load-path))))))
This becomes a push with a local variable. Like this:
-------------------------------8<-------------------------------------
(eval . (setq guix-directory
(locate-dominating-file default-directory ".dir-locals.el")))
(eval . (when (boundp 'geiser-guile-load-path)
(make-local-variable 'geiser-guile-load-path)
(push (directory-file-name
(expand-file-name
(locate-dominating-file default-directory
".dir-locals.el")))
geiser-guile-load-path))
------------------------------->8-------------------------------------
Happy hacking!
Miguel
signature.asc
Description: PGP signature
- [PATCH] Automatically set `geiser-guile-load-path' from .dir-locals, Maxim Cournoyer, 2020/10/25
- Re: [PATCH] Automatically set `geiser-guile-load-path' from .dir-locals, Pierre Neidhardt, 2020/10/25
- [PATCH] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Maxim Cournoyer, 2020/10/25
- Re: [PATCH] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Pierre Neidhardt, 2020/10/25
- Re: [PATCH] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable.,
Miguel Ángel Arruga Vivas <=
- Re: [PATCH] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Maxim Cournoyer, 2020/10/26
- [PATCH v2] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Maxim Cournoyer, 2020/10/26
- Re: [PATCH v2] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Pierre Neidhardt, 2020/10/26
- Re: [PATCH v2] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Miguel Ángel Arruga Vivas, 2020/10/26
- Re: [PATCH v2] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Maxim Cournoyer, 2020/10/27
- Re: [PATCH v2] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Miguel Ángel Arruga Vivas, 2020/10/27
- [PATCH v3] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Maxim Cournoyer, 2020/10/27
- Re: [PATCH v3] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Maxim Cournoyer, 2020/10/31
- Re: [PATCH v3] .dir-locals.el: Automatically set the GEISER-GUILE-LOAD-PATH variable., Miguel Ángel Arruga Vivas, 2020/10/31
Re: [PATCH] Automatically set `geiser-guile-load-path' from .dir-locals, zimoun, 2020/10/26