emacs-snapshot-gtk emacsclient and using ediff for regions


If you’re using the emacs-snapshot-gtk package (I use the one from Alexandre’s repository) and you want to use emacsclient, make sure you use the version that it supplies at `/usr/bin/emacsclient.emacs-snapshot`. If you just run emacsclient, it might confusingly say “emacsclient: can’t stat /tmp/esrv1000-yourhost: Success”

Recently at work I’ve been using ediff to compare little pieces of output from one of our devices. Here’s how I go about it:

  1. Paste the first blob of text (“B1″) into a scratch buffer.
  2. Hit Enter a few times to separate the blobs. Paste the second blob (“B2″).
  3. Run (e.g. with M-x) ediff-regions-wordwise (or -linewise if you prefer)
  4. Tell ediff that Region A and Region B are in the same scratch buffer.
  5. Mark B1 as Region A and with `C-SPC` and `C-M-c`.
  6. Mark B2 as Region B in the same way.

If you find yourself in some distopian parallel universe where emacs doesn’t exist, you might be able to get away with the following shell one-liner. Your shell will need support command substitution with the `<(foo)` syntax, like bash and zsh do.

$ diff -u <(echo "asdf") <(echo "zxcv")

Multiline gets a little hairy…

% diff -u <(echo "one
cmdsubst> two
cmdsubst> three") <(echo "one
cmdsubst> honk
cmdsubst> three")
--- /proc/self/fd/11 2007-02-11 12:38:28.680341500 -0500
+++ /proc/self/fd/16 2007-02-11 12:38:28.680341500 -0500
@@ -1,3 +1,3 @@
one
-two
+honk

Write a Comment

Take a moment to comment and tell us what you think. Some basic HTML is allowed for formatting.

Reader Comments

Be the first to leave a comment!