[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.8 Emacs for Heathens

Believe it or not, but some people who use Gnus haven’t really used Emacs much before they embarked on their journey on the Gnus Love Boat. If you are one of those unfortunates whom “C-M-a”, “kill the region”, and “set gnus-flargblossen to an alist where the key is a regexp that is used for matching on the group name” are magical phrases with little or no meaning, then this appendix is for you. If you are already familiar with Emacs, just ignore this and go fondle your cat instead.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.8.1 Keystrokes

Yes, when you use Emacs, you are apt to use the control key, the shift key and the meta key a lot. This is very annoying to some people (notably vile users), and the rest of us just love the hell out of it. Just give up and submit. Emacs really does stand for “Escape-Meta-Alt-Control-Shift”, and not “Editing Macros”, as you may have heard from other disreputable sources (like the Emacs author).

The shift keys are normally located near your pinky fingers, and are normally used to get capital letters and stuff. You probably use it all the time. The control key is normally marked “CTRL” or something like that. The meta key is, funnily enough, never marked as such on any keyboard. The one I’m currently at has a key that’s marked “Alt”, which is the meta key on this keyboard. It’s usually located somewhere to the left hand side of the keyboard, usually on the bottom row.

Now, us Emacs people don’t say “press the meta-control-m key”, because that’s just too inconvenient. We say “press the C-M-m key”. M- is the prefix that means “meta” and “C-” is the prefix that means “control”. So “press C-k” means “press down the control key, and hold it down while you press k”. “Press C-M-k” means “press down and hold down the meta key and the control key and then press k”. Simple, ay?

This is somewhat complicated by the fact that not all keyboards have a meta key. In that case you can use the “escape” key. Then M-k means “press escape, release escape, press k”. That’s much more work than if you have a meta key, so if that’s the case, I respectfully suggest you get a real keyboard with a meta key. You can’t live without it.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.8.2 Emacs Lisp

Emacs is the King of Editors because it’s really a Lisp interpreter. Each and every key you tap runs some Emacs Lisp code snippet, and since Emacs Lisp is an interpreted language, that means that you can configure any key to run any arbitrary code. You just, like, do it.

Gnus is written in Emacs Lisp, and is run as a bunch of interpreted functions. (These are byte-compiled for speed, but it’s still interpreted.) If you decide that you don’t like the way Gnus does certain things, it’s trivial to have it do something a different way. (Well, at least if you know how to write Lisp code.) However, that’s beyond the scope of this manual, so we are simply going to talk about some common constructs that you normally use in your ‘~/.gnus.el’ file to customize Gnus. (You can also use the ‘~/.emacs’ file, but in order to set things of Gnus up, it is much better to use the ‘~/.gnus.el’ file, See section Startup Files.)

If you want to set the variable gnus-florgbnize to four (4), you write the following:

(setq gnus-florgbnize 4)

This function (really “special form”) setq is the one that can set a variable to some value. This is really all you need to know. Now you can go and fill your ‘~/.gnus.el’ file with lots of these to change how Gnus works.

If you have put that thing in your ‘~/.gnus.el’ file, it will be read and evaled (which is Lisp-ese for “run”) the next time you start Gnus. If you want to change the variable right away, simply say C-x C-e after the closing parenthesis. That will eval the previous “form”, which is a simple setq statement here.

Go ahead—just try it, if you’re located at your Emacs. After you C-x C-e, you will see ‘4’ appear in the echo area, which is the return value of the form you evaled.

Some pitfalls:

If the manual says “set gnus-read-active-file to some”, that means:

(setq gnus-read-active-file 'some)

On the other hand, if the manual says “set gnus-nntp-server-file to ‘/etc/nntpserver’”, that means:

(setq gnus-nntp-server-file "/etc/nntpserver")

So be careful not to mix up strings (the latter) with symbols (the former). The manual is unambiguous, but it can be confusing.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated on January 25, 2015 using texi2html 1.82.