Archive | emacs

Word Search Function in Emacs

Dec 26th, 2006No Comments

Instead of a post about my Christmas (which was Merry, but the whole story isn’t done yet — more later!), I’m going to give you a handy Emacs function.

Before I started working here, I was told that people speak a different language, filled with terms that I wouldn’t understand. And they were right — just last week, I understood half of what someone was saying in a meeting and I figured that I have come a long way. On my first day, someone gave me a book filled with terms that I hear in such meetings. It’s been very handy — but it’s a book, not file. I asked for the raw text file and they emailed it to me. Now I can quickly search it.

But how can I search it more quickly? I could write a command-line script for it, but always have Emacs within reach — why not write an Emacs function? I’ve never quite did this before, but it turned out to be pretty easy:

 (defun mh-find-rrword(rrword )
(interactive "sRR Word to Find: ")
(find-file "h:/Plans/UpRailRoadTerms.muse")
(goto-line 1)
(re-search-forward
(concat "^" rrword ":"))
)
(global-set-key (kbd "C-c s") 'mh-find-rrword)  

Now when I want to find a term, I just do C-c s and it asks me for the word. Then it loads the file, goes to the top, and starts looking. Very nice!

Cool Emacs Trick

Nov 10th, 2006No Comments
  1. Open Emacs and hit f2 2.  Your window will be in two columns
  2. Type something in one column, and then switch to the other column and type.
  3. Hit f2 1.  See what happens. :)

How to keep notes the Emacs way

Nov 10th, 2006No Comments

Once upon a time, Matt told me about someone who had been keeping notes in Emacs for years, and now has his own personal wiki/knowledge base in Emacs. I was a Vim user then, but the idea interested me.

Fast-forward four or five years.  I’m now at a new job with lots of processes and things to remember, only those things aren’t written anywhere.  Or, if they are, they are spread out all over their Intranet and, in come cases, woefully out of date to how things are.  But I have Emacs — and EmacsMuse, which has a wiki-like markup, links to wiki-words, etc.  And it exports to HTML out of the box and to PDF if you have LaTeX installed.  I quickly started pasting all the emails people have sent me about procedures, methods, links, etc.  In just a few days, the number of documents I have is impressive.

In Praise of Emacs

Sep 28th, 2006No Comments

In what other editor or IDE do you have:

Neal Stephenson said it best:

In other words, the engineer-hours that, in the case of Microsoft Word, were devoted to features like mail merge, and the ability to embed feature-length motion pictures in corporate memoranda, were, in the case of emacs, focused with maniacal intensity on the deceptively simple-seeming problem of editing text. . . .Emacs outshines all other editing software in approximately the same way that the noonday sun does the stars. It is not just bigger and brighter; it simply makes everything else vanish.

To the Bid Snipers

Sep 25th, 2006No Comments

Dear eBay Snipers,

You tried, you really tried to snip all my bids away.  You frustrated me a lot — a lot — I never thought I would suceed.  I was down to less than a minute several times, but you guys and gals always stole it away.  Not matter how I priced it, you did it.

I thought that the sniping would be over towards the end of the week-long flood.  Alas, no.  The sniping continued.  Soon the flood would be over and I would be out of luck.  I relunctly raised my final price and, finally, I prevailed.

So, to you snipers, I say, “I spit in your general direction!”

Page 3 of 4«1234»