This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+chat/slack
syl20bnr 584392bd92 [core] Fix layer dependencies based on layer variables
There was a edge case with the declaration of the `lsp` layer in `layers.el`
files.
The `hy` layer depends on the `python` layer which in turn depends on the `lsp`
layer if and only if the `python-backend` layer variable is set to `lsp`.
When the `hy` layer was declared first then it declares the `python` layer
without its layer variables, thus the `lsp` layer was not declared because the
`python-backend` variable was not set.

The fix is to gather all the layer dependencies and resolve them only after all
the used layers have been declared.

* new function `configuration-layer/declare-layer-dependencies`
* replace all calls to `configuration-layer/declare-layer` by the new function
  except for distribution layers (we declare layer dependencies right away in
  distribution layers)
2019-09-30 02:00:48 -04:00
..
img
config.el Happy New Year 2018! 2018-01-04 02:00:25 -05:00
funcs.el Fix errors in rcirc and slack layers 2018-01-10 22:09:47 -05:00
layers.el [core] Fix layer dependencies based on layer variables 2019-09-30 02:00:48 -04:00
packages.el purpose: Add chat and mail purposes 2019-06-09 21:47:21 +02:00
README.org Switch to the new layers generator 2019-05-15 21:08:21 +03:00

Slack layer

/TakeV/spacemacs/media/commit/2d154bec8e01285d8f35fc006e9193cc13f40ce1/layers/+chat/slack/img/slack.png

Description

This layer provides an interface to the Slack chat service via the emacs-slack package. Where possible, this layer aims to reuse key bindings from the IRC packages in Spacemacs.

Features:

Install

To use this configuration layer, add it to your ~/.spacemacs. You will need to add slack to the existing dotspacemacs-configuration-layers list in this file.

Configuration

Follow the instructions in the emacs-slack package for obtaining your client ID, client secret, and token.

To test that everything is alright put the following snippet in your dotspacemacs/user-config() replacing client-id, client-secret and token with your info.

Important Do not keep private data in your dotfile. You can put your private stuff elsewhere (like Dropbox for instance) and load the file in your dotfile.

  (slack-register-team
    :name "emacs-slack"
    :default t
    :client-id "my@email.address"
    :client-secret "mypassword"
    :token "token"
    :subscribed-channels '(general slackbot))

Spacemacs layout integration

A Spacemacs custom layout is defined by the layer. The name and the key binding for it can be customized with the following layer variables:

  • slack-spacemacs-layout-name for the layout name,
  • slack-spacemacs-layout-binding for the key binding.

By default the values are:

  (setq-default dotspacemacs-configuration-layers '(
    (slack :variables slack-spacemacs-layout-name "@Slack"
                      slack-spacemacs-layout-binding "s")))

Key bindings

Key binding Description
SPC a C d Direct message someone
SPC a C g Join a group (private channel)
SPC a C j Join a channel
SPC a C q Close connection
SPC a C r Join a channel, group, or direct messge
SPC a C s (Re)connects to Slack
SPC m c Embed mention of channel
SPC m e Edit message at point
SPC m j Join a channel
SPC m d Direct message someone
SPC m m Embed mention of user
SPC m p Load previous messages
SPC m ) Add reaction (emoji) to a message
SPC m ( Remove reaction (emoji) to a message
SPC m t Show or create thread
SPC m q Quit Slack

The following bindings are provided to mimic bindings in the official Slack client.

Key binding Description
SPC m @ Embed mention of user
SPC m # Embed mention of channel
SPC m ) Add a rection
SPC m k Join a channel

In insert state, one can also use @ and # directly without the leader key prefix.