Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change emacs config in Lisp In A Box

I have been a programmer for a decade now, but I believe this is the first time I've ever asked a question on a forum. I just can't figure this out and can't find the answer already online.

I am trying to turn on CUA mode so that emacs is more bearable for a windows user (normal copy paste functions). I am running Windows 7 and installed emacs through the Lisp In A Box package. I understand that I need to add a line to my .emacs file or init.el file. I'm not sure which, but I can't find either in my Lip In A Box install directory. The emacs package install also did not come with any tutorials or help files, so its really hard to pick this up.

I am stuck, any help is greatly appreciated!

like image 697
davetcoleman Avatar asked Feb 15 '10 02:02

davetcoleman


People also ask

Where is Emacs config file?

Emacs can also look in an XDG-compatible location for init. el , the default is the directory ~/. config/emacs .

Is Emacs a LISP machine?

Emacs is a software "Lisp Machine" that provides a programmable text editor, email reader, text web browser, image viwer, calculator, shell, games, easter-eggs and more.

Where do I find Emacs D?

emacs. d/ is the location for additional per-user Emacs-specific files written in the Emacs Lisp programming language. Since it is located in the home directory (~/), it is unique for each user, just like the ~/. emacs init file.

What is Emacs Lisp used for?

Emacs Lisp is a dialect of the Lisp programming language used as a scripting language by Emacs (a text editor family most commonly associated with GNU Emacs and XEmacs). It is used for implementing most of the editing functionality built into Emacs, the remainder being written in C, as is the Lisp interpreter.

How do I configure Emacs?

The primary way to configure Emacs is to edit its configuration file which is written in a language called Emacs Lisp. This means that your Emacs configuration is actually code! Don't worry, I'll explain everything. Here are the places where you might find the main configuration file:

What is Lisp in Emacs?

Lisp is an integral part of Emacs, as it allows Emacs to have more power and functionality. Lisp provides an opportunity for users to customize Emacs and turn it into something that matches their interests and needs. Lisp is what makes Emacs truly powerful and unique compared to other text editors.

How do I start Emacs without an init file?

When you start Emacs, it loads the initialisation file, or init file in short. This file contains Lisp code that loads any additional packages and configures your Emacs system. You can run Emacs without an init file, but you will undoubtedly want to change the defaults. The first time you start Emacs, it will create the configuration folder.

How do I add Melpa to Emacs?

Lisp can be used to add support in Emacs for packages of different sources. Melpa is one of the sources from which users can install these extensions. To add Melpa to Emacs, add the following lines to the init file:


2 Answers

The .emacs can be found by looking at the answers to this similar question.

Regarding documentation and tutorials, it looks like the link you provided for "Lisp in a Box" says:

If you are new to Emacs, it is recommended that you read the Emacs Tutorial which you can access from with Emacs by going to the Help menu, or by typing Control-h, letting go, and hitting t. A more extensive manual is also available from the Help menu, or on the web at http://www.gnu.org/software/emacs/manual/.

Which makes it sound like the manual is there, and certainly the tutorial (I made bold the directions to get to the tutorial).

As far as other places to get information, there is a collection of screencasts on the wiki.

Your question doesn't specify whether or not you what to add to your .emacs to activate CUA mode. You can check out the CUA mode documentation on the wiki (which has links to the manual). The minimal installation is just adding this to your .emacs: (cua-mode t).

like image 74
Trey Jackson Avatar answered Nov 02 '22 18:11

Trey Jackson


For GNU/Emacs, you can choose to use any one of the following three file names as the start-up configuration file:

${HOME}/.emacs
${HOME}/.emacs.el
${HOME}/.emacs.d/init.el

It would probably be a good idea to decide on one of the three options and then stick to it - the first one seems to be the most widely used one. In any case, ${HOME} stands for your home directory -- which is likely to be different from the Lisp In A Box install directory!

Coming from a Unix tradition, Emacs understands ~ (tilde) as an abbreviation for your home directory, so you can visit the .emacs file by typing:

C-x C-f ~/.emacs [ENTER]

(Note that the capital C is Emacs standard notation for a combination of the CTRL key and a second key, i.e. here you press CTRL-x CTRL-f which stands for "find-file" and will then ask you for a file name in the bottom part of the Frame (aka mini-buffer).)

If these are your first customizations, you will just see an empty buffer. Enter

;; start CUA mode every time Emacs starts
(cua-mode t)

and save the buffer with C-x C-s.

Next time you start Emacs, CUA mode should be turned on automatically.

like image 38
Thomas Avatar answered Nov 02 '22 17:11

Thomas