On Wed, Jun 09, 2010 at 08:48:01AM +0800, hkm wrote: > Does anyone know how to start emacs in a given mode? > > Actually I use matlab-shell in emacs. Everytime I have to start > emacs first, and then I can enter matlab-shell mode. What do you mean *every time*? Why not leave Emacs running and open files or your shell from within Emacs? > Is there a way to make emacs enter matlab-shell mode automatically > when type some command in the terminal? M-x customize-variable RET major-mode RET Then put in your favorite major-mode (mine is org-mode) and save the setting. You can accomplish the same with (setq-default major-mode 'my-favorite-major-mode)[1] Joel Footnotes: [1] Evaluate this: (info "(emacs) Choosing Modes") -- Joel J. Adamson Servedio Lab University of North Carolina at Chapel Hill FSF Member #8164 http://www.unc.edu/~adamsonj