browse-url-firefox #2

id:ha-tan:20050524の補足そのに。id:ha-tan:20050525の設定とマージしてみた。
これで、「http:ttp://example.com」みたいにttp:が重ならなくなる。

(setq thing-at-point-url-path-regexp
  "[^]\t\n \"'()<>[^`{}]*[^]\t\n \"'()<>[^`{}.,;]+")

(setq thing-at-point-url-regexp
  (concat
   "\\<\\(h?t?tps?://\\|ftp://\\|gopher://\\|"
   "telnet://\\|wais://\\|file:/\\|s?news:\\|mailto:\\)"
   thing-at-point-url-path-regexp))

(setq browse-url-browser-function '(("." . browse-url-firefox)))
(setq browse-url-firefox-program "firefox-linux")
(defun browse-url-firefox (url &optional new-window)
  (interactive (browse-url-interactive-arg "URL: "))
  (if (string-match "^t?tp://" url)
      (setq url (concat "http://" (substring url (match-end 0)))))
  (if (string-match "^t?tps://" url)
      (setq url (concat "https://" (substring url (match-end 0)))))
  (start-process (concat browse-url-firefox-program url) nil 
		 browse-url-firefox-program "-remote" 
		 (concat "openurl(" url ", new-tab)")))