0
|
1 ;;; w3-xemac.el,v --- XEmacs specific functions for emacs-w3
|
|
2 ;; Author: wmperry
|
|
3 ;; Created: 1996/05/29 18:21:00
|
|
4 ;; Version: 1.7
|
|
5 ;; Keywords: mouse, hypermedia
|
|
6
|
|
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
8 ;;; Copyright (c) 1996 by William M. Perry (wmperry@spry.com)
|
|
9 ;;;
|
|
10 ;;; This file is part of GNU Emacs.
|
|
11 ;;;
|
|
12 ;;; GNU Emacs is free software; you can redistribute it and/or modify
|
|
13 ;;; it under the terms of the GNU General Public License as published by
|
|
14 ;;; the Free Software Foundation; either version 2, or (at your option)
|
|
15 ;;; any later version.
|
|
16 ;;;
|
|
17 ;;; GNU Emacs is distributed in the hope that it will be useful,
|
|
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
20 ;;; GNU General Public License for more details.
|
|
21 ;;;
|
|
22 ;;; You should have received a copy of the GNU General Public License
|
|
23 ;;; along with GNU Emacs; see the file COPYING. If not, write to
|
|
24 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
26 (require 'w3-vars)
|
|
27
|
|
28 (defun w3-follow-mouse-other-frame (e)
|
|
29 "Function suitable to being bound to a mouse key. Follows the link under
|
|
30 the mouse click, opening it in another frame."
|
|
31 (interactive "e")
|
|
32 (mouse-set-point e)
|
|
33 (w3-follow-link-other-frame))
|
|
34
|
|
35 (defun w3-follow-inlined-image-mouse (e)
|
|
36 "Follow an inlined image from the mouse"
|
|
37 (interactive "e")
|
|
38 (mouse-set-point e)
|
|
39 (w3-follow-inlined-image))
|
|
40
|
|
41 (defun w3-follow-inlined-image ()
|
|
42 "Follow an inlined image, regardless of whether it is a hyperlink or not."
|
|
43 (interactive)
|
|
44 (let ((widget (widget-at (point))))
|
|
45 (and (not widget) (error "No inlined image at point."))
|
|
46 (setq widget (widget-get widget :parent))
|
|
47
|
|
48 (and (or (not widget)
|
|
49 (not (eq 'image (car widget))))
|
|
50 (error "No inlined image at point."))
|
|
51 (and (widget-get widget 'src)
|
|
52 (w3-fetch (widget-get widget 'src)))))
|
|
53
|
|
54 (defvar w3-mouse-button1 (cond
|
|
55 ((and w3-running-xemacs (featurep 'mouse)) 'button1)
|
|
56 (w3-running-xemacs 'return)
|
|
57 (t 'mouse-1)))
|
|
58 (defvar w3-mouse-button2 (cond
|
|
59 ((and w3-running-xemacs (featurep 'mouse)) 'button2)
|
|
60 (w3-running-xemacs 'return)
|
|
61 (t 'mouse-2)))
|
|
62 (defvar w3-mouse-button3 (cond
|
|
63 ((and w3-running-xemacs (featurep 'mouse)) 'button3)
|
|
64 (w3-running-xemacs (list 'meta ?`))
|
|
65 (t 'mouse-3)))
|
|
66
|
|
67 (define-key w3-mode-map (vector w3-mouse-button2) 'w3-widget-button-click)
|
|
68 (define-key w3-mode-map (vector w3-mouse-button3) 'w3-popup-menu)
|
|
69 (define-key w3-mode-map (vector (list 'shift w3-mouse-button2))
|
|
70 'w3-follow-mouse-other-frame)
|
|
71
|
|
72 (define-key w3-netscape-emulation-minor-mode-map (vector w3-mouse-button1)
|
|
73 'w3-widget-button-click)
|
|
74 (define-key w3-netscape-emulation-minor-mode-map (vector w3-mouse-button2)
|
|
75 'w3-follow-mouse-other-frame)
|
|
76
|
|
77 (if w3-running-FSF19
|
|
78 (progn
|
|
79 (define-key w3-mode-map [down-mouse-3] 'w3-popup-menu)
|
|
80 (define-key w3-mode-map [mouse-movement] 'w3-mouse-handler)))
|
|
81
|
|
82 (provide 'w3-mouse)
|