i’m a big fan of IRC and we use it in our distributed team to stay in touch and also coordinate testing and upgrades. as i’m also a big fan of the ur-IDE emacs i’m using emacs’s rcirc mode for my IRC needs. typically i have a small buffer window at the bottom of my emacs frame dedicated to IRC. quite nice…
this being emacs there had to be a way to get that IRC buffer window protected. and there is digging into the emacs info docs and looking at the underlying emacs lisp files this is what i came up with:
[sourcecode language="text"] (defun rcirc-toggle-current-window-dedication () (interactive) (let* ((window (selected-window)) (dedicated (window-dedicated-p window))) (set-window-dedicated-p window (not dedicated)) (setq window-size-fixed (not window-size-fixed)) (message "Window %sdedicated to %s" (if dedicated "no longer " "") (buffer-name)))) (global-set-key (kbd "<Scroll_Lock>") 'rcirc-toggle-current-window-dedication) [/sourcecode]
this will toggle the
window-size-fixed bits of the window in which you press the scroll-lock key — and, hey, presto! — no more pirating of the IRC buffer window.