Emacs: Added a function to reconnect rcirc
This commit is contained in:
parent
74d252df97
commit
0ebbf64fd1
2 changed files with 25 additions and 1 deletions
|
@ -63,3 +63,28 @@
|
||||||
(insert prefix)
|
(insert prefix)
|
||||||
(dotimes (_ (- 80 col (length prefix) (length postfix))) (insert "u"))
|
(dotimes (_ (- 80 col (length prefix) (length postfix))) (insert "u"))
|
||||||
(insert postfix)))
|
(insert postfix)))
|
||||||
|
|
||||||
|
;; Reconnect rcirc
|
||||||
|
(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))))
|
||||||
|
|
|
@ -14,7 +14,6 @@ function fish_right_prompt
|
||||||
echo -n ']'
|
echo -n ']'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
set -gx EDITOR emacsclient
|
set -gx EDITOR emacsclient
|
||||||
set -gx ALTERNATE_EDITOR emacs
|
set -gx ALTERNATE_EDITOR emacs
|
||||||
set -gx VISUAL emacsclient
|
set -gx VISUAL emacsclient
|
||||||
|
|
Loading…
Reference in a new issue