aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorStefan Monnier2006-12-08 03:17:10 +0000
committerStefan Monnier2006-12-08 03:17:10 +0000
commitaddc252e942e740e4d7603949c7f5594f4d07e47 (patch)
treea78ddc301d75af300da7d37f48be777ae277c3f7 /lisp/net
parentc2c93894cadc28a139c96a869ecda0eb8f709a0d (diff)
downloademacs-addc252e942e740e4d7603949c7f5594f4d07e47.tar.gz
emacs-addc252e942e740e4d7603949c7f5594f4d07e47.zip
(browse-url): Set DISPLAY to the one of the
current frame, in case we're connected to several displays.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/browse-url.el28
1 files changed, 17 insertions, 11 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 3f514a2aaab..33006731622 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -760,17 +760,23 @@ Prompts for a URL, defaulting to the URL at or before point. Variable
760 (interactive (browse-url-interactive-arg "URL: ")) 760 (interactive (browse-url-interactive-arg "URL: "))
761 (unless (interactive-p) 761 (unless (interactive-p)
762 (setq args (or args (list browse-url-new-window-flag)))) 762 (setq args (or args (list browse-url-new-window-flag))))
763 (if (functionp browse-url-browser-function) 763 (let ((process-environment (copy-sequence process-environment)))
764 (apply browse-url-browser-function url args) 764 ;; When connected to various displays, be careful to use the display of
765 ;; The `function' can be an alist; look down it for first match 765 ;; the currently selected frame, rather than the original start display,
766 ;; and apply the function (which might be a lambda). 766 ;; which may not even exist any more.
767 (catch 'done 767 (if (stringp (frame-parameter (selected-frame) 'display))
768 (dolist (bf browse-url-browser-function) 768 (setenv "DISPLAY" (frame-parameter (selected-frame) 'display)))
769 (when (string-match (car bf) url) 769 (if (functionp browse-url-browser-function)
770 (apply (cdr bf) url args) 770 (apply browse-url-browser-function url args)
771 (throw 'done t))) 771 ;; The `function' can be an alist; look down it for first match
772 (error "No browse-url-browser-function matching URL %s" 772 ;; and apply the function (which might be a lambda).
773 url)))) 773 (catch 'done
774 (dolist (bf browse-url-browser-function)
775 (when (string-match (car bf) url)
776 (apply (cdr bf) url args)
777 (throw 'done t)))
778 (error "No browse-url-browser-function matching URL %s"
779 url)))))
774 780
775;;;###autoload 781;;;###autoload
776(defun browse-url-at-point (&optional arg) 782(defun browse-url-at-point (&optional arg)