What are the functions in elisp that do the below? change from to ----------- ---------------- ftp.debian.org ftp://debian.org www.debian.org http://www.debian.org
'browse-url-at-point' makes this happen, but the elisp code is too advanced for me to follow. I made up my own homemade function to do this, but I'd like to know if I can just send a string to an already existing elisp function that would do it for me. Here's my code: ;; variable url is already set, so it adds "http://" etc ;; as necessary (cond ((string-match "http://\\|https://\\|ftp://" url 0) url) ((string-match "ftp\\." url 0) (setq url (concat "ftp://"url)) ) (t(setq url (concat "http://" url)))) To make firefox open an url in a new tab I must send it the full url. Here is the whole function, which seems to work OK. (defun my-browser (url &optional new-window) "Open URL in a new tab in firefox. To use this, set browse-url-browser-function to my-browser" (interactive (browse-url-interactive-arg "URL: ")) (cond ((string-match "http://\\|https://\\|ftp://" url 0) url) ((string-match "ftp\\." url 0) (setq url (concat "ftp://"url)) ) (t(setq url (concat "http://" url)))) ;; ;; remainder adapted from Xning Lee code ;; see ;; http://lists.gnu.org/archive/html/info-gnus-english/2004-07/msg00193.html ;; (when (string-match ".*No running window found.*" (shell-command-to-string (concat "firefox -remote 'openurl(" url ",new-tab)'"))) (message "Starting Firefox...") (start-process (concat "firefox " url) nil "/bin/sh" "-c" (concat "firefox " url "|| true")) (message "Starting Firefox...done"))) ;; to make make my-browser default, add the below. (setq browse-url-browser-function 'my-browser) -- Hugh Lawson [EMAIL PROTECTED] _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs