Mercurial > emacs
comparison lisp/browse-url.el @ 17802:77d8356a7eed
(browse-url-event-buffer):
Function renamed from event-buffer. Callers changed.
(browse-url-event-point): Likewise.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 14 May 1997 19:47:48 +0000 |
parents | b386f1a9ed75 |
children | 906dcb974266 |
comparison
equal
deleted
inserted
replaced
17801:49d32f8e9f71 | 17802:77d8356a7eed |
---|---|
533 (interactive) | 533 (interactive) |
534 (funcall browse-url-browser-function (browse-url-url-at-point))) | 534 (funcall browse-url-browser-function (browse-url-url-at-point))) |
535 | 535 |
536 ;; Define these if not already defined (XEmacs compatibility) | 536 ;; Define these if not already defined (XEmacs compatibility) |
537 | 537 |
538 (eval-and-compile | 538 (defun browse-url-event-buffer (event) |
539 (or (fboundp 'event-buffer) | 539 (window-buffer (posn-window (event-start event)))) |
540 (defun event-buffer (event) | 540 |
541 (window-buffer (posn-window (event-start event)))))) | 541 (defun browse-url-event-point (event) |
542 | 542 (posn-point (event-start event))) |
543 (eval-and-compile | |
544 (or (fboundp 'event-point) | |
545 (defun event-point (event) | |
546 (posn-point (event-start event))))) | |
547 | 543 |
548 ;;;###autoload | 544 ;;;###autoload |
549 (defun browse-url-at-mouse (event) | 545 (defun browse-url-at-mouse (event) |
550 "Ask a WWW browser to load a URL clicked with the mouse. | 546 "Ask a WWW browser to load a URL clicked with the mouse. |
551 The URL is the one around or before the position of the mouse click | 547 The URL is the one around or before the position of the mouse click |
552 but point is not changed. Doesn't let you edit the URL like | 548 but point is not changed. Doesn't let you edit the URL like |
553 browse-url. Variable `browse-url-browser-function' says which browser | 549 browse-url. Variable `browse-url-browser-function' says which browser |
554 to use." | 550 to use." |
555 (interactive "e") | 551 (interactive "e") |
556 (save-excursion | 552 (save-excursion |
557 (set-buffer (event-buffer event)) | 553 (set-buffer (browse-url-event-buffer event)) |
558 (goto-char (event-point event)) | 554 (goto-char (browse-url-event-point event)) |
559 (let ((url (browse-url-url-at-point))) | 555 (let ((url (browse-url-url-at-point))) |
560 (if (string-equal url "") | 556 (if (string-equal url "") |
561 (error "No URL found")) | 557 (error "No URL found")) |
562 (funcall browse-url-browser-function url)))) | 558 (funcall browse-url-browser-function url)))) |
563 | 559 |