Productivity tools like Slack and code editors are central to any development workflow. However, constantly switching between a chat app and your editor disrupts focus and wastes time. Wouldn't it be great if you could handle Slack conversations, channels, and updates directly from within Emacs?
This post walks you through integrating Slack with Emacs to streamline your workflows. By the end, you'll minimize app switching and keep your focus where it belongs: your code.
Why Integrate Slack with Emacs?
Slack is a hub for team collaboration. Notifications, DMs, and channel updates constantly demand your attention. But with Emacs as your primary editor, toggling between applications for quick Slack interactions can interrupt your train of thought—a known productivity killer. Integrating Slack into Emacs bridges this gap, helping you:
- Stay in the flow of coding while keeping track of communication.
- Reduce your dependence on mouse clicks and browser tabs.
- Handle Slack messages with the same keyboard-first approach you rely on in Emacs.
Let’s look at how to set up this integration in a few simple steps.
Setting up Emacs for Slack
To connect Emacs and Slack, you’ll need to use the emacs-slack package. Here’s how to get started.
1. Install the emacs-slack Package
You can install the emacs-slack package using the Emacs package manager (M-x package-install). Ensure you’re using a recent Emacs version for compatibility.
M-x package-install RET slack
2. Initialize the Package
Load the package and tweak your Emacs configuration. Add the following to your .emacs or init.el file:
(require 'slack)
(setq slack-buffer-emojify t) ;; Show emojis in Slack messages
(setq slack-prefer-current-team t) ;; Default to the currently active team
3. Authenticate with Slack
Using Slack’s API, you’ll need an access token to authorize Emacs to interact with your Slack workspace.
- Go to the Slack API Apps page and create a new "Custom Bot".
- Under OAuth & Permissions, generate a User OAuth Token.
- Add the token to your Emacs configuration:
(setq slack-token "<your-access-token>")
4. Connect to Your Slack Workspace
Once configured, connect to your workspace with:
M-x slack-start
This command will initialize the connection, load your channels, and allow you to manage Slack communication directly from Emacs.
Key Features of Emacs Slack Integration
The Emacs Slack setup is designed for keyboard-driven productivity. Here are some highlights:
Channel Navigation
Use commands like M-x slack-channel-select to quickly switch between channels without ever touching your mouse. It’s efficient and avoids the clutter of Slack’s default app.
Sending and Reading Messages
Replying to DMs or channel updates is straightforward with M-x slack-message-send. Messages are entered in a clean, distraction-free Emacs buffer.
Viewing conversations maintains the same simplicity:
M-x slack-message-list for all messages in a channel.- Search functionality to find specific information or older threads.
Notifications
The integration displays new message notifications for subscribed channels directly within Emacs. Use settings like slack-message-alert to customize your notification preferences so you only receive what’s important.
Take Your Productivity a Step Further
The Emacs Slack integration ensures smooth communication directly from your editor. Combined with detailed configuration options, this setup keeps your workflows focused and efficient. But why stop at Slack? Imagine adding automated workflows directly tied to notifications. With Hoop.dev, you can integrate Slack updates with code review tools, issue tracking, and operational pipelines in just minutes—all from the same starting point.
Sign-up with Hoop.dev to see the power of integrated Slack workflows live, and unlock even greater focus for your team.