Skip to content

Commit

Permalink
Add variable rcirc-enable-erc-yt to rcirc layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Miciah authored and duianto committed May 5, 2019
1 parent b654d23 commit e8b600c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.develop
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,8 @@ Other:
package in rcirc for showing linked images in chat (disabled by default).
- New variable =rcirc-enable-erc-tweet= to enable or disable the =erc-tweet=
package in rcirc for showing linked tweets in chat (disabled by default).
- New variable =rcirc-enable-erc-yt= to enable or disable the =erc-yt= package
in rcirc for showing previews for YouTube links (disabled by default).
- Fixed using multiple lines in =.authinfo= (thanks to Jelle Licht)
- Fixed logging where the channel name has =/= in it
(thanks to Abdo Roig-Maranges)
Expand Down
10 changes: 10 additions & 0 deletions layers/+chat/rcirc/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- [[#enabling-emojify-mode][Enabling emojify-mode]]
- [[#enabling-erc-image][Enabling erc-image]]
- [[#enabling-erc-tweet][Enabling erc-tweet]]
- [[#enabling-erc-yt][Enabling erc-yt]]
- [[#enabling-rcirc-styles][Enabling rcirc-styles]]
- [[#key-bindings][Key bindings]]
- [[#rcirc-documentation][Rcirc documentation]]
Expand Down Expand Up @@ -209,6 +210,15 @@ chat, set the variable =rcirc-enable-erc-tweet= to =t= in your dotfile:
(rcirc :variables rcirc-enable-erc-tweet t)))
#+END_SRC

** Enabling erc-yt
To enable erc-yt for fetching and displaying previews for YouTube links in chat,
set the variable =rcirc-enable-erc-yt= to =t= in your dotfile:

#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(
(rcirc :variables rcirc-enable-erc-yt t)))
#+END_SRC

** Enabling rcirc-styles
To enable rcirc-styles for displaying and inserting color and text attribute
codes, set the variable =rcirc-enable-styles= to =t= in your dotfile:
Expand Down
3 changes: 3 additions & 0 deletions layers/+chat/rcirc/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
(defvar rcirc-enable-erc-tweet nil
"if non nil then enable erc-tweet to display tweets in rcirc.")

(defvar rcirc-enable-erc-yt nil
"if non nil then enable erc-yt to display YouTube previews in rcirc.")

(defvar rcirc-enable-late-fix nil
"if non nil then enable rcirc-late-fix to show s/// fixes in rcirc buffers.")

Expand Down
5 changes: 5 additions & 0 deletions layers/+chat/rcirc/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,11 @@ This doesn't support the chanserv auth method. "
(setq erc-fill-prefix rcirc-fill-prefix))
(erc-image-show-url))

;; erc-yt --------------------------------------------------------------------

(defun spacemacs//rcirc-youtube-show-info (_sender _response)
(erc-yt-show-info))

;; erc-tweet --------------------------------------------------------------------

(defun spacemacs//rcirc-tweet-show-tweet (_sender _response)
Expand Down
13 changes: 13 additions & 0 deletions layers/+chat/rcirc/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
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)
Expand Down Expand Up @@ -69,6 +70,18 @@
(add-hook 'rcirc-markup-text-functions
#'spacemacs//rcirc-tweet-show-tweet)))))

(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)))))

(defun rcirc/post-init-flyspell ()
(spell-checking/add-flyspell-hook 'rcirc-mode-hook))

Expand Down

0 comments on commit e8b600c

Please sign in to comment.