computers/Unix/emacs


link

I have been annoyed that emacs21 on a fedora core 2 machine keeps asking me:

(This file) does not end in newline. Add one?

Of course I don't want to add one. If I wanted to add a new line I'd just hit Alt-Shift-. Enter like every sane person. Right? Shut up, emacs.

OK, simple enough. Just set require-final-newline to nil. Just put that setting into my .emacs file.

This didn't work: (setq require-final-newline nil)

This also didn't work: (setq-default require-final-newline nil)

Using emacs' own customization system, it still didn't work. I could set the variable in a session, but after quitting and starting again the setting didn't stick.

I started to worry. Then I tracked it down.

The non-nil setting comes from /usr/share/emacs/site-lisp/default.el. This apparently runs after your .emacs and, on FC2, sets require-final-newline to 'query. So to stop this atrocity, you have two options:

  • Become root, and edit /usr/share/emacs/site-lisp/default.el.
  • Avoid running this silly default.el file by putting into your .emacs:
    (setq inhibit-default-init t)

I chose the latter option. Perhaps this post will help future Google searchers do the right thing even faster.

link

The Remembrance Agent (Remem) is an Emacs plug-in that watches over your shoulder and suggests information relevant to what you're reading or writing. While search engines help with direct recall, Remem is a tool for associative memory. Suggested documents are displayed in a buffer at the bottom of your Emacs window, and are updated every few seconds based on the last hundred or so words surrounding the cursor. Documents are pulled from your own text documents, and Remem's internal indexer can parse email archives, HTML, LaTex and plain-text documents. It runs under most Unix systems (and maybe even properly souped-up Mac or Windows) and both Emacs and XEmacs.