September 13, 2008

Emacs w3m: Open pages in external browsers

September 13, 2008 - Categories: emacs, wickedcoolemacs

Sometimes w3m is not enough. To make it easier to open the current page in a browser such as Mozilla Firefox, add the following to your ~/.emacs:

(defun wicked/w3m-open-current-page-in-firefox ()
  "Open the current URL in Mozilla Firefox."
  (interactive)
  (browse-url-firefox w3m-current-url)) ;; (1)

(defun wicked/w3m-open-link-or-image-in-firefox ()
  "Open the current link or image in Firefox."
  (interactive)
  (browse-url-firefox (or (w3m-anchor) ;; (2)
                          (w3m-image)))) ;; (3)

This defines a function that uses the current URL being browsed(1) and another function that takes the URL of the link at point(2). If no link is found, it takes the URL of the image at point(3).

You can use other browse-url functions instead of browse-url-firefox. For example, replacing browse-url-firefox with browse-url-kde will open the page, link, or image in Konqueror, KDE’s web browser.

I like binding f to the function that opens the current URL in Mozilla Firefox and F to the function that opens the current link or image in Mozilla Firefox. To do the same, add the following to your ~/.emacs:

(eval-after-load 'w3m
  (progn 
    (define-key w3m-mode-map "f" 'wicked/w3m-open-current-page-in-firefox)
    (define-key w3m-mode-map "F" 'wicked/w3m-open-link-or-image-in-firefox)))


This is part of the book that I’m writing about Emacs, which will be published by No Starch Press if I manage to get it together in time.

First impressions in an e-mail world

September 13, 2008 - Categories: gen-y

I really wish I could’ve spent more time in Washington–not only to spend a month or two in the Smithsonian Museum, but also to run into people like Jeff Widman, who’s normally based in Seattle but who happened to be in Washington when I was there.

Jeff e-mailed me last Tuesday to introduce himself and see if we could get together and chat about Gen Y and social media. That in itself was cool (I love connecting with other Gen Yers working in this space), but you know what was even cooler? He attached a PDF to introduce himself. Digging around on his blog, I came across an online version of it:

Neat idea! I’m tempted to make one myself (or refine my self-introduction in verse), because people often wonder (a) what I do for a living, and (b) how on earth I managed to get an opportunity to do that. =)

Good idea. Go out and make your own. =)