;;; gxrepl.el ;;; ;;; Copyright (C) 2005, 2007, 2008 Thien-Thi Nguyen ;;; ;;; This file is part of ttn's personal elisp library, released under ;;; the terms of the GNU General Public License as published by the ;;; Free Software Foundation; either version 3, or (at your option) any ;;; later version. There is NO WARRANTY. See file COPYING for details. ;;; ;;; Description: Run a Guile-PG repl in a buffer. ;;;###autoload (defun gxrepl (dbname) "Connect interactively to database DBNAME using the gxrepl." (interactive (list (completing-read "Connect to database: " (split-string (shell-command-to-string "psql -ltA | sed 's/|.*//'"))))) (when (string= "" dbname) (setq dbname (user-login-name))) (switch-to-buffer (make-comint (concat "gxrepl " dbname) "guile" nil "-c" (format "%S %S" '(use-modules (database postgres-gxrepl)) `(gxrepl ,dbname)))) (setq truncate-lines t)) (provide 'gxrepl) ;;; gxrepl.el ends here