Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Are The Most Important Parts Of ELisp To Learn If You Want To Programme Emacs?

Tags:

emacs

elisp

I use Emacs everyday as it is the standard editor for Erlang.

I decided as my New Years Resolution to learn to programme eLisp. I decided that writing a book about eLisp was the best way to learn.

I have make pretty good progress: Learn eLisp For Emacs

The strategic structure of the book is

  • getting started/basics
  • more advanced eLisp
  • writing a minor mode
  • writing a major mode

I have got through the basics (ie the first of these 4 points), covering:

  • evaluating expressions
  • debugging
  • adding menu items/toolbars
  • loading your own emacs files
  • etc, etc

If you are writing a book about a programming language you usually start by knowing the language well - well I don't - so my major problem now is a completeness problem:

  • How do I know that I have covered all the features that an Emacs programmer should have mastered?
  • How do I ensure that there aren't gaps in the content?

So I thought I would address these by asking the community here. My question is What Is Missing From My Table Of Contents? (in particular what should the more advanced eLisp Section contain).

like image 233
Gordon Guthrie Avatar asked Feb 01 '11 22:02

Gordon Guthrie


People also ask

What does require do in Emacs?

require looks in the global variable features to see whether the desired feature has been provided already. If not, it loads the feature from the appropriate file. This file should call provide at the top level to add the feature to features ; if it fails to do so, require signals an error.

Should I learn Emacs Lisp?

Learning a little Emacs Lisp will help you use Emacs more effectively: You will better understand the documentation and online help for functions and variables. You will be able to consult the Lisp source code for a function or variable, in order to understand it still better.

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 start Lisp in Emacs?

In a fresh Emacs window, type ESC-x lisp-interaction-mode . That will turn your buffer into a LISP terminal; pressing Ctrl+j will feed the s-expression that your cursor (called "point" in Emacs manuals' jargon) stands right behind to LISP, and will print the result.


1 Answers

Now that's an interesting way to learn a language...

I think you've probably skipped a bunch of the fundamentals in the getting started/basics section. If you've not already read it, I recommend reading "An Introduction To Programming In Emacs Lisp" (at gnu.org), which covers what I'd expect to see in the "basics" portion. I won't bother cut/paste the table of contents.

As far as knowing when you've written a complete book... Well, once you've re-written the Emacs Lisp manual in "how to" form, you know you're done. Alternatively, if you've written a book that can be used to answer/interpret all of the elisp and emacs questions, then you've probably got decent coverage.

What advanced features could you write about? There's advice, process communication, non-ASCII text, syntax tables, abbrevs, text properties, byte compilation, display tables, images, and a bunch more in the manual.

Note: The proper capitalization of elisp is either all lowercase, or possibly an uppercase E. The GNU documentation doesn't use "elisp" very much at all (mostly as a directory name, all lowercase), it prefers "Emacs Lisp."

Note: In the current version of your book, you treat global variables negatively. It's probably worth reading the RMS paper to gain some insight into the design decisions made, specifically on global variables as well as dynamic binding (the latter which you've yet to cover, which is a key (basic) concept which you've already gotten wrong in your book).

like image 126
Trey Jackson Avatar answered Oct 21 '22 23:10

Trey Jackson