all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Suggest improve emacs setting in 'The Perfect Setup'
@ 2022-12-30  0:54 Feng Shu
  2022-12-31 23:17 ` Joshua Branson
  2023-01-06 16:07 ` Simon Tournier
  0 siblings, 2 replies; 10+ messages in thread
From: Feng Shu @ 2022-12-30  0:54 UTC (permalink / raw)
  To: guix-devel


Hello:

In 'The Perfect Setup', we suggest user to use the below emacs config:

```
;; Assuming the Guix checkout is in ~/src/guix.
(with-eval-after-load 'geiser-guile
  (add-to-list 'geiser-guile-load-path "~/src/guix"))
```

This config need user to deal with %load-path of guix, which seem to be
a hard job for new guile user for many dirs of guix and other guix channels,
why not suggest new user to use the below config:

```
(setq geiser-guile-binary (list "guix" "repl"))
```

or:

```
(setq geiser-guile-binary (list "guix" "repl" "-L" "/path/to/user-own-config-dir"))
```

when user just want to develop his own guix config, just run:

```
emacs
```

guix and other channels installed by 'guix pull' will be used properly.

when user want to develop in guix.git, he just run emacs like the below:

```
./pre-inst-env emacs
```

The below is my guix emacs config, seem to work:

--------------------------------------------------------------------------------

(require 'geiser)
(require 'geiser-guile)
(require 'guix)
(require 'magit)

;; ** My own guix config.
(defvar eh-geeguix-dir (expand-file-name "~/geeguix"))

;; ** Let geiser-guile use 'guix repl'
(setq geiser-guile-binary (list "guix" "repl" "-L" eh-geeguix-dir))

;; ** guix-devel-mode
(add-hook 'scheme-mode-hook #'guix-devel-mode)

;; ** Get guix dir installed by 'guix pull'.
(defun eh-guix-dir ()
  (file-name-as-directory
   (cl-find-if
    (lambda (dir)
      (file-exists-p (expand-file-name "guix.scm" dir)))
    (directory-files
     (expand-file-name "~/.cache/guix/checkouts/")
     t))))

;; ** copyright-update
(when (eh-guix-dir)
  (let* ((dir (eh-guix-dir))
         (file (expand-file-name "etc/copyright.el" dir)))
    (when (file-exists-p file)
      (load-file file)
      ;; (add-hook 'after-save-hook 'copyright-update)
      (setq copyright-names-regexp
            (format "%s <%s>" user-full-name user-mail-address)))))

;; ** tempel 
(when (eh-guix-dir)
  (let* ((dir (eh-guix-dir))
         (path (expand-file-name "etc/snippets/tempel/*" dir)))
    (add-to-list 'tempel-path path)))



-- 



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-06-08 22:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-30  0:54 Suggest improve emacs setting in 'The Perfect Setup' Feng Shu
2022-12-31 23:17 ` Joshua Branson
2023-01-01 19:53   ` Feng Shu
2023-01-01 20:35   ` jbranso
2023-01-01 21:05     ` Feng Shu
2023-01-02 21:36     ` jbranso
2023-01-03  1:18       ` Feng Shu
2023-06-08 22:08   ` Mekeor Melire
2023-01-06 16:07 ` Simon Tournier
2023-01-07 22:43   ` Feng Shu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.