Tim Retout's www presence

Sat, 21 Mar 2009

Flymake and XML on Debian

Flymake is an emacs minor mode that runs a syntax check tool over source files as you write them, on the fly. Essentially it calls the compiler for the relevant language and then parses the warnings.

Because this is so obviously useful, I have it turned on by default in .emacs:

; Highlight syntax errors
(require 'flymake)
(add-hook 'find-file-hook 'flymake-find-file-hook)

Recall also that I use emacs to view page source in Epiphany. Unfortunately, this produced a nasty dialog box warning about not being able to find an 'xml' command.

The solution comes in two parts:

  • Install the 'xmlstarlet' package.
  • If you are using the emacs-snapshot package rather than emacs22, the fix to Bug #447378 is not yet applied. (I've mailed the maintainer.) Until then, it is simple to redefine flymake-xml-init in .emacs:
    ;;;; xml-specific init-cleanup routines
    (defun flymake-xml-init ()
      (list "xmlstarlet" (list "val" (flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace))))
    

I suppose both emacs packages should really Suggest xmlstarlet - I wonder how many other external programs might fall into that category.

Posted: 21 Mar 2009 00:00 | Tags: , , , | Comments (0)

Fri, 23 Jan 2009

Emacs and Epiphany

It turns out to be possible to persuade emacs and epiphany to play nicely together.

Opening URLs in Epiphany from Emacs

Sometimes Emacs presents you with clickable hyperlinks (in info documentation, perhaps).

To customize the browser in which these are opened, I am using the following in .emacs:

(setq browse-url-browser-function 'browse-url-generic
      browse-url-generic-program "gnome-open")

There are also specific epiphany-related functions, but I'm using the default gnome program for the moment. This can be configured via the default applications dialog.

Opening text files in Emacs from Epiphany

When you download a text file, or use 'View > Page Source' in the menus, epiphany uses the gnome desktop's handler for the 'text/plain' mime type.

The simplest way of configuring this is to run nautilus, right-click on a text file and choose 'Properties'. Then the 'Open With' tab lets you select an application. Emacs should already be listed, or you can add it if not.

Further ideas

Posted: 23 Jan 2009 00:00 | Tags: , , , , | Comments (0)

Sat, 17 May 2008

IDE

Who needs eclipse?

Emacs

Posted: 17 May 2008 00:00 | Tags: , , | Comments (0)

Fri, 07 Dec 2007

Emacs keybindings for GTK text fields

My attempt to learn to use emacs continues. Today's discovery: I can enable emacs-like keybindings in GTK text fields (well, Readline-like) - this includes form fields in Epiphany.

I have remapped C-w to backward-kill-word, to be more like Readline. I'm working up to writing some lisp to make common tasks easier... like writing blog entries, perhaps. I'll need to synchronize my .emacs files somehow... but I need to make more of an effort to use emacs over vim at work.

Posted: 07 Dec 2007 00:00 | Tags: , , , , | Comments (0)

Mon, 03 Dec 2007

I want to learn Emacs

Three weeks ago I swapped capslock and Ctrl on all my usual systems, much to the chagrin of Daniel when he foolishly tried to use my keyboard. I'm now quite happy with the positioning of Ctrl - it was surprisingly easy to get used to.

It is not a coincidence that this is Tip #1 on various lists of ways to use emacs more effectively. I find myself wanting to ditch vim… perhaps this is just asking for a holy war.

My reasons are quite vague at the moment, but have something to do with wanting consistency of user interfaces across editor, shell and, er, IRC client. One other thing I've noticed is that very few people seem to write many vim macros - I suspect that having lisp to work with will actually make this easier. Also, of course, it's a GNU project! As part of that, the licensing is vastly more sensible than vim's.

So, seeing as forcing myself to use the capslock key as ctrl seemed to work, I suppose I'd better force myself to use emacs regularly instead of vim, and see how it goes. This involves purging vim from machines where I can, and aliasing 'vim' to 'emacs' in places I can't. Perhaps this will scare more people away from borrowing my keyboard.

Posted: 03 Dec 2007 00:00 | Tags: , , , | Comments (1)

< March 2009 >
SuMoTuWeThFrSa
1 2 3 4 5 6 7
8 91011121314
15161718192021
22232425262728
293031    

Contact

Tim Retout tim@retout.co.uk
JabberID: tim@retout.co.uk

List of non-fail

Copyright © 2007, 2008, 2009 Tim Retout