Giter Club home page Giter Club logo

slime-company's Introduction

slime-company

A company-mode completion backend for Slime, "The Superior Lisp Interaction Mode for Emacs".

screenshot

Setup

The recommended way to install slime-company is via MELPA. If not using MELPA, put this file somewhere into your load-path (or just into slime-path/contribs).

To activate the contrib add it to the slime-setup call in your .emacs

(slime-setup '(slime-fancy slime-company))

You may also want to M-x customize-group slime-company to select the completion method (use fuzzy' if you like to complete package names), the major modes where slime-company` is automatically activated, what do do after a successful completion and how to display the argument list of a function.

These customization variables can also be set manually. An example with `use-package' looks like this:

(use-package slime-company
  :after (slime company)
  :config (setq slime-company-completion 'fuzzy
                slime-company-after-completion 'slime-company-just-one-space))

The following bindings for company-active-map will add the usual navigation keys to the completion menu:

(define-key company-active-map (kbd "\C-n") 'company-select-next)
(define-key company-active-map (kbd "\C-p") 'company-select-previous)
(define-key company-active-map (kbd "\C-d") 'company-show-doc-buffer)
(define-key company-active-map (kbd "M-.") 'company-show-location)

slime-company's People

Contributors

akanouras avatar anwyn avatar astrangeguy avatar fanael avatar josteink avatar juergenhoetzel avatar purcell avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

slime-company's Issues

Completing package names

Maybe I'm doing something wrong, but, when I type the beginning of a package name like (cl- company mode does not help me complete the package name, no completions appear. It does provide completions once I type the semicolon after the complete package name. I can complete the package name with C-M-i (slime-complete-symbol).

Submit for inclusion in slime distribution?, + feature

Hi,
I didn't know about this until recently and thought it might get more use if you included it in the slime distribution at https://github.com/slime/slime

Also, I added an extension that uses slime-company but completes over symbols in all packages. It's written as a separate contrib right now but thought I would see if you want to integrate something like this directly into slime-company.

Selfishly, if I give my contrib to the slime project it would be easier if yours was there as well, since I build on it.

Source at https://github.com/alanruttenberg/slime/blob/slime-company/contrib/slime-allsymbols-company.el and corresponding .lisp

Suggestions welcome, of course.

company-slime backend not appearing on company-backends

I'm having some issues making slime-company work. The backend does not appear on company-backends and I'm not getting proper completions.

Reproducing:

init.el:

(defconst +emacs-dir+ (expand-file-name (if load-file-name
                                            (file-name-directory load-file-name)
                                          "~/.emacs.d/")))

(defconst +packages-dir+ (concat +emacs-dir+ "packages/"))

(defconst +packages+ '(company slime slime-company))

(defun load-package (package)
  (unless (package-installed-p package)
    (package-refresh-contents)
    (package-install package))
  (require package))

(setq package-archives '(("melpa-stable" . "https://stable.melpa.org/packages/")
                         ("melpa" . "https://melpa.org/packages/")
                         ("gnu" . "https://elpa.gnu.org/packages/"))
      package-archive-priorities '(("melpa-stable" . 20)
                                   ("melpa" . 10)
                                   ("gnu" . 0))
      package-user-dir +packages-dir+
      package-enable-at-startup nil)
(package-initialize)

(mapc #'load-package +packages+)

(setq company-idle-delay nil)
(global-company-mode t)

(setq inferior-lisp-program "sbcl")
(slime-setup '(slime-fancy
               slime-banner
               slime-company
               slime-indentation))

(global-set-key (kbd "C-<SPC>") #'company-complete)

Load Emacs with emacs -q -l init.el.

After load is finished do M-x slime.

Go to the SLIME REPL window, then M-x eval-expression company-backends. The company-slime backend does not appear there.

When trying to complete something, the options shown are from the other company backends. See the image below.

error

What am I doing wrong?

company 0.9.4
slime 2.19
slime-company 1.1

Syntax highlighting for *company-documentation*

Can we add syntax highlighting for the documentation buffer?

With a minimum of something like this:

(setq slime-company-doc-highlights
      `(("^  [^\\[ ]\\([^:]*\\):" . font-lock-doc-face)))

(define-derived-mode slime-company-doc-mode fundamental-mode "slime-company-doc"
  "Documentation mode for slime-company."
  (setq font-lock-defaults '(slime-company-doc-highlights)))

Complete symbol names immediately after package name

After package name is completed, I'd like slime-company to immediately suggest further completion without calling it manually.

I tried the following:

(defun my/special-completion (completion-string)
  (and (string-equal ":" (substring completion-string -1 nil))
       (company-complete)))
(setq slime-company-after-completion 'my/special-completion)

to no effect aside from the following error:

Company: An error occurred in post-command
Company: frontend company-pseudo-tooltip-unless-just-one-frontend error "Company: backend nil error "Symbol’s function definition is void: nil" with args (annotation some-package:)" on command post-command

Debugger does show completions returned properly at some point but the company “widget” does not appear. Some information from debugger:

  • (company-manual-begin) evaluates to seemingly correct completion data
  • (company--insert-candidate #("some-package:" 0 14 (score "214.79" flags "-------p"))) evaluates to nil
  • (company-complete) evaluates to company-complete-common

I also tried (company-begin-backend 'company-slime) instead of (company-complete), to the exact same results. Tried adding (interactive) declaration to my/special-completion with various options, more or less blindly (don't have much experience with it).

Maybe I call it the wrong way, or maybe this has to be implemented at a deeper level.

"Company: backend company-slime error..."

Hello,

I'm using the Development branch of Spacemacs and since its last update installed ~/.emacs.d/elpa/develop/slime-company-20210121.2336/slime-company.el (version 1.4?), I've been receiving these Messages:

Company: An error occurred in auto-begin
Company: backend company-slime error "Symbol’s function definition is void: simple" with args (candidates ...)

and slime-company has not been auto-completing.

Possibly connected to #23?

Reverting to slime-company-20210119.1552 (version 1.3?) solves the problem and returns the expected behavior.

Thank you for your help.

Fork `slime-fontify-string`from `slime-autodoc`

slime-company uses either slime-fontify-string or slime-autodoc--fontify from SLIME. slime-fontify-string had been removed, albeit now the SLIME maintainers have kindly added it back, but deprecated. slime-autodoc--fontify is a private function and could change without notice (see slime/slime#249). Since SLIME is in the public domain, it could make sense to just copy the code for slime-fontify-string, rename it, and maintain it separately.

Thanks for your attention.

error while fetching package description with ::

When completing cl:: and similar, I get the following error:

The symbol following #: contains a package marker: "CL:"

  Line: 1, Column: 4, File-Position: 4

It appears to be from https://github.com/anwyn/slime-company/blob/master/slime-company.el#L254-L255 in slime-company--doc-buffer , which only strips one : from the candidate.

Changing it to

  (format "#:%s" (string-remove-suffix ":" (string-remove-suffix ":" candidate))

avoids the error, but presumably there is some better way to strip one or more : than calling string-remove-suffix twice

Unable to use slime-company

I've installed the packages slime and slime-company.

However, when I try to load slime-company:

slime-setup '(slime-company))

I get the following errors:

Symbol's value as variable is void: slime-company

so I'm unable to use this package

Unable to show completions

Aquamacs3.5 & sbcl2.0.2 & slime from melpa, just updated.
Sorry to bother
Here is my problem:
Doesn't show complete completions

  1. In a lisp file:
    image
  2. In slime:
    image
    My config:
(use-package company
  :ensure t
  :init
  (add-hook 'after-init-hook 'global-company-mode)
  :bind
  ("M-n" . #'company-select-next)
  ("M-p" . #'company-select-previous)
  ("C-n" . nil)
  ("C-p" . nil))
(use-package slime
  :ensure t
  :init
  (setq inferior-lisp-program "sbcl")
  (setq slime-lisp-implementations
	'((sbcl ("sbcl" "--core" "/Users/null/Library/Preferences/Aquamacs Emacs/sbcl.core-for-slime"))))
  :config
  (use-package slime-company
    :ensure t)
  (eval-after-load "slime"  '(progn (slime-setup '(slime-fancy slime-company)))))

But command complete-symbol can show a completion list:
image
Besides, company work correctly in .el files.
Please help.

Doesn't work without (require 'cl)

Hello!
It seems it doesn't work when I try to use it with use-package. It looks like it's missing (require 'cl) even though it has this:

(eval-when-compile
  (require 'cl))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.