[erc] Refactor window purpose allocation to use official form

In the old form the wrong type of extension
was added, this prevented any reconfiguration
of purpose allocations in the dotfile.

Now the right type of allocation is used
allowing users to overwrite the config easily.
How this is done is described in
the purpose layer.
This commit is contained in:
Maximilian Wolff 2020-06-26 01:29:10 +02:00
parent c4e420cf36
commit 689244821c
No known key found for this signature in database
GPG key ID: 2DD07025BFDBD89A
3 changed files with 8 additions and 7 deletions

View file

@ -1,6 +1,6 @@
;;; config.el --- erc Layer configuration File for Spacemacs
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs

View file

@ -1,6 +1,6 @@
;;; funcs.el --- Spacemacs ERC Layer functions File
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs

View file

@ -1,6 +1,6 @@
;;; packages.el --- erc Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
;; Copyright (c) 2012-2020 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
@ -224,7 +224,7 @@
"find current erc channel's log file in `erc-view-log-mode'"
(interactive)
(when (erc-logging-enabled)
(find-file-existing (erc-current-logfile)))))))
(find-file-existing (erc-current-logfile)))))))
(defun erc/init-erc-image ()
(use-package erc-image
@ -256,6 +256,7 @@
(erc/default-servers)
(call-interactively 'erc)))))))
(defun erc/pre-init-window-purpose ()
(spacemacs|use-package-add-hook window-purpose
:pre-config (add-to-list 'purpose-user-mode-purposes '(erc-mode . chat))))
(defun erc/post-init-window-purpose ()
(purpose-set-extension-configuration
:erc-layer
(purpose-conf :mode-purposes '((erc-mode . chat)))))