summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2013-09-19 02:37:06 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2013-09-19 02:37:06 +0200
commit0238bdb00116c7fce43dd982ba69c1d6ef9ebc42 (patch)
tree67969a7b638d27aed0f011d56793fbf275c09e3b
parent217d2b5948b23a87efa3c617fdf213127e5acc15 (diff)
downloadgeiser-chez-0238bdb00116c7fce43dd982ba69c1d6ef9ebc42.tar.gz
geiser-chez-0238bdb00116c7fce43dd982ba69c1d6ef9ebc42.tar.bz2
Paving the way to MELPA (and simpler ELPA generation)
Following the discussion in GitHub, i'm adding an alternative scheme path to geiser.el as well as ##autoload cookies. As a first benefit, this simplifies a bit the elpa target, after playing a similar path trick in bin/geiser-racket.sh. Things should be almost ready for creating a MELPA recipe.
-rw-r--r--Makefile.am20
-rwxr-xr-xbin/geiser-racket.sh5
-rw-r--r--elisp/geiser.el26
3 files changed, 36 insertions, 15 deletions
diff --git a/Makefile.am b/Makefile.am
index ebc41a4..38be6b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,6 +9,8 @@ elpa_name = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
elpa_dir = $(abs_top_builddir)/$(elpa_name)
elpa_slogan = "GNU Emacs and Scheme talk to each other"
geiser_el = $(elpa_dir)/geiser.el
+bin_dir = $(elpa_dir)/bin
+scheme_dir = $(elpa_dir)/scheme
elpa: README.elpa info
rm -rf $(elpa_dir)
@@ -20,27 +22,21 @@ elpa: README.elpa info
$(INSTALL_DATA) $(abs_top_srcdir)/elisp/*.el \
$(top_builddir)/elisp/geiser-version.el \
$(elpa_dir)
- sed -i -e 's|(expand-file-name "../scheme/" .*$$|geiser-elisp-dir|' \
- $(geiser_el)
- sed -i -e 's/(autoload /;;;###autoload\n(autoload /' $(geiser_el)
- $(mkdir_p) $(elpa_dir)/guile/geiser
- $(mkdir_p) $(elpa_dir)/racket/geiser
+ $(mkdir_p) $(scheme_dir)/guile/geiser
+ $(mkdir_p) $(scheme_dir)/racket/geiser
$(INSTALL_DATA) $(abs_top_srcdir)/scheme/guile/geiser/* \
- $(elpa_dir)/guile/geiser
+ $(scheme_dir)/guile/geiser
$(INSTALL_DATA) $(abs_top_srcdir)/scheme/racket/geiser/* \
- $(elpa_dir)/racket/geiser
+ $(scheme_dir)/racket/geiser
$(INSTALL_DATA) $(srcdir)/doc/geiser.info $(elpa_dir)
(cd $(elpa_dir) && install-info --dir=dir geiser.info 2>/dev/null)
$(INSTALL_DATA) $(top_srcdir)/README.elpa $(elpa_dir)/README
- $(mkdir_p) $(elpa_dir)/bin
- $(INSTALL) $(top_srcdir)/bin/geiser-racket.sh $(elpa_dir)/bin/geiser-racket
- sed -i -e 's|^top=.*$$|top=$$(dirname $$0)/..|' \
- $(elpa_dir)/bin/geiser-racket
+ $(mkdir_p) $(bin_dir)
+ $(INSTALL) $(top_srcdir)/bin/geiser-racket.sh $(bin_dir)
rm -f $(elpa_name).tar
tar cf $(elpa_name).tar $(elpa_name)
-
diff --git a/bin/geiser-racket.sh b/bin/geiser-racket.sh
index 09a92a8..4ac7712 100755
--- a/bin/geiser-racket.sh
+++ b/bin/geiser-racket.sh
@@ -1,6 +1,9 @@
#!/bin/bash
#|
-top="$(dirname $0)/../scheme"
+topdir=$(dirname $0)
+elpa_scheme=$topdir/scheme
+in_scheme=$topdir/../scheme
+top=$(if [ -d $elpa_scheme ]; then echo $elpa_scheme; else echo $in_scheme; fi)
exec racket -i -S "$top/racket" -l errortrace -cu "$0" ${1+"$@"}
|#
diff --git a/elisp/geiser.el b/elisp/geiser.el
index fbc34a6..44c696a 100644
--- a/elisp/geiser.el
+++ b/elisp/geiser.el
@@ -1,6 +1,6 @@
;;; geiser.el -- main geiser file
-;; Copyright (C) 2009, 2010, 2011, 2012 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2011, 2012, 2013 Jose Antonio Ortega Ruiz
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the Modified BSD License. You should
@@ -15,7 +15,11 @@
(defconst geiser-elisp-dir (file-name-directory load-file-name)
"Directory containing Geiser's Elisp files.")
-(defconst geiser-scheme-dir (expand-file-name "../scheme/" geiser-elisp-dir)
+(defconst geiser-scheme-dir
+ (let ((d (expand-file-name "./scheme/" geiser-elisp-dir)))
+ (if (file-directory-p d)
+ d
+ (expand-file-name "../scheme/" geiser-elisp-dir)))
"Directory containing Geiser's Scheme files.")
(when (not (member geiser-elisp-dir load-path))
@@ -24,50 +28,68 @@
;;; Autoloads:
+;;;###autoload
(autoload 'geiser-version "geiser-version" "Echo Geiser's version." t)
+;;;###autoload
(autoload 'geiser-unload "geiser-reload" "Unload all Geiser code." t)
+;;;###autoload
(autoload 'geiser-reload "geiser-reload" "Reload Geiser code." t)
+;;;###autoload
(autoload 'geiser "geiser-repl"
"Start a Geiser REPL, or switch to a running one." t)
+;;;###autoload
(autoload 'run-geiser "geiser-repl" "Start a Geiser REPL." t)
+;;;###autoload
(autoload 'geiser-connect "geiser-repl"
"Start a Geiser REPL connected to a remote server." t)
+;;;###autoload
(autoload 'switch-to-geiser "geiser-repl"
"Switch to a running one Geiser REPL." t)
+;;;###autoload
(autoload 'run-guile "geiser-guile" "Start a Geiser Guile REPL." t)
+;;;###autoload
(autoload 'switch-to-guile "geiser-guile"
"Start a Geiser Guile REPL, or switch to a running one." t)
+;;;###autoload
(autoload 'connect-to-guile "geiser-guile"
"Connect to a remote Geiser Guile REPL." t)
+;;;###autoload
(autoload 'run-racket "geiser-racket" "Start a Geiser Racket REPL." t)
+;;;###autoload
(autoload 'run-gracket "geiser-racket" "Start a Geiser GRacket REPL." t)
+;;;###autoload
(autoload 'switch-to-racket "geiser-racket"
"Start a Geiser Racket REPL, or switch to a running one." t)
+;;;###autoload
(autoload 'connect-to-racket "geiser-racket"
"Connect to a remote Geiser Racket REPL." t)
+;;;###autoload
(autoload 'geiser-mode "geiser-mode"
"Minor mode adding Geiser REPL interaction to Scheme buffers." t)
+;;;###autoload
(autoload 'turn-on-geiser-mode "geiser-mode"
"Enable Geiser's mode (useful in Scheme buffers)." t)
+;;;###autoload
(autoload 'turn-off-geiser-mode "geiser-mode"
"Disable Geiser's mode (useful in Scheme buffers)." t)
+;;;###autoload
(autoload 'geiser-mode--maybe-activate "geiser-mode")
;;;###autoload