1 ;;; GNU Mes --- Maxwell Equations of Software
2 ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
4 ;;; This file is part of GNU Mes.
6 ;;; GNU Mes is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Mes is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
21 ((indent-tabs-mode . nil)
25 (let ((top (locate-dominating-file default-directory ".dir-locals.el"))))
27 (defun guile--manual-look-up (id mod)
28 (message "guile--manual-look-up id=%s => %s mod=%s" id (symbol-name id) mod)
29 (let ((info-lookup-other-window-flag
30 geiser-guile-manual-lookup-other-window-p))
31 (info-lookup-symbol (symbol-name id) 'scheme-mode))
32 (when geiser-guile-manual-lookup-other-window-p
33 (switch-to-buffer-other-window "*info*"))
34 (search-forward (format "%s" id) nil t))
36 (add-hook 'before-save-hook 'delete-trailing-whitespace nil t)
38 (defun guix-switch-profile (&optional profile)
39 "reset Emacs' environment by snarfing PROFILE/etc/profile"
41 (defun matches-in-string (regexp string)
42 "return a list of matches of REGEXP in STRING."
46 (while (string-match regexp string (match-end 0))
47 (push (or (match-string 1 string) (match-string 0 string)) matches)))
50 (interactive "fprofile: ")
51 (let* ((output (shell-command-to-string (concat "GUIX_PROFILE= /bin/sh -x " profile "/etc/profile")))
52 (exports (matches-in-string "^[+] export \\(.*\\)" output)))
53 (mapcar (lambda (line) (apply #'setenv (split-string line "="))) exports )))
56 (indent-tabs-mode . t))
59 ((geiser-active-implementations . (guile))
63 (defun prefix-dir-locals-dir (elt)
64 (concat (locate-dominating-file buffer-file-name ".dir-locals.el") elt))
66 (lambda (dir) (add-to-list 'geiser-guile-load-path dir))
68 #'prefix-dir-locals-dir
69 '("scripts" "guile")))))))
70 (texinfo-mode . ((indent-tabs-mode . nil)