Emacs-magit 0.8.2 pushed to Fedora updates-testing

Posted by Tom Moertel Fri, 13 Aug 2010 04:38:00 GMT

For those of you who use Emacs, Git, and Fedora Linux, I have just pushed emacs-magit-0.8.2 to updates-testing. (This package brings the wonderful Magit mode for Emacs to Fedora). For now, you can install it with yum by enabling the updates-testing repo:

sudo yum install emacs-magit --enablerepo=updates-testing

Posted in
Tags , , ,
no comments
no trackbacks
Reddit Delicious

Quick tip: converting lines of text to paragraphs (and the reverse)

Posted by Tom Moertel Fri, 16 Jul 2010 14:56:00 GMT

Text documents come in two basic flavors: text editor and word processor. In the text-editor flavor, a document is represented by lines of text, each ending with a line break. Paragraphs are separated by two breaks. In the word-processor flavor, there are no line breaks, only paragraphs (because word processors will “wrap” lines of text as you edit them).

If you need to convert from text-editor flavor (lines) to word-processor flavor (paragraphs), here’s a handy Perl one-liner that will do it:

perl -lp00e's/\n/ /g' input.txt > output.txt

If you’re editing in Emacs, you can convert a selected region of text using the same one-liner via shell-command-on-region:

C-u M-| perl -lp00e's/\n/ /g' RET

To go the other way, from word-processor flavor to text-editor flavor, the Unix command-line tools fold(1) and fmt(1) do the job.

Tags , ,
3 comments
no trackbacks
Reddit Delicious

Magit is a handy Emacs mode for people who use Git

Posted by Tom Moertel Mon, 02 Feb 2009 17:22:00 GMT

Do you use Emacs? Do you use Git? If so, check out Magit, a delightful Emacs mode that provides a convenient interface to working with Git. Unlike many VCS modes, Magit is fully Git-centric: It understands the Git way of branching, staging, committing, history-rewriting, tagging, merging, pushing and pulling. It even knows about the reflog and has some git-svn support.

If you’re a Fedora user, just install the emacs-magit package. The package is currently in testing, so install it with the following command:

$ sudo yum --enablereo=updates-testing install emacs-magit

One more thing, Fedora users: please don’t forget to provide feedback on the package. It’s easy:

  1. Just visit the emacs-magit page in Bodhi
  2. Click on the package you installed (e.g., the Fedora 9 or 10 flavor)
  3. Add a comment, selecting “Works for me” or “Does not work” as appropriate

Hack on!

Posted in
Tags , , ,
1 comment
no trackbacks
Reddit Delicious

Emacs stuff I always seem to forget

Posted by Tom Moertel Wed, 07 Jan 2009 20:08:00 GMT

Here are three Emacs tips that I seem to have a hard time remembering. I’m posting them here to help them stick to my brain.

Align

Emacs has a number of powerful align commands, but most times the following incantation will suffice to magically align text into neat columns:

C-u M-x align

Repeat

I don’t know how I manage to forget this handy helper, but I do. The following will repeat the most-recently executed command:

C-x z

Continue hitting “z” to continue repeating.

Recursive edit

While you are in the middle of doing something in Emacs, such as a query-replace-regexp, you can put that something on hold, do some editing, and then return to what you were doing. This maneuver is accomplished with Recursive Editing. In short:

  • C-r (enter recursive edit)
  • C-M-c (exit recursive edit)
  • C-] (abort: exit all nested recursive-edit sessions)

Posted in
Tags
no comments
no trackbacks
Reddit Delicious