               (delete-region (point-min) (point))
               (normal-mode)
               (set-buffer-modified-p nil)
-              (switch-to-buffer pastie-buffer))
+              (switch-to-buffer *pastie-buffer*))
           (message "Error occured: %s" status)
-          (kill-buffer pastie-buffer))))))
+          (kill-buffer *pastie-buffer*))))))
 
+(defun pastie-browse ()
+  (interactive)
+  (browse-url *pastie-last-url*))
 
-(provide 'pastie)+(provide 'pastie)

;;;
;; pastie.el -- Emacs integration for pastie.caboo.se.
;; Copyright (C) 2006  Christian Neukirchen <purl.org/net/chneukirchen>
;; Licensed under the GPL.
;; 2007-12-27 Updated to work with more recent changes to the pastie API. (Rob Christie)
;; 2007-12-30 Added more major mode sniffs (Ryan McGeary)
;; 2007-12-31 Added some minor mode sniffs that are Rails specific. (Rob Christie)

(defun pastie-language ()
  "Sniffs for the language of the region that is being pasted"
  (or (when (boundp 'rails-view-minor-mode) (if rails-view-minor-mode "html_rails"))
      (when (boundp 'rails-minor-mode) (if rails-minor-mode "ruby_on_rails"))
      (cdr (assoc major-mode '((c-mode . "c++")
                               (c++-mode . "c++")

                               (diff-mode . "diff")
                               (html-mode . "html")
                               (java-mode . "java")
			       (python-mode . "python")
                               (javascript-mode . "javascript")
			       (js2-mode . "javascript")
                               (jde-mode . "java")
                               (php-mode . "php")
                               (ruby-mode . "ruby")
                               (text-mode . "plain_text")
                               (sql-mode . "sql")
                               (sh-mode . "shell-unix-generic"))))
      "plain_text"))

(defun pastie-url-format ()
  (if *pastie-restricted* "http://pastie.org/private/%s"
    "http://pastie.org/paste/%s"))

(defun pastie-region (begin end)
  "Post the current region as a new paste at pastie.org.
Copies the URL into the kill ring."
  (interactive "r")
  (let* ((body-raw (buffer-substring-no-properties begin end))
         (body (replace-regexp-in-string
                "[<>&]"
                (lambda (match)
