2020-02-19 23:07:30 +00:00
|
|
|
;;; packages.el --- rcirc Layer packages File for Spacemacs
|
2018-11-19 21:07:53 +00:00
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2018-11-19 21:07:53 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
2021-03-24 03:31:44 +00:00
|
|
|
;; This program 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 program 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
2018-11-19 21:07:53 +00:00
|
|
|
|
2020-06-25 23:47:55 +00:00
|
|
|
(defconst rcirc-packages
|
|
|
|
'(
|
|
|
|
company
|
|
|
|
company-emoji
|
|
|
|
emoji-cheat-sheet-plus
|
|
|
|
emojify
|
|
|
|
(erc-image :toggle rcirc-enable-erc-image)
|
|
|
|
(erc-tweet :toggle rcirc-enable-erc-tweet)
|
|
|
|
(erc-yt :toggle rcirc-enable-erc-yt)
|
|
|
|
flyspell
|
|
|
|
(helm-rcirc :location local
|
|
|
|
:requires helm)
|
|
|
|
persp-mode
|
|
|
|
rcirc
|
|
|
|
rcirc-color
|
2021-03-19 05:34:36 +00:00
|
|
|
(rcirc-late-fix :location (recipe :fetcher url
|
|
|
|
:url "https://raw.githubusercontent.com/emacsmirror/emacswiki.org/master/rcirc-late-fix.el")
|
2020-06-25 23:47:55 +00:00
|
|
|
:toggle rcirc-enable-late-fix)
|
|
|
|
rcirc-notify
|
|
|
|
(rcirc-styles :toggle rcirc-enable-styles)
|
|
|
|
window-purpose))
|
2015-03-13 07:34:27 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun rcirc/post-init-company ()
|
2017-01-02 05:39:04 +00:00
|
|
|
(spacemacs|add-company-backends :backends company-capf :modes rcirc-mode))
|
2015-08-27 01:55:28 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun rcirc/post-init-company-emoji ()
|
2017-01-02 05:39:04 +00:00
|
|
|
(spacemacs|add-company-backends :backends company-emoji :modes rcirc-mode))
|
2015-08-27 01:55:28 +00:00
|
|
|
|
|
|
|
(defun rcirc/post-init-emoji-cheat-sheet-plus ()
|
|
|
|
(add-hook 'rcirc-mode-hook 'emoji-cheat-sheet-plus-display-mode))
|
|
|
|
|
2018-11-25 23:06:11 +00:00
|
|
|
(defun rcirc/post-init-emojify ()
|
|
|
|
(spacemacs|use-package-add-hook rcirc
|
|
|
|
:post-config
|
|
|
|
(use-package emojify
|
|
|
|
:hook (rcirc-mode . emojify-mode)
|
|
|
|
:if rcirc-enable-emojify)))
|
|
|
|
|
2018-11-25 23:34:30 +00:00
|
|
|
(defun rcirc/init-erc-image ()
|
|
|
|
(spacemacs|use-package-add-hook rcirc
|
|
|
|
:post-config
|
|
|
|
(use-package erc-image
|
|
|
|
:if rcirc-enable-erc-image
|
|
|
|
:init (with-eval-after-load 'rcirc
|
|
|
|
(setq erc-image-images-path (concat spacemacs-cache-directory
|
|
|
|
"erc-image/"))
|
|
|
|
(make-directory erc-image-images-path t)
|
|
|
|
(add-hook 'rcirc-markup-text-functions
|
|
|
|
#'spacemacs//rcirc-image-show-url)))))
|
|
|
|
|
2018-11-25 23:37:32 +00:00
|
|
|
(defun rcirc/init-erc-tweet ()
|
|
|
|
(spacemacs|use-package-add-hook rcirc
|
|
|
|
:post-config
|
|
|
|
(use-package erc-tweet
|
|
|
|
:if rcirc-enable-erc-tweet
|
|
|
|
:init (with-eval-after-load 'rcirc
|
|
|
|
(setq erc-tweet-cache-dir (concat spacemacs-cache-directory
|
|
|
|
"erc-tweet/"))
|
|
|
|
(make-directory erc-tweet-cache-dir t)
|
|
|
|
(add-hook 'rcirc-markup-text-functions
|
|
|
|
#'spacemacs//rcirc-tweet-show-tweet)))))
|
|
|
|
|
2018-11-25 23:39:47 +00:00
|
|
|
(defun rcirc/init-erc-yt ()
|
|
|
|
(spacemacs|use-package-add-hook rcirc
|
|
|
|
:post-config
|
|
|
|
(use-package erc-yt
|
|
|
|
:if rcirc-enable-erc-yt
|
|
|
|
:init
|
|
|
|
(with-eval-after-load 'rcirc
|
|
|
|
(setq erc-yt-cache-dir (concat spacemacs-cache-directory "erc-yt/"))
|
|
|
|
(make-directory erc-yt-cache-dir t)
|
|
|
|
(add-hook 'rcirc-markup-text-functions
|
|
|
|
#'spacemacs//rcirc-youtube-show-info)))))
|
|
|
|
|
2015-10-31 13:30:10 +00:00
|
|
|
(defun rcirc/post-init-flyspell ()
|
2015-12-09 11:29:19 +00:00
|
|
|
(spell-checking/add-flyspell-hook 'rcirc-mode-hook))
|
2015-10-31 13:30:10 +00:00
|
|
|
|
2016-05-30 02:39:21 +00:00
|
|
|
(defun rcirc/init-helm-rcirc ()
|
|
|
|
(use-package helm-rcirc
|
|
|
|
:commands helm-rcirc-auto-join-channels
|
|
|
|
:init
|
|
|
|
(spacemacs/set-leader-keys "irc" 'helm-rcirc-auto-join-channels)))
|
2016-01-18 03:06:04 +00:00
|
|
|
|
2018-01-10 04:01:34 +00:00
|
|
|
(defun rcirc/pre-init-persp-mode ()
|
|
|
|
(spacemacs|use-package-add-hook persp-mode
|
|
|
|
:post-config
|
2016-02-27 14:29:56 +00:00
|
|
|
(progn
|
2018-01-10 04:01:34 +00:00
|
|
|
(add-to-list 'persp-filter-save-buffers-functions
|
|
|
|
'spacemacs//rcirc-persp-filter-save-buffers-function)
|
2018-01-10 07:23:06 +00:00
|
|
|
(spacemacs|define-custom-layout rcirc-spacemacs-layout-name
|
|
|
|
:binding rcirc-spacemacs-layout-binding
|
2018-01-10 04:01:34 +00:00
|
|
|
:body
|
|
|
|
(progn
|
2018-01-10 07:23:06 +00:00
|
|
|
(add-hook 'rcirc-mode-hook #'spacemacs//rcirc-buffer-to-persp)
|
|
|
|
(call-interactively #'spacemacs/rcirc))))))
|
2015-11-09 04:51:29 +00:00
|
|
|
|
2015-03-13 07:34:27 +00:00
|
|
|
(defun rcirc/init-rcirc ()
|
|
|
|
(use-package rcirc
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-03-16 01:42:40 +00:00
|
|
|
:init
|
|
|
|
(progn
|
2015-08-28 11:02:20 +00:00
|
|
|
(spacemacs/add-to-hook 'rcirc-mode-hook '(rcirc-omit-mode
|
2020-06-25 23:47:55 +00:00
|
|
|
rcirc-track-minor-mode))
|
2015-03-18 02:50:11 +00:00
|
|
|
|
2020-06-28 21:25:04 +00:00
|
|
|
(spacemacs/set-leader-keys "acir" 'spacemacs/rcirc)
|
|
|
|
(spacemacs/declare-prefix "aci" "irc")
|
2018-11-26 01:02:34 +00:00
|
|
|
(evil-set-initial-state 'rcirc-mode 'insert)
|
2015-03-13 07:34:27 +00:00
|
|
|
(setq rcirc-fill-column 80
|
|
|
|
rcirc-buffer-maximum-lines 2048
|
|
|
|
rcirc-omit-responses '("JOIN" "PART" "QUIT" "NICK" "AWAY" "MODE")
|
|
|
|
rcirc-time-format "%Y-%m-%d %H:%M "
|
2018-01-13 06:58:21 +00:00
|
|
|
rcirc-omit-threshold 20
|
|
|
|
rcirc-log-directory (concat spacemacs-cache-directory "/rcirc-logs/")
|
2018-11-26 01:02:34 +00:00
|
|
|
rcirc-log-flag t))
|
2018-01-13 06:58:21 +00:00
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
;; (set-input-method "latin-1-prefix")
|
2021-03-18 03:19:25 +00:00
|
|
|
(setq-local scroll-conservatively 8192)
|
2015-03-13 07:34:27 +00:00
|
|
|
|
|
|
|
;; Exclude rcirc properties when yanking, in order to be able to send mails
|
|
|
|
;; for example.
|
|
|
|
(add-to-list 'yank-excluded-properties 'rcirc-text)
|
|
|
|
|
2015-03-16 01:42:40 +00:00
|
|
|
;; load this file from the dropbox location load-path
|
|
|
|
;; this is where you can store personal information
|
2015-03-13 07:34:27 +00:00
|
|
|
(require 'pinit-rcirc nil 'noerror)
|
|
|
|
|
2015-04-21 03:29:33 +00:00
|
|
|
(evil-define-key 'normal rcirc-mode-map
|
|
|
|
(kbd "C-j") 'rcirc-insert-prev-input
|
|
|
|
(kbd "C-k") 'rcirc-insert-next-input)
|
2015-03-13 07:34:27 +00:00
|
|
|
|
2015-03-16 01:42:40 +00:00
|
|
|
;; add a key for EMMS integration
|
|
|
|
(when (boundp 'emms-track-description)
|
2017-06-18 10:47:11 +00:00
|
|
|
(define-key rcirc-mode-map (kbd "C-c C-e") 'spacemacs/rcirc-insert-current-emms-track))
|
2015-03-13 07:34:27 +00:00
|
|
|
|
2015-03-17 19:42:41 +00:00
|
|
|
;; Minimal logging to `~/.emacs.d/.cache/rcirc-logs/'
|
2015-03-13 07:34:27 +00:00
|
|
|
;; by courtesy of Trent Buck.
|
2017-06-18 10:47:11 +00:00
|
|
|
(add-hook 'rcirc-print-hooks 'spacemacs//rcirc-write-log)
|
2015-03-16 01:42:40 +00:00
|
|
|
|
|
|
|
;; dependencies
|
|
|
|
;; will autoload rcirc-notify
|
|
|
|
(rcirc-notify-add-hooks)
|
2018-11-25 23:22:14 +00:00
|
|
|
(require 'rcirc-color)
|
|
|
|
(when rcirc-enable-styles
|
|
|
|
(require 'rcirc-styles)
|
|
|
|
(spacemacs/declare-prefix-for-mode 'rcirc-mode "mi" "insert")
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'rcirc-mode
|
|
|
|
"ic" 'rcirc-styles-insert-color
|
|
|
|
"ia" 'rcirc-styles-insert-attribute
|
|
|
|
"ip" 'rcirc-styles-toggle-preview)))))
|
2015-03-13 07:34:27 +00:00
|
|
|
|
2015-08-27 01:55:28 +00:00
|
|
|
(defun rcirc/init-rcirc-color ()
|
2018-03-04 04:37:53 +00:00
|
|
|
(use-package rcirc-color :defer t))
|
2015-08-27 01:55:28 +00:00
|
|
|
|
2018-04-21 04:55:02 +00:00
|
|
|
(defun rcirc/init-rcirc-late-fix ()
|
|
|
|
(spacemacs|use-package-add-hook rcirc
|
|
|
|
:post-config
|
|
|
|
(when rcirc-enable-late-fix
|
|
|
|
(use-package rcirc-late-fix))))
|
|
|
|
|
2018-11-25 23:22:14 +00:00
|
|
|
(defun rcirc/init-rcirc-styles ()
|
|
|
|
(use-package rcirc-styles))
|
|
|
|
|
2015-03-13 07:34:27 +00:00
|
|
|
(defun rcirc/init-rcirc-notify ()
|
|
|
|
(use-package rcirc-notify
|
2018-03-04 04:37:53 +00:00
|
|
|
:defer t
|
2015-03-16 01:42:40 +00:00
|
|
|
:config
|
2015-03-13 07:34:27 +00:00
|
|
|
(progn
|
2015-03-16 01:42:40 +00:00
|
|
|
(add-hook 'rcirc-notify-page-me-hooks 'spacemacs/rcirc-notify-beep))))
|
2018-01-08 07:53:13 +00:00
|
|
|
|
2020-06-25 23:47:55 +00:00
|
|
|
(defun rcirc/post-init-window-purpose ()
|
|
|
|
(purpose-set-extension-configuration
|
|
|
|
:rcirc-layer
|
|
|
|
(purpose-conf :mode-purposes '((rcirc-mode . chat)))))
|