From 187f80c6c542bc65486ef600aa3af96f7173f4fa Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Fri, 24 Jul 2015 18:33:14 +0300 Subject: emacs: Add development utils. * emacs/guix-guile.el (guix-guile-current-module): New function. * emacs/guix-devel.el: New file. * emacs.am (ELFILES): Add it. * doc/emacs.texi (Emacs Development): New node. (Emacs Interface): Add it. * doc/contributing.texi (The Perfect Setup): Mention it. * doc/guix.texi (Top): Add it. * emacs/guix-init.el: Add 'guix-devel-activate-mode-maybe' to 'scheme-mode-hook'. --- emacs/guix-guile.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'emacs/guix-guile.el') diff --git a/emacs/guix-guile.el b/emacs/guix-guile.el index cff9bd4e9b..c21d27fca2 100644 --- a/emacs/guix-guile.el +++ b/emacs/guix-guile.el @@ -24,6 +24,19 @@ ;;; Code: +(require 'geiser-guile) + +(defun guix-guile-current-module () + "Return a string with the current guile module. +Return nil, if current buffer does not define a module." + ;; Modified version of `geiser-guile--get-module'. + (save-excursion + (geiser-syntax--pop-to-top) + (when (or (re-search-backward geiser-guile--module-re nil t) + (looking-at geiser-guile--library-re) + (re-search-forward geiser-guile--module-re nil t)) + (match-string-no-properties 1)))) + (defun guix-guile-make-call-expression (proc &rest args) "Return \"(PROC ARGS ...)\" string. PROC and ARGS should be strings." -- cgit v1.2.3