summary refs log tree commit diff
path: root/emacs
diff options
context:
space:
mode:
Diffstat (limited to 'emacs')
-rw-r--r--emacs/guix-backend.el3
-rw-r--r--emacs/guix-config.el.in16
-rw-r--r--emacs/guix-devel.el21
-rw-r--r--emacs/guix-external.el18
-rw-r--r--emacs/guix-profiles.el2
5 files changed, 47 insertions, 13 deletions
diff --git a/emacs/guix-backend.el b/emacs/guix-backend.el
index 412d648b9d..e7c158bef4 100644
--- a/emacs/guix-backend.el
+++ b/emacs/guix-backend.el
@@ -56,9 +56,10 @@
 (require 'geiser-guile)
 (require 'guix-geiser)
 (require 'guix-config)
+(require 'guix-external)
 (require 'guix-emacs)
 
-(defvar guix-load-path guix-emacs-interface-directory
+(defvar guix-load-path guix-config-emacs-interface-directory
   "Directory with scheme files for \"guix.el\" package.")
 
 (defvar guix-helper-file
diff --git a/emacs/guix-config.el.in b/emacs/guix-config.el.in
index 16434cecea..bd821596c4 100644
--- a/emacs/guix-config.el.in
+++ b/emacs/guix-config.el.in
@@ -1,6 +1,7 @@
 ;;; guix-config.el --- Compile-time configuration of Guix.
 
 ;; Copyright © 2015 Mathieu Lirzin <mthl@openmailbox.org>
+;; Copyright © 2015 Alex Kost <alezost@gmail.com>
 
 ;; This file is part of GNU Guix.
 
@@ -19,21 +20,18 @@
 
 ;;; Code:
 
-(defconst guix-emacs-interface-directory
+(defconst guix-config-emacs-interface-directory
   (replace-regexp-in-string "${prefix}" "@prefix@" "@emacsuidir@"))
 
-(defconst guix-state-directory
+(defconst guix-config-state-directory
   ;; This must match `NIX_STATE_DIR' as defined in `daemon.am'.
   (or (getenv "NIX_STATE_DIR") "@guix_localstatedir@/guix"))
 
-(defvar guix-guile-program "@GUILE@"
-  "Name of the guile executable used for Guix REPL.
-May be either a string (the name of the executable) or a list of
-strings of the form:
+(defconst guix-config-guile-program "@GUILE@"
+  "Name of the 'guile' executable defined at configure time.")
 
-  (NAME . ARGS)
-
-Where ARGS is a list of arguments to the guile program.")
+(defconst guix-config-dot-program "@DOT_USER_PROGRAM@"
+  "Name of the 'dot' executable defined at configure time.")
 
 (provide 'guix-config)
 
diff --git a/emacs/guix-devel.el b/emacs/guix-devel.el
index f3ad4b9255..170ce1ad54 100644
--- a/emacs/guix-devel.el
+++ b/emacs/guix-devel.el
@@ -254,6 +254,20 @@ Each rule should have a form (SYMBOL VALUE).  See `put' for details."
                   0)))
     (lisp-indent-specform count state indent-point normal-indent)))
 
+(defun guix-devel-indent-modify-phases-keyword (count)
+  "Return indentation function for 'modify-phases' keywords."
+  (lambda (state indent-point normal-indent)
+    (when (ignore-errors
+            (goto-char (nth 1 state))   ; start of keyword sexp
+            (backward-up-list)
+            (looking-at "(modify-phases\\>"))
+      (lisp-indent-specform count state indent-point normal-indent))))
+
+(defalias 'guix-devel-indent-modify-phases-keyword-1
+  (guix-devel-indent-modify-phases-keyword 1))
+(defalias 'guix-devel-indent-modify-phases-keyword-2
+  (guix-devel-indent-modify-phases-keyword 2))
+
 (guix-devel-scheme-indent
   (bag 0)
   (build-system 0)
@@ -293,7 +307,12 @@ Each rule should have a form (SYMBOL VALUE).  See `put' for details."
   (with-monad 1)
   (with-mutex 1)
   (with-store 1)
-  (wrap-program 1))
+  (wrap-program 1)
+
+  ;; 'modify-phases' keywords:
+  (replace    'guix-devel-indent-modify-phases-keyword-1)
+  (add-after  'guix-devel-indent-modify-phases-keyword-2)
+  (add-before 'guix-devel-indent-modify-phases-keyword-2))
 
 
 (defvar guix-devel-keys-map
diff --git a/emacs/guix-external.el b/emacs/guix-external.el
index 580676ef91..c80b36343d 100644
--- a/emacs/guix-external.el
+++ b/emacs/guix-external.el
@@ -23,11 +23,27 @@
 
 ;;; Code:
 
+(require 'guix-config)
+
 (defgroup guix-external nil
   "Settings for external programs."
   :group 'guix)
 
-(defcustom guix-dot-program (executable-find "dot")
+(defcustom guix-guile-program guix-config-guile-program
+  "Name of the 'guile' executable used for Guix REPL.
+May be either a string (the name of the executable) or a list of
+strings of the form:
+
+  (NAME . ARGS)
+
+Where ARGS is a list of arguments to the guile program."
+  :type 'string
+  :group 'guix-external)
+
+(defcustom guix-dot-program
+  (if (file-name-absolute-p guix-config-dot-program)
+      guix-config-dot-program
+    (executable-find "dot"))
   "Name of the 'dot' executable."
   :type 'string
   :group 'guix-external)
diff --git a/emacs/guix-profiles.el b/emacs/guix-profiles.el
index 1a41745512..2c1936864f 100644
--- a/emacs/guix-profiles.el
+++ b/emacs/guix-profiles.el
@@ -26,7 +26,7 @@
   "User profile.")
 
 (defvar guix-default-profile
-  (concat guix-state-directory
+  (concat guix-config-state-directory
           "/profiles/per-user/"
           (getenv "USER")
           "/guix-profile")