One of my use cases for emacs is chatting with friends. I use erc for IRC, and emacs-jabber for everything else.
One thing that annoys me a bit is that when my screen is split in two and want to shrink a bit one of the two windows.
There's c-x - (shrink-window-if-larger-than-buffer) but it's only useful for a handful of situations (IMHO)
Here is a little function I wrote to shrink a window to selected region. I find it useful to narrow windows to functions, paragraphs, or just narrowing a chat window to just 5 or 10 lines.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun shrink-window-to-region () | |
(interactive) | |
(let | |
((window-lines (count-lines (window-start) (window-end))) | |
(region-lines (count-lines (region-beginning) (region-end)))) | |
(shrink-window (- window-lines region-lines)))) |
Select a region, and run it. Then c-l to recenter accordingly.
I mainly use it as a more visual narrow-to region.
Have fun
No hay comentarios:
Publicar un comentario