CSC161 2011S Imperative Problem Solving

Reading: Emacs

Reading: Wikipedia on Emacs, available at http://en.wikipedia.org/wiki/Emacs.

Please submit a question by 9pm on Monday, 31 January 2011.


Do you have to understand much/any Lisp to use Emacs?

You do not need to understand any Lisp to use Emacs. You don't even have to understand much to modify it. Lisp looks a lot like Scheme (with some differences in keywords), so you are likely to be able to figure it out if you have to.

The reading says that TECO is designed to read, edit, and write the entire file as a single buffer, which allows random access. What does buffer mean in this context? E's method of structuring the file for page-random access on disk sounds as if the data in a file was stored on the disk in a vector, or a form similar to a vector, so that its form was conducive to random access. Is that right? If so, how is the TECO method different from this approach?

Generally, files are stored more like lists: It's easy to iterate through the elements, but it's slow to jump to the middle. Buffers let you treat them more like mutable arrays: You can jump around quickly and you can access values in the middle.

What exactly are buffers and why would someone implement them while using emacs? Or does emacs create and manipulate them automatically?

In Emacs-speak, a buffer is simply an open file.

Uhh... great. How do I use it? Also, is the background implementation of a text editor really that important? (and I really hope the answer does not involve efficiency)

We'll go over how to use it in lab. I just thought you might like some historical and other background.

Is GNU/emacs considered to be superior to using modern vi variants such as vim or is this the subject of debate and personal preference?

Debate and personal preference.

What extensions come pre-loaded on the version of Emacs that we will be working with?

Most of the ones you'll need.

I can't believe there's a chance that the name of such a well known editor came from the original creator's dislike of a particular ice cream store. I can't say I like Emacs any better because of this.

At least from my reading of the article, Emack and Bolio's had nothing to do with the naming of Emacs.

There's seems to be a lot of forks and different diversions in the course of development of Emacs, which one are we using?

GNU Emacs.

This question is a bit off topic, but it is mentioned in the readin that Emacs may suffer some performance issues on a 32-bit machine, but not on a 64-bit machine. Why is that and what is the difference between 32 and 64-bit machines?

How much memory they can access.

Have you ever experienced Emacs Pinky?"

Not in recent memory. But then, I'm more of a vi user. (I'll tell you story of why sometime.)

Would a keyboard macro be like using <ctrl> + c to copy?

Yes.

Is Emacs the most widely used source code editor, or are any other programs used equally, or in preference?

Emacs is one of the most widely used source code editors. But a lot of programmers now do their code development in Integrated Development Environments (IDEs), sort of like MediaScheme on steriods. Eclipse is one of the most popular of those.

Also, does Emacs do the actual compiling of the code, and if not, then why is it necessary? Couldn't we just use a C interpreter to run our code directly?

You need to type your code in somewhere. Emacs is a good way to type in code.

There seem to be many variations on Emacs. Are the special functions to each one that make it useful for one situation or another? If so, why are these functions not added into Emacs? If not, what is the point of writing other editors?

Why have different versions of the same program? Well, in the early days, it's because Emacs was closely tied to the underlying hardware, so it needed to be rewritten for new hardware. These days, it's more because there are some different philosophies on certain design choices (or even ownership choices).

What are some examples of useful macros in Emacs?

Replace-string is a nice one.

Back in the day, Emacs ran very slowly. How did it end up being the premier editing program?

It's useful.

I am confused on how EMACS are actually worked on. Do we work on EMACS or is it something that is running when we are writing in C?

You will use Emacs to write your C programs.

For clarification, is Emacs a text-editor where the code for various operations can be written or modified (using the C language)?

Yes.

Does Emacs support multiple programming languages? Does it function as an ordinary word processing program like Microsoft Word or Open Office?

It supports multiple programming languages (more or less, any kind of plain text document that you want to create). It doesn't support fonts (at least not naturally), so it doesn't quite do word processing. Of course, I'll admit that I don't particularly like WYSIAYG word processors (nor do many computer geeks), so that's not a big problem.

What does it mean that Emacs has become one of the most ported non-trivial computer programs?

Programmers get used to using it. They then want it when they move to a new system.

What particular features in emacs makes it more useful to us for writing C than another text editor with similar functionality?

The functionality is what makes Emacs useful. Really experienced programmers like to be able to customize it. Novice programmers like some of the obvious features, like auto-indent and code coloring.

So if Emacs is essentially just a text editor, then what makes it special? I mean the customization options and I'm sure that they've developed a lot of options and what have you to make coding easier, but why is it so important?

You need some editor to write programs in MathLAN. Emacs is among the most successful of program editors.

I understand that EMACs was written in C, and I know that lisp is another programming language, but how does Mocklisp work?

Emacs also interprets Mocklisp code, typically to add features. So, you can add new features to Emacs with just a little bit of programming.

Reading the article, are we just suppose to know what emacs is?

Yes.

Aside from extensibility, is there a main reason Emacs is so prevalent (and why we use it)?

A good design, and early availability.

Hm... I think I might have confused the manual with something else. The Manual mentioned (GNU Emacs Manual) can be viewed by the built-in info browser. This type of manual... Is it like the "man" function we use? Or is it something entirely different?

It's like the man command, but it's called info instead.

How does CVS, Concurrent Version System, work as a program development process?

That's beyond the scope of what we're talking about.

In the article, it says that emacs is best as a text editor, and that instead of manipulating the typeface (the font) of the characters or printing documents, it concentrates on manipulating pices of text. Why would a compiler have the duty to manipulate font? Is this font what I think it to be, and if not, what is it?

One should avoid fonts in writing plain text files. The info is in the reading so that readers understand that Emacs is not really a Word Processor.

If Emacs uses Emacs Lisp, how can it also have extensions?

You write the extensions in Lisp.

What are macros in simplified words?

Shorthands for a set of instructions. Essentially, functions.

Disclaimer: I usually create these pages on the fly, which means that I rarely proofread them and they may contain bad grammar and incorrect details. It also means that I tend to update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This document was generated by Siteweaver on Fri Feb 25 19:30:10 2011.
The source to the document was last modified on Fri Feb 25 19:29:54 2011.
This document may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CSC161/2011S/Readings/emacs.html.

Samuel A. Rebelsky, rebelsky@grinnell.edu