all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to make emacs start in a given mode ?
@ 2010-06-09  0:48 hkm
  2010-06-09  7:18 ` Deniz Dogan
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: hkm @ 2010-06-09  0:48 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 301 bytes --]

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.
Is there a way to make emacs enter matlab-shell mode automatically when
type some command in the terminal?


Thank you.



Keming

[-- Attachment #2: Type: text/html, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to make emacs start in a given mode ?
       [not found] <mailman.2.1276061596.11236.help-gnu-emacs@gnu.org>
@ 2010-06-09  6:22 ` mandar.mitra
  0 siblings, 0 replies; 7+ messages in thread
From: mandar.mitra @ 2010-06-09  6:22 UTC (permalink / raw)
  To: help-gnu-emacs

On Jun 9, 5:48 am, hkm <hkms...@gmail.com> 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.
> Is there a way to make emacs enter matlab-shell mode automatically when
> type some command in the terminal?

I have this in my .emacs.el:

(setq default-major-mode 'text-mode)

because I like scratch / new buffers to be text mode by default
(rather than Fundamental). You could try something similar with matlab-
shell mode.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to make emacs start in a given mode ?
  2010-06-09  0:48 how to make emacs start in a given mode ? hkm
@ 2010-06-09  7:18 ` Deniz Dogan
       [not found]   ` <20100609072526.GA18088@hkm>
  2010-06-09  8:45 ` Bastien
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Deniz Dogan @ 2010-06-09  7:18 UTC (permalink / raw)
  To: hkm; +Cc: help-gnu-emacs

2010/6/9 hkm <hkmsama@gmail.com>:
> 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.
> Is there a way to make emacs enter matlab-shell mode automatically when
> type some command in the terminal?
>
> Thank you.
>
>
> Keming

Sure, just modify initial-major-mode, e.g.:

(setq initial-major-mode 'python-mode)

-- 
Deniz Dogan



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to make emacs start in a given mode ?
       [not found]   ` <20100609072526.GA18088@hkm>
@ 2010-06-09  7:31     ` Deniz Dogan
  0 siblings, 0 replies; 7+ messages in thread
From: Deniz Dogan @ 2010-06-09  7:31 UTC (permalink / raw)
  To: hkm, help-gnu-emacs

2010/6/9 hkm <hkmsama@gmail.com>:
>
> I know this, buf if I set inital mode, I can't choose mode by type command in terminal when I start emacs.For example, I can have many alias to make emacs start in c-mode, matlab-shell mode or other mode.
>

You could try:

emacs -f python-mode

-f takes the name of a function to call after starting emacs.

> On Wed, Jun 09, 2010 at 09:18:53AM +0200, Deniz Dogan wrote:
>> 2010/6/9 hkm <hkmsama@gmail.com>:
>> > 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.
>> > Is there a way to make emacs enter matlab-shell mode?automatically?when
>> > type some command in the terminal?
>> >
>> > Thank you.
>> >
>> >
>> > Keming
>>
>> Sure, just modify initial-major-mode, e.g.:
>>
>> (setq initial-major-mode 'python-mode)
>>
>> --
>> Deniz Dogan
>



-- 
Deniz Dogan



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to make emacs start in a given mode ?
  2010-06-09  0:48 how to make emacs start in a given mode ? hkm
  2010-06-09  7:18 ` Deniz Dogan
@ 2010-06-09  8:45 ` Bastien
  2010-06-09 12:07 ` Tim Landscheidt
  2010-06-09 13:39 ` Joel James Adamson
  3 siblings, 0 replies; 7+ messages in thread
From: Bastien @ 2010-06-09  8:45 UTC (permalink / raw)
  To: hkm; +Cc: help-gnu-emacs

hkm <hkmsama@gmail.com> writes:

> Does anyone know how to start emacs in a given mode? 

(setq initial-major-mode 'matlab-shell)

HTH,

-- 
 Bastien



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to make emacs start in a given mode ?
  2010-06-09  0:48 how to make emacs start in a given mode ? hkm
  2010-06-09  7:18 ` Deniz Dogan
  2010-06-09  8:45 ` Bastien
@ 2010-06-09 12:07 ` Tim Landscheidt
  2010-06-09 13:39 ` Joel James Adamson
  3 siblings, 0 replies; 7+ messages in thread
From: Tim Landscheidt @ 2010-06-09 12:07 UTC (permalink / raw)
  To: help-gnu-emacs

(anonymous) 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.
> Is there a way to make emacs enter matlab-shell mode automatically when
> type some command in the terminal?

You could try "emacs -f matlab-shell".

Tim




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: how to make emacs start in a given mode ?
  2010-06-09  0:48 how to make emacs start in a given mode ? hkm
                   ` (2 preceding siblings ...)
  2010-06-09 12:07 ` Tim Landscheidt
@ 2010-06-09 13:39 ` Joel James Adamson
  3 siblings, 0 replies; 7+ messages in thread
From: Joel James Adamson @ 2010-06-09 13:39 UTC (permalink / raw)
  To: hkm; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 892 bytes --]

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

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-06-09 13:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-09  0:48 how to make emacs start in a given mode ? hkm
2010-06-09  7:18 ` Deniz Dogan
     [not found]   ` <20100609072526.GA18088@hkm>
2010-06-09  7:31     ` Deniz Dogan
2010-06-09  8:45 ` Bastien
2010-06-09 12:07 ` Tim Landscheidt
2010-06-09 13:39 ` Joel James Adamson
     [not found] <mailman.2.1276061596.11236.help-gnu-emacs@gnu.org>
2010-06-09  6:22 ` mandar.mitra

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.