Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute a command at Emacs startup (emacs.el)

Tags:

emacs

plugins

How to execute a command or a plugin at Emacs startup ?

I want to execute shell-toggle-cd (from http://user.it.uu.se/~mic/shell-toggle.el) at startup.

Thanks

like image 312
Unitech Avatar asked Feb 14 '11 16:02

Unitech


2 Answers

The syntax for calling the function is

(shell-toggle-cd)

You can put that in your .emacs so that it is executed at startup. Here I assume that you have loaded the shell-toggle.el from your load path in .emacs before that.

You can load the package by saving shell-toggle.el somewhere and adding this to your .emacs:

(add-to-list 'load-path "/path/to/somewhere")
(require 'shell-toggle)
like image 194
TigrisC Avatar answered Oct 04 '22 23:10

TigrisC


if you just want a shell to open at startup, you just have to add

(shell)

at the end of your .emacs. This should open a new shell buffer filling up the whole window (unless you have some other command asking to get half of the window somewhere else in the .emacs).

like image 23
Mortimer Avatar answered Oct 04 '22 21:10

Mortimer