From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id sPJKJu31sWMifgEAbAwnHQ (envelope-from ) for ; Sun, 01 Jan 2023 22:06:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id sK5/Ju31sWMu7wAAauVa8A (envelope-from ) for ; Sun, 01 Jan 2023 22:06:53 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 216E62F2B7 for ; Sun, 1 Jan 2023 22:06:53 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pC5XA-00017P-TV; Sun, 01 Jan 2023 16:06:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pC5X8-00017G-Dy for guix-devel@gnu.org; Sun, 01 Jan 2023 16:06:19 -0500 Received: from m12.mail.163.com ([220.181.12.215]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pC5X2-0004qF-8M for guix-devel@gnu.org; Sun, 01 Jan 2023 16:06:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version: Content-Type; bh=RrNoIPe37KXCARuna9xEUzd2VFR5EGX1UH+EubmxeaQ=; b=Ab+aDtQDD+6BJqaTN/ZwOSvA49wHO9eQ2fB4Q3V9sRicGlJG8Xd88k3yYSvUkc jzADc1R8GBpN0kkc/y/uJxIvXog/Yt5IGiTKHqEFTSZXLPRho5FxQECBFkKShPnn XdlnLUh8FwdkxY5tWz406r6j8yRsklGqX1yHOO/1U2z08= Received: from Guix (unknown [49.88.145.87]) by zwqz-smtp-mta-g0-1 (Coremail) with SMTP id _____wAnd4+R9bFjqT4FAA--.1994S2; Mon, 02 Jan 2023 05:05:21 +0800 (CST) From: Feng Shu To: jbranso@dismail.de Cc: guix-devel@gnu.org Subject: Re: Suggest improve emacs setting in 'The Perfect Setup' In-Reply-To: <91c00763e857201b1e080264a1b9e7cc@dismail.de> (jbranso@dismail.de's message of "Sun, 01 Jan 2023 20:35:06 +0000") References: <87tu1auj4e.fsf@163.com> <87k02990ee.fsf@163.com> <87mt73jh85.fsf@dismail.de> <91c00763e857201b1e080264a1b9e7cc@dismail.de> Date: Mon, 02 Jan 2023 05:05:21 +0800 Message-ID: <87wn66t17y.fsf@163.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-CM-TRANSID: _____wAnd4+R9bFjqT4FAA--.1994S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvj4RX0edUUUUU X-Originating-IP: [49.88.145.87] X-CM-SenderInfo: 5wxpt2lkx6il2tof0z/1tbiRRLp1GDuyN3P9gAAsI Received-SPF: pass client-ip=220.181.12.215; envelope-from=tumashu@163.com; helo=m12.mail.163.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672607213; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=RrNoIPe37KXCARuna9xEUzd2VFR5EGX1UH+EubmxeaQ=; b=p4/HQWqOWBqfaULMr2vRAPT//weDq9wGlt0fu/fChbvG7k84hWBW0/BF4MKSo0Fta7KI81 +QqIKqifQo8alUCfySrCbit7EtGqR2PxSlPwdV+oUR/Jm7UGxbvXN3tnN7VYCbkyiR5SAu B0Y2uWVXLgxH+UH8PSmBegmht+NOTGm1h4jyfSHWKvhBgb5blTlThxayHCnASpSatmpVWH 1Ny/zbv5B/P17fHb0/TPaZGdxJaOtTtt9IKI1OP9sF/NaCHePtJjAgmVvOXgOVN6MDtjAF gn4GTD17pp17XuynqIgX3ZfQLzqnaevnQ2Mv6Non5DouV/VFf08P6Aft1ndFxw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=163.com header.s=s110527 header.b=Ab+aDtQD; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=163.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672607213; a=rsa-sha256; cv=none; b=GJFCsyx2T0BGZfFHvzC9drdaEeHV1t4WKOqy8l2TxT5ME5swl7CZbz9TmwIqHL0ommA0yv aUzjBgOru+laLGq+NiPprhD2g3BF+9AX7uNIpAt9HbmIIgV66tAHV2qHCFitAtafPQkr0b 6uhZM+bKPY9MgPFXrjGJ7NQK7pPSNsdbSNR3GN8KKR+X35xG4uogjkvAOsaWdyLHWKThpv T+4D8E3fyvbGMxTZ+4h2oJYZetSIvy+b9PHCztEaEUq0t04pHrtK32qnyIAosn4pMw9tsS yocg7EU5KICH9mlmpgbi76+AGhodUi0l0ROSKSQH3vniv059MP++vhMhYKNS5w== X-Spam-Score: -4.32 X-Migadu-Queue-Id: 216E62F2B7 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=163.com header.s=s110527 header.b=Ab+aDtQD; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=163.com X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.32 X-TUID: a+5m+bKjEVeo --=-=-= Content-Type: text/plain jbranso@dismail.de writes: > That's a good idea! I think there is/was a guix developer trying to write an > emacs configuration specifically to hack on guix... The below is my current guix emacs config, I do not know whether it is suitable for an example, maybe someone can try it :-) If suitable, I will try to send a patch. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=eh-guix.el Content-Transfer-Encoding: quoted-printable ;;; eh-guix.el --- Tumashu's emacs configuation -*- lexical-binding: t; = -*- ;; * Header ;; Copyright (c) 2011-2019, Feng Shu ;; Author: Feng Shu ;; URL: https://github.com/tumashu/emacs-helper ;; Version: 0.0.1 ;; This file is not part of GNU Emacs. ;;; License: ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 3 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA. ;;; Commentary: ;; This emacs config will set a basic guix develop environment for new ;; guix developer, it deal with guile %load-path with the help of ;; GUIX_PACKAGE_PATH environment and 'guix repl' command. ;; ** When it will useful? ;; 1. You just use guile to develop guix and do not develop other ;; projects. ;; 2. You use 'guix pull' to update guix and other channels ;; frequently, and do not like to deal with guile %load-path manually. ;; 3. You just edit your own guix config or change ONE package file at ;; a time in guix.git, this package file is relatively independent. ;; 4. You do not ADD a new scm file to guix.git. ;; ** How to start? ;; 1. Load this config to emacs ;; 2. Open guix file, for example: emacs-xyz.scm in guix.git. ;; 3. M-x: geiser ;; 4. Type 'C-c . u' key to use current guix module. ;; 5. Type 'C-c C-b' to geiser-eval-buffer current buffer. ;; 6. Edit... type 'C-M-x' or 'C-x C-e' to see result... edit again ... ;;; Code: (require 'geiser) (require 'geiser-guile) (require 'guix) (require 'magit) ;; ** Enable guix-devel-mode (add-hook 'scheme-mode-hook #'guix-devel-mode) ;; ** Enable display-fill-column-indicator-mode (add-hook 'scheme-mode-hook #'display-fill-column-indicator-mode) ;; ** Let geiser-guile use guix repl. (defun eh-guix-get-guile-load-path () "Get guile load-path from GUIX_PACKAGE_PATH environment." (when-let* ((path-str (getenv "GUIX_PACKAGE_PATH")) (length (> (length path-str) 0)) (paths (split-string path-str ":"))) (mapcan (lambda (path) (list "-L" (substitute-in-file-name path))) paths))) (setq geiser-guile-binary `("guix" "repl" ,@(eh-guix-get-guile-load-path))) ;; ** Do not auto load paths to guile %load-path. (defun eh-geiser-guile--startup (_) "Advice function of `geiser-guile--startup'. 1. Do not deal with `geiser-guile-load-path'. 2. Do not deal with geiser-connect feature." (geiser-guile--set-up-error-links) (let ((geiser-log-verbose t)) (geiser-guile--set-up-declarative-modules) (geiser-guile--set-up-backtrace) (geiser-eval--send/wait ",use (geiser emacs)\n'done") (geiser-eval--send/wait ",use (guix packages)\n'done") (geiser-guile-update-warning-level))) (defun eh-geiser-guile--parameters (orig-func &rest args) "Advice function of `geiser-guile--parameters'. Do not handle `geiser-guile-load-path'." (let ((geiser-guile-load-path nil)) (apply orig-func args))) ;; NOTE: geiser and geiser-guile will auto add project path, ;; `geiser-guile-load-path' in dir-local.el and path of current-buffer ;; to guile %load-path, this could lead to potential confusion for ;; guix new developer. DISABLE THIS FEATURE, we just use ;; GUIX_PACKAGE_PATH environment and 'guix repl' to handle %load-path. (setq geiser-repl-add-project-paths nil) (advice-add 'geiser-guile--startup :override #'eh-geiser-guile--startup) (advice-add 'geiser-guile--parameters :around #'eh-geiser-guile--parameters) ;; ** Get guix checkout directory. (defun eh-guix-dir () "Get guix checkout directory created by guix pull." (when-let* ((dir (expand-file-name "~/.cache/guix/checkouts/")) (directory-p (file-directory-p dir))) (file-name-as-directory (cl-find-if (lambda (dir) (file-exists-p (expand-file-name "guix.scm" dir))) (directory-files dir t))))) ;; ** Load guix copyright.el (when-let* ((dir (eh-guix-dir)) (file (expand-file-name "etc/copyright.el" dir)) (exists-p (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))) ;; ** Load guix tempel snippets. (when-let* ((dir (eh-guix-dir)) (path (expand-file-name "etc/snippets/tempel/*" dir))) (add-to-list 'tempel-path path)) ;; * Footer (provide 'eh-guix) ;;; eh-guix.el ends here --=-=-=--