Famous Quotes

There are no "knowns." There are things we know that we know. There are known unknowns. That is to say there are things that we now know we don't know. But there are also unknown unknowns. There are things we do not know we don't know.

-Donald Rumsfeld

Friday, May 18, 2012

Emacs in Maximized mode by default


I hope that many would agree that emacs is one of the greatest editors made by the one and only R.M.S!!

 

It happens to be  my favorite too..

 

Well, one of the problems i face,when i use emacs in interactive mode is.. i need to press maximize icon everytime to go to full screen..

 

And thats when python came to rescue..

Open the config file of emacs.. That will be there in your home folder..
If you prefer terminal, then,

1.  Type cd
    
         **-desktop$ cd

2.  Open .emacs file

         **-desktop$ emacs .emacs

If you go by GUI, then,

1. Go to your home folder
2. Enable 'Show hidden files' option in View menu
3. Browse through the folder to find .emacs and then open it.. 


Add this code in the file...

(defun toggle-fullscreen ()
  (interactive)
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
        '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
        '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
)
(toggle-fullscreen)


Now that should open emacs in Maximized mode with all the icons  unlike -fs mode which disables few toolbars..

Voila!!

Coutesy: Source of this code :) 






No comments:

Post a Comment