From a9d362f8db9e6886c1c97031ca045c791eb93058 Mon Sep 17 00:00:00 2001 From: "Collin J. Doering" Date: Thu, 23 Oct 2014 03:52:31 -0400 Subject: [PATCH] Use emacs for IRC in place of weechat Wanted to switch to emacs for irc as it requires a lot of text typing and manipulation. Anyways after trying ERC and rcirc I decided to go with rcirc as I was having issues with ERC connecting to a username for no reason on freenode (username "codeblock"). Anyways there is still some residual elisp (commented) out for setting up ERC which is no longer needed and will be cleaned up in a later commit. In .tmux.conf start emacs instead of weechat. Note: it would be nice to be able to have emacs open to a particular buffer if its open or maybe have emacs remember a window layout for irc chat In .emacs.d/themes/manoj-transparent.el make ERC fit my mode-line theme. This isn't really needed but won't hurt to stay if I ever choose to switch to ERC for whatever reason. See: [1]: https://www.youtube.com/watch?v=7WJCnC5ebf4&list=UU6107grRI4m0o2-emgoDnAA [2]: http://www.emacswiki.org/emacs/ERC [3]: http://www.emacswiki.org/emacs/InternetRelayChat Signed-off-by: Collin J. Doering --- .emacs | 70 +++++++++++++++++++++- .emacs.d/themes/manoj-transparent-theme.el | 2 +- .tmux.conf | 5 +- 3 files changed, 73 insertions(+), 4 deletions(-) diff --git a/.emacs b/.emacs index a5e5755..24df95c 100644 --- a/.emacs +++ b/.emacs @@ -200,6 +200,72 @@ (require 'helm-ls-git) (global-set-key (kbd "C-x C-d") 'helm-browse-project) +;; Use rcirc for irc; see: http://www.emacswiki.org/emacs/rcirc *TODO* currently broken +(require 'rcirc) + +;; Use rcirc-notify extension; see: http://www.emacswiki.org/emacs/rcircNotify +(eval-after-load 'rcirc '(require 'rcirc-notify)) + +;; Include date in time stamp. +(setq rcirc-time-format "%Y-%m-%d %H:%M ") + +;; Change user info +(setq rcirc-default-nick "rekahsoft" + rcirc-default-user-name "rekahsoft" + rcirc-default-full-name "rekahsoft" + rcirc-log-flag t + rcirc-log-directory "~/.emacs.d/rcirc-log") + +(setq rcirc-server-alist + '(("irc.freenode.net" :port 6697 :encryption tls + :channels ("#emacs" "#haskell" "#racket" "#xmonad")) + ("localhost" :port 6667 :channels ()))) + +;; Thanks to: http://www.emacswiki.org/emacs/rcircReconnect +(eval-after-load 'rcirc + '(defun-rcirc-command reconnect (arg) + "Reconnect the server process." + (interactive "i") + (unless process + (error "There's no process for this target")) + (let* ((server (car (process-contact process))) + (port (process-contact process :service)) + (nick (rcirc-nick process)) + channels query-buffers) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (eq process (rcirc-buffer-process)) + (remove-hook 'change-major-mode-hook + 'rcirc-change-major-mode-hook) + (if (rcirc-channel-p rcirc-target) + (setq channels (cons rcirc-target channels)) + (setq query-buffers (cons buf query-buffers)))))) + (delete-process process) + (rcirc-connect server port nick + rcirc-default-user-name + rcirc-default-full-name + channels)))) + +;; Thanks to: http://www.emacswiki.org/emacs/rcircAll +(eval-after-load 'rcirc + '(defun-rcirc-command all (input) + "Run the arguments as a command for all connections. +Example use: /all away food or /all quit zzzz." + (interactive "s") + (let ((buffers (mapcar 'process-buffer (rcirc-process-list)))) + (dolist (buf buffers) + (with-current-buffer buf + (goto-char (point-max)) + (insert "/" input) + (rcirc-send-input)))))) + +;; Connect to servers +;;(rcirc-connect "irc.freenode.net") +;;(rcirc-connect "localhost") +(rcirc nil) + +;; Setup ERC (ERC specific config located: .emacs.d/.ercrc) +;(require 'erc) ;; Require ibuffer extentions (used for ibuffer-never-show-predicates) (require 'ibuf-ext) ;; Built-in @@ -323,6 +389,7 @@ (mode . org-mode) (name . "^\\.org$") (name . "^\\.org.gpg$"))) + ("IRC" (mode . rcirc-mode)) ("mu4e" (or (mode . mu4e-main-mode) (mode . mu4e-compose-mode) @@ -598,7 +665,8 @@ ;; Setup rainbow-delimiters (require 'rainbow-delimiters) ;; ELPA -(global-rainbow-delimiters-mode) +(activate-mode-with-hooks 'rainbow-delimiters-mode-enable lispy-langs-hooks) +;;(global-rainbow-delimiters-mode) ;; breaks font coloring in erc for some reason? ;; Setup rainbow-mode ;; ELPA (require 'rainbow-mode) diff --git a/.emacs.d/themes/manoj-transparent-theme.el b/.emacs.d/themes/manoj-transparent-theme.el index 6e1cd3b..27d3507 100644 --- a/.emacs.d/themes/manoj-transparent-theme.el +++ b/.emacs.d/themes/manoj-transparent-theme.el @@ -226,7 +226,7 @@ jarring angry fruit salad look to reduce eye fatigue.") '(erc-direct-msg-face ((t (:foreground "sandybrown")))) '(erc-error-face ((t (:foreground "red")))) '(erc-fool-face ((t (:foreground "dim gray")))) - '(erc-header-line ((t (:background "grey95" :foreground "ConFlowerBlue")))) + '(erc-header-line ((t (:background "grey95" :foreground "grey20")))) '(erc-input-face ((t (:foreground "brown")))) '(erc-inverse-face ((t (:background "Black" :foreground "White")))) '(erc-keyword-face ((t (:bold t :foreground "pale green" :weight bold)))) diff --git a/.tmux.conf b/.tmux.conf index 37bab40..19f710a 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -6,7 +6,7 @@ unbind C-b set -g prefix C-t -;; Mimic 256 colors +# Mimic 256 colors set -g default-terminal "screen-256color" # Toggle last window like screen @@ -14,5 +14,6 @@ bind-key C-t last-window # session initialization new -s default -n zsh zsh -neww -n weechat weechat-curses +#neww -n weechat weechat-curses +neww -n emacs emacsclient selectw -t 1