?

Log in

No account? Create an account
Overloading the Machine -- Day [entries|friends|calendar]
johnsu01

[ website | wjsullivan.net ]
[ userinfo | livejournal userinfo ]
[ calendar | livejournal calendar ]

w3m and del.icio.us [10 Sep 2004|12:09am]

This is a modification of a function posted on the EmacsWiki to post a url in w3m to your del.icio.us page. The improvement is that you can execute this from a non-w3m buffer with point on a url.

I use it to post urls from mail messages (which I read in Gnus). The function first loads the url in order to get the title information for the page to use in its del.icio.us description, then loads the del.icio.us posting page with the appropriate information for the url already filled in.

Don't forget to replace 'johnsu01' with your name.

(defun /john-delicious-url ()
  "Post either the url under point or the url of the current w3m page to delicious."
  (interactive)
  (let ((w3m-async-exec nil))
    (if (thing-at-point-url-at-point)
        (unless (eq (current-buffer) (w3m-alive-p))
          (w3m-goto-url (thing-at-point-url-at-point))))
    (w3m-goto-url
     (concat "http://del.icio.us/johnsu01?"
             "url="    (w3m-url-encode-string w3m-current-url)
             "&title=" (w3m-url-encode-string w3m-current-title)))))
post comment

random-terminal-style.sh [10 Sep 2004|01:48am]

Here is a bash script I threw together to randomly select a set of options to pass to the terminal command. I started writing something that just randomly selected a background image from a directory, and that worked, but was pretty useless since the font color needs to be adjusted based on the background image.

#!/bin/bash

background_image_path="/home/johnsu01/images/random-backgrounds"
my_font="-sony-fixed-medium-*-*-*-*-*-*-*-*-*-*-*"
STYLES=8

terminal_style=\
("-fg #A9A9A9 +sb -pixmap $background_image_path/nebula.xpm -bgtype tile -fn $my_font"
"-fg #A9A9A9 +sb -pixmap $background_image_path/circuit.xpm -bgtype tile -fn $my_font"
"-fg cyan +sb -pixmap $background_image_path/circuit.xpm -bgtype tile -fn $my_font"
"-fg #A9A9A9 +sb -pixmap $background_image_path/nebula.xpm -bgtype tile -fn $my_font"
"-fg cyan +sb -pixmap $background_image_path/Pop-The-Clutch-1.xpm -bgtype tile -fn $my_font"
"-fg cyan +sb -pixmap $background_image_path/Livid-Pink-Warts-5.xpm -bgtype tile -fn $my_font" 
"-fg cyan +sb -sh 70 -pixmap $background_image_path/Island-of-Elba.xpm -bgtype tile -fn $my_font"
"-fg 'alice blue' +sb -pixmap $background_image_path/Wrestling-Dog-1.xpm -bgtype tile -fn $my_font")

choice=$RANDOM
let "choice %= $STYLES"

aterm ${terminal_style[choice]}
post comment

Tramp and file permissions [10 Sep 2004|01:50am]

I use Tramp from Emacs a lot both at home and at work. I use it to update this web site, for example. It's very handy for editing files on remote machines. You can edit files on many different machines from a single emacs session, which means you can always have the same .emacs environment, and you can use the emacs GUI to edit files on machines where you wouldn't normally have X or X forwarding access.

One problem I've run into, though, is that it mucks with file permissions. When I create a new file on the remote machine, everything is fine; the permissions are set according to the umask. However, when I edit a file that is already there, the permissions of the saved revision will be set such that no one can read, write or execute the file. I haven't figured out a complete solution to this yet, but here's a temporary workaround:

(setq backup-by-copying t)

That will make it so that the permissions on your revision will be correct. But, now the permissions on your backup will be all wrong. For now, I can live with that, since they are wrong in the sense that no one can read or write the file, which is probably actually ok when it comes to backup files.

post comment

navigation
[ viewing | September 10th, 2004 ]
[ go | previous day|next day ]