[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Suggest improve emacs setting in 'The Perfect Setup'
From: |
Feng Shu |
Subject: |
Re: Suggest improve emacs setting in 'The Perfect Setup' |
Date: |
Mon, 02 Jan 2023 03:53:21 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Joshua Branson <jbranso@dismail.de> writes:
> Feng Shu <tumashu@163.com> writes:
>
>> 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:
>>
>
> How about you go ahead and make a patch on guix-patches@gnu.org, that
> way this issue is not forgotten?
Maybe we can add an example emacs config for develop guix in etc directory.
>
>>
>> ```
>> (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)))
>
> I would also add:
>
> (add-hook! 'scheme-mode-hook #'display-fill-column-indicator-mode)
>
> This creates a vertical line that reminds you that your code should fit
> inside 80 columns.
>
> Possible also mention how to set up page break lines:
>
> https://github.com/purcell/page-break-lines
--
- Re: Suggest improve emacs setting in 'The Perfect Setup',
Feng Shu <=