Hacker News new | past | comments | ask | show | jobs | submit login
Emacs as a tiling window manager (monkey.org)
65 points by mariusae on Jan 27, 2010 | hide | past | favorite | 14 comments



The main benefit of this as I see it - moving between windows (in the emacs sense of the word) - can be got by installing windmove.el ( http://www.emacswiki.org/emacs/WindMove ). Once you've got it it's hard to go without (actually the author of this piece used windmove too!). Another indespensible tool is winner-mode ( http://www.emacswiki.org/emacs/WinnerMode ) which remembers emacs window layouts and allows you to "undo" window changes.


I also forgot, for fullscreen on Windows I use w32-fullscreen which comes as part of darkroom-mode: http://www.martyn.se/code/emacs/darkroom-mode.


Interesting that this came up today. I've just started writing an xmonad layout manager that asks emacs where a certain buffer is physically on the screen, and then it puts a regular window on top of that. (It will also let you emacs focus and unfocus that window, so pop-to-buffer will move xmonad's focus there, if necessary; and mod-j/mod-k will delegate to emacs when necessary.)

Anyway, the idea is to let you have a full-screen emacs with a real xterm or web browser "inside" of it.


I've been wanting to do something like this for a while. I've got various experiments using the RatPoision WM (which I use anyway) but I've never managed to get precise buffer dimensions out of emacs or deal properly with focus. How far along have you got?


Unless you patch the Cocoa display logic, the fullscreen function won't work for those using Cocoa Emacs. You can still get 90% there using maxframe.el[0].

    ;; psuedo-fullscreen
    (require 'maxframe)
    (setq mf-max-width 1440)
    
    (defun toggle-maxframe ()
      (interactive)
      (if (eq (mf-max-columns (mf-max-display-pixel-width)) (frame-width))
          (restore-frame)
        (maximize-frame)))
    (global-set-key (kbd "<s-return>") 'toggle-maxframe)
[0]: http://github.com/jmjeong/my-dot-emacs/blob/master/maxframe....


This will also work without the dependencies:

  (defun maximize-frame ()
    (interactive)
    (set-frame-size (selected-frame)
                    (display-pixel-width)
                    (display-pixel-height))
    (set-frame-position (selected-frame) 0 0))
EDIT: Should've read the help :)


This is possible in Vim as well :D, check out -> http://amix.dk/blog/post/19403#Hacking-without-distractions

Regarding the moving between windows it can be done with following maps in Vim:

   map <C-j> <C-W>j
   map <C-k> <C-W>k
   map <C-h> <C-W>h
   map <C-l> <C-W>l


Not really. Vim can't run a command inside a window like Emacs.


His hack isn't about running commands inside Emacs, but Emacs in fullscreen mode and Emacs window management - and... Vim can do pretty much the same as what he shows in that blog post and in his screenshots.


His screenshot shows at least one window running a shell.



Just tried in Aquamacs 1.9, seems to work, except I have the Command key as meta (because of years of having the Meta key immediately to the left of the spacebar), so the M-h binding ends up hiding Aquamacs rather than moving focus left. There should be a way to correct that because Aquamacs disables some other standard Mac "Command-" bindings when using Command as meta.


Cool stuff - especially when I decided to switch to emacs from vim.

Fixes one of the annoyances (moving between splits)


cor, what a lot of nonsense

    % aux/vga -l 1024x768x16
    % exec acme # instead of rio
all done




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: