From ceb34c77c231876d9383dcbacff00584914aa8dd Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Wed, 19 Aug 2009 23:44:54 +0200 Subject: C-c k == nuke repl --- README | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'README') diff --git a/README b/README index 626bed9..141b83d 100644 --- a/README +++ b/README @@ -22,9 +22,7 @@ Currently supported implementations are Guile and PLT. - - Guile works only with the development, vm-based binary. Be sure - to customize `geiser-repl-guile-binary' to point to a correct vm - binary. + - Guile 1.9.x virtual machine required. - PLT Scheme 4.1.5.5 or better required. * Installation @@ -94,22 +92,23 @@ *** In the REPL - |----------------+-------------------------------------------| - | C-c C-z, C-c z | Start Scheme REPL (if it's not running) | - |----------------+-------------------------------------------| - | M-. | Edit identifier at point | - | TAB, M-TAB | Complete identifier at point | - | M-`, C-. | Complete module name at point | - |----------------+-------------------------------------------| - | M-p, M-n | Prompt history, matching current prefix | - |----------------+-------------------------------------------| - | C-c k | Compile and load scheme file | - | C-c l | Load scheme file | - |----------------+-------------------------------------------| - | C-c d | See documentation for identifier at point | - | C-c m | See module documentation | - | C-c a | Toggle autodoc mode | - |----------------+-------------------------------------------| + |----------------+----------------------------------------------------| + | C-c C-z, C-c z | Start Scheme REPL (if it's not running) | + |----------------+----------------------------------------------------| + | M-. | Edit identifier at point | + | TAB, M-TAB | Complete identifier at point | + | M-`, C-. | Complete module name at point | + |----------------+----------------------------------------------------| + | M-p, M-n | Prompt history, matching current prefix | + |----------------+----------------------------------------------------| + | C-c C-k, C-c k | Nuke REPL: use it if the REPL becomes unresponsive | + |----------------+----------------------------------------------------| + | C-c l | Load scheme file | + |----------------+----------------------------------------------------| + | C-c d | See documentation for identifier at point | + | C-c m | See module documentation | + | C-c a | Toggle autodoc mode | + |----------------+----------------------------------------------------| *** In the documentation browser: -- cgit v1.2.3 From 3983e638629b1185963fc642c50c2138bd0e66fa Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Sun, 23 Aug 2009 05:18:39 +0200 Subject: Standardese filling. --- AUTHORS | 4 + INSTALL | 316 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ README | 57 +++++++++--- 3 files changed, 364 insertions(+), 13 deletions(-) (limited to 'README') diff --git a/AUTHORS b/AUTHORS index e69de29..c1ecdb8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -0,0 +1,4 @@ +Jose A. Ortega Ruiz designed and implemented GNU Geiser. For +more boring details about him, see . + +See also the files THANKS and ChangeLog. diff --git a/INSTALL b/INSTALL index e69de29..4333c7f 100644 --- a/INSTALL +++ b/INSTALL @@ -0,0 +1,316 @@ +Installing Geiser. +------------------ + +You'll find below the generic build and installation instructions for +a GNU package, which Geiser happens to be. As you know, they can be +summarised as: + + mkdir build && cd build + ../configure + make + make install + +And, in our case, we'll need to tell emacs about this new little +package with + + (require 'geiser-install) + +in your moral equivalent to ~/.emacs. + +As explained in the README file, Geiser is also directly usable from +its source tree, with no configuration whatsoever. Read that README to +see how. + +As promised, here you have the gory details of the autotools jazz: + +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 6. Often, you can also type `make uninstall' to remove the installed + files again. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/README b/README index 141b83d..537f291 100644 --- a/README +++ b/README @@ -26,29 +26,60 @@ - PLT Scheme 4.1.5.5 or better required. * Installation + Geiser can be used either directly from its uninstalled source tree + or byte-compiled and installed after perfoming the standard + configure/make/make install dance. - - In your .emacs: +*** In place + - Extract the tarball or clone the git repository anywhere in your + file system. Let's call that place . + - In your .emacs: - (load-file "/elisp/geiser.el") + (load-file "/elisp/geiser.el") - This installs all supported Scheme implementations. You can list - explicitly the ones that you want by setting the variable - `geiser-impl-installed-implementations' *before* loading geiser.el. - For instance: +*** Byte-compiled + - Create a build directory, `build', say: + $ cd + $ mkdir build; cd build + - Configure and make: + $ ../configure && make + You'll have a directory called "elisp" which contains Geiser's + elisp bytecode. Now, you can either use it in place, with the + .emacs incantation: - (setq geiser-impl-installed-implementations '(plt guile)) + (load-file "/build/elisp/geiser.elc") - On opening a scheme file, Geiser will try to guess its Scheme, - defaulting to the first in the list. + or install it with: - - Check the geiser customization group for some options with: + $ make install + + and require 'geiser-install (not 'geiser, mind you) in your emacs + initialization file: + + (require 'geiser-install) + + You're ready to go! + +* Basic configuration + The loading invocations above install all supported Scheme + implementations. You can list explicitly the ones that you want by + setting the variable `geiser-impl-installed-implementations' *before* + loading geiser.el. For instance: + + (setq geiser-impl-installed-implementations '(plt guile)) + + On opening a scheme file, Geiser will try to guess its Scheme, + defaulting to the first in the list. Use `C-c C-s' to select the + implementation by hand (on a per file basis). + + Check the geiser customization group for some options with: M-x customize-group RET geiser RET - In particular, customize `geiser-repl--binary' (in - geiser-repl), which should point to an executable in your path. + In particular, customize `geiser-repl--binary' (in + geiser-repl), which should point to an executable in your path. - - To start a REPL, M-x geiser. + To start a REPL, M-x geiser. * Quick key reference -- cgit v1.2.3 From 91841a63fb0cf3c8a0a6ed1e9086b72097cd44e4 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Tue, 25 Aug 2009 01:58:55 +0200 Subject: Now this is cool: support for company mode. --- README | 11 +++++ elisp/Makefile.am | 1 + elisp/geiser-autodoc.el | 6 ++- elisp/geiser-company.el | 111 +++++++++++++++++++++++++++++++++++++++++++++ elisp/geiser-completion.el | 8 ++-- elisp/geiser-edit.el | 11 ++--- elisp/geiser-mode.el | 7 +++ elisp/geiser-reload.el | 1 + elisp/geiser-repl.el | 7 +++ 9 files changed, 153 insertions(+), 10 deletions(-) create mode 100644 elisp/geiser-company.el (limited to 'README') diff --git a/README b/README index 537f291..8870006 100644 --- a/README +++ b/README @@ -81,6 +81,17 @@ To start a REPL, M-x geiser. +*** Completion with company-mode + Geiser offers identifier and module name completion, bound to + M-TAB and M-` respectively. Only names visible in the current + module are offered. + + While that is cool and all, things are even better: if you have + [[http://nschum.de/src/emacs/company-mode/][company-mode]] installed, Geiser's completion will use it. Just + require company-mode and, from then on, any new scheme buffer or + REPL will use it. If you didn't know about Nikolaj Schumacher's + awesome mode, check [[http://www.screentoaster.com/watch/stU0lSRERIR1pYRFVdXVlRVFFV/company_mode_for_gnu_emacs][this screencast]]. + * Quick key reference *** In Scheme buffers: diff --git a/elisp/Makefile.am b/elisp/Makefile.am index a6ff248..9f93e64 100644 --- a/elisp/Makefile.am +++ b/elisp/Makefile.am @@ -3,6 +3,7 @@ EXTRA_DIST = geiser-install.el.in dist_lisp_LISP = \ geiser-autodoc.el \ geiser-base.el \ + geiser-company.el \ geiser-compile.el \ geiser-completion.el \ geiser-connection.el \ diff --git a/elisp/geiser-autodoc.el b/elisp/geiser-autodoc.el index 26abd8d..5aa6691 100644 --- a/elisp/geiser-autodoc.el +++ b/elisp/geiser-autodoc.el @@ -153,9 +153,13 @@ when `geiser-autodoc-display-module-p' is on." ;;; Autodoc function: +(make-variable-buffer-local + (defvar geiser-autodoc--inhibit-flag nil)) + (defun geiser-autodoc--eldoc-function () (condition-case e - (geiser-autodoc--autodoc (geiser-syntax--scan-sexps)) + (and (not geiser-autodoc--inhibit-flag) + (geiser-autodoc--autodoc (geiser-syntax--scan-sexps))) (error (format "Autodoc not available (%s)" (error-message-string e))))) diff --git a/elisp/geiser-company.el b/elisp/geiser-company.el new file mode 100644 index 0000000..8ae8969 --- /dev/null +++ b/elisp/geiser-company.el @@ -0,0 +1,111 @@ +;; geiser-company.el -- integration with company-mode + +;; Copyright (C) 2009 Jose Antonio Ortega Ruiz + +;; Author: Jose Antonio Ortega Ruiz +;; Start date: Mon Aug 24, 2009 12:44 + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3 of the License, or +;; (at your option) any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Code: + +(require 'geiser-autodoc) +(require 'geiser-completion) +(require 'geiser-edit) +(require 'geiser-base) + + +;;; Helpers: + +(make-variable-buffer-local + (defvar geiser-company--enabled-flag nil)) + +(defsubst geiser-company--candidates (prefix module) + (car (geiser-completion--complete prefix module))) + +(defsubst geiser-company--doc (id module) + (ignore-errors + (if module + (format "%s [module]" id) + (geiser-autodoc--autodoc (list (list (intern id) 0)))))) + +(defsubst geiser-company--doc-buffer (id module) + nil) + +(defun geiser-company--location (id module) + (ignore-errors + (let ((id (intern id))) + (save-current-buffer + (if module (geiser-edit-module id) (geiser-edit-symbol id)) + (cons (current-buffer) (point)))))) + +(defsubst geiser-company--prefix-at-point (module) + (and geiser-company--enabled-flag + (looking-at-p "\\_>") + (not (nth 8 (syntax-ppss))) + (geiser-completion--prefix module))) + + +;;; Activation + +(defun geiser-company--setup (enable) + (setq geiser-company--enabled-flag enable) + (when (fboundp 'company-mode) + (company-mode nil) + (when enable (company-mode enable))) + (when (boundp 'company-lighter) + (setq company-lighter "/C"))) + +(defun geiser-company--inhibit-autodoc (ignored) + (setq geiser-autodoc--inhibit-flag t)) + +(defun geiser-company--restore-autodoc (&optional ignored) + (setq geiser-autodoc--inhibit-flag nil)) + + +;;; Backends: +(defmacro geiser-company--make-backend (name mod) + `(defun ,name (command &optional arg &rest ignored) + "A `company-mode' completion back-end for `geiser-mode'." + (interactive (list 'interactive)) + (case command + ('interactive (company-begin-backend ',name)) + ('prefix (geiser-company--prefix-at-point ,mod)) + ('candidates (geiser-company--candidates arg ,mod)) + ('meta (geiser-company--doc arg ,mod)) + ('doc-buffer (geiser-company--doc-buffer arg ,mod)) + ('location (geiser-company--location arg ,mod)) + ('sorted t)))) + +(defvar geiser-company--backend '(company-geiser-ids company-geiser-modules)) + +(eval-after-load "company" + '(progn + (geiser-company--make-backend company-geiser-ids nil) + (geiser-company--make-backend company-geiser-modules t) + (add-to-list 'company-backends geiser-company--backend) + (add-hook 'company-completion-finished-hook 'geiser-company--restore-autodoc) + (add-hook 'company-completion-cancelled-hook 'geiser-company--restore-autodoc) + (add-hook 'company-completion-started-hook 'geiser-company--inhibit-autodoc))) + + +;;; Reload support: + +(defun geiser-company-unload-function () + (when (boundp 'company-backends) + (setq company-backends (remove geiser-company--backend company-backends)))) + + +(provide 'geiser-company) +;;; geiser-company.el ends here diff --git a/elisp/geiser-completion.el b/elisp/geiser-completion.el index cd03cae..e3bd74b 100644 --- a/elisp/geiser-completion.el +++ b/elisp/geiser-completion.el @@ -204,14 +204,16 @@ terminates a current completion." (funcall geiser-completion--symbol-begin-function module)) (save-excursion (skip-syntax-backward "^-()>") (point)))) +(defsubst geiser-completion--prefix (module) + (buffer-substring-no-properties (point) + (geiser-completion--symbol-begin module))) + (defun geiser-completion--complete-symbol (&optional arg) "Complete the symbol at point. Perform completion similar to Emacs' complete-symbol. With prefix, complete module name." (interactive "P") - (let* ((end (point)) - (beg (geiser-completion--symbol-begin arg)) - (prefix (buffer-substring-no-properties beg end)) + (let* ((prefix (geiser-completion--prefix arg)) (result (geiser-completion--complete prefix arg)) (completions (car result)) (partial (cdr result))) diff --git a/elisp/geiser-edit.el b/elisp/geiser-edit.el index ad2c11e..418b6e3 100644 --- a/elisp/geiser-edit.el +++ b/elisp/geiser-edit.el @@ -155,13 +155,12 @@ or following links in error buffers.") (defvar geiser-edit--symbol-history nil) -(defun geiser-edit-symbol () +(defun geiser-edit-symbol (symbol) "Asks for a symbol to edit, with completion." - (interactive) - (let* ((symbol (geiser-completion--read-symbol "Edit symbol: " - nil - geiser-edit--symbol-history)) - (cmd `(:eval ((:ge symbol-location) ',symbol)))) + (interactive (list (geiser-completion--read-symbol "Edit symbol: " + nil + geiser-edit--symbol-history))) + (let ((cmd `(:eval ((:ge symbol-location) ',symbol)))) (geiser-edit--try-edit symbol (geiser-eval--send/wait cmd)))) (defun geiser-edit-symbol-at-point (&optional arg) diff --git a/elisp/geiser-mode.el b/elisp/geiser-mode.el index cc5a00f..fa686ec 100644 --- a/elisp/geiser-mode.el +++ b/elisp/geiser-mode.el @@ -28,6 +28,7 @@ (require 'geiser-doc) (require 'geiser-compile) (require 'geiser-completion) +(require 'geiser-company) (require 'geiser-xref) (require 'geiser-edit) (require 'geiser-autodoc) @@ -52,6 +53,11 @@ :group 'geiser-autodoc :type 'boolean) +(defcustom geiser-mode-company-p t + "Whether to use company-mode for completion, if available." + :group 'geiser-mode + :type 'boolean) + (defcustom geiser-mode-smart-tab-p nil "Whether `geiser-smart-tab-mode' gets enabled by default in Scheme buffers." :group 'geiser-mode @@ -188,6 +194,7 @@ interacting with the Geiser REPL is at your disposal. (when geiser-mode (geiser-impl--set-buffer-implementation)) (setq geiser-autodoc-mode-string "/A") (setq geiser-smart-tab-mode-string "/T") + (geiser-company--setup (and geiser-mode geiser-mode-company-p)) (when geiser-mode-autodoc-p (geiser-autodoc-mode geiser-mode)) (when geiser-mode-smart-tab-p (geiser-smart-tab-mode geiser-mode))) diff --git a/elisp/geiser-reload.el b/elisp/geiser-reload.el index 97b398d..5a30e1f 100644 --- a/elisp/geiser-reload.el +++ b/elisp/geiser-reload.el @@ -38,6 +38,7 @@ geiser-doc geiser-debug geiser-impl + geiser-company geiser-completion geiser-autodoc geiser-compile diff --git a/elisp/geiser-repl.el b/elisp/geiser-repl.el index bed653f..4ea1bb7 100644 --- a/elisp/geiser-repl.el +++ b/elisp/geiser-repl.el @@ -24,6 +24,7 @@ ;;; Code: +(require 'geiser-company) (require 'geiser-autodoc) (require 'geiser-edit) (require 'geiser-impl) @@ -70,6 +71,11 @@ implementation name gets appended to it." :type 'boolean :group 'geiser-repl) +(defcustom geiser-repl-company-p t + "Whether to use company-mode for completion, if available." + :group 'geiser-mode + :type 'boolean) + (defcustom geiser-repl-read-only-prompt-p t "Whether the REPL's prompt should be read-only." :type 'boolean @@ -293,6 +299,7 @@ If no REPL is running, execute `run-geiser' to start a fresh one." (set-syntax-table scheme-mode-syntax-table) (setq geiser-eval--get-module-function 'geiser-repl--module-function) (when geiser-repl-autodoc-p (geiser-autodoc-mode 1)) + (geiser-company--setup geiser-repl-company-p) (compilation-shell-minor-mode 1)) (define-key geiser-repl-mode-map "\C-d" 'delete-char) -- cgit v1.2.3