Posts tagged ‘Add new tag’

Emacs buttons – an introduction for the somewhat impatient

Working out how to make buttons work in emacs took rather too much effort – I suspect I was just being slow. However, I thought I’d write a tiny how-to for anyone else who tries to do this:


Below is a prototypical emacs lisp function call to create a new button in your text between characters beg and end is:

(defun f (button)
    (call-interactively 'find-file))

(make-button beg end 'action 'f 'follow-link t)

Note the following:

  • The properties are defined via a variable number of arguments . It does does not take a list.
  • Removing the follow-link property would cause left mouse-clicks on the link to have no effects
  • f must take a single argument otherwise this will fail.

For more on emacs buttons see:

http://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Buttons

If you want to make your button more anonymous (so that changing the function value associated with f has no deleterious results) you can use the following

(make-button beg end 'action
    (lambda (button) (call-interactively 'find-file))
    'follow-link t)

May 14, 2008 at 7:08 pm 3 comments

Backing up one’s home directory with tar

This is something that should be fairly easy. However in practice there are some problems:

  1. Tar has a proliferation of options and can be an effort to use – at least if you are using it infrequently
  2. One’s home directory often contains large files (like perfectly legally downloaded music and videos), which you don’t really want to back up repeatedly.
  3. Some applications put rather large things in hidden directories under your home directory

There are various solutions:
(more…)

April 20, 2008 at 2:01 pm 3 comments


August 2017
M T W T F S S
« Nov    
 123456
78910111213
14151617181920
21222324252627
28293031