diff options
| author | Gerd Moellmann | 2001-04-23 10:16:54 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-04-23 10:16:54 +0000 |
| commit | 67ac0f7ae4a598b10507f8b25e03abe96962ea17 (patch) | |
| tree | 130114ec5b84494a7a4e3509c6541c6079127994 | |
| parent | c21b85086ad914628cdbbdb8c758765c2b80baeb (diff) | |
| download | emacs-67ac0f7ae4a598b10507f8b25e03abe96962ea17.tar.gz emacs-67ac0f7ae4a598b10507f8b25e03abe96962ea17.zip | |
Instead of defining line-beginning-position and
line-end-position a defalias is used for point-at-bol and
point-at-eol.
Added XEmacs compatibility code.
(goto-address-highlight-keymap): Made keybindings XEmacs
compatible.
| -rw-r--r-- | lisp/net/goto-addr.el | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 5ae645ccb46..986489bdd62 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; goto-addr.el --- click to browse URL or to send to e-mail address | 1 | ;;; goto-addr.el --- click to browse URL or to send to e-mail address |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1995, 2000 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eric Ding <ericding@alum.mit.edu> | 5 | ;; Author: Eric Ding <ericding@alum.mit.edu> |
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| @@ -64,6 +64,16 @@ | |||
| 64 | (require 'thingatpt) | 64 | (require 'thingatpt) |
| 65 | (autoload 'browse-url-url-at-point "browse-url") | 65 | (autoload 'browse-url-url-at-point "browse-url") |
| 66 | 66 | ||
| 67 | ;; XEmacs needs the following definitions. | ||
| 68 | (unless (fboundp 'overlays-in) | ||
| 69 | (require 'overlay)) | ||
| 70 | (unless (fboundp 'line-beginning-position) | ||
| 71 | (defalias 'line-beginning-position 'point-at-bol)) | ||
| 72 | (unless (fboundp 'line-end-position) | ||
| 73 | (defalias 'line-end-position 'point-at-eol)) | ||
| 74 | (unless (fboundp 'match-string-no-properties) | ||
| 75 | (defalias 'match-string-no-properties 'match-string)) | ||
| 76 | |||
| 67 | (defgroup goto-address nil | 77 | (defgroup goto-address nil |
| 68 | "Click to browse URL or to send to e-mail address." | 78 | "Click to browse URL or to send to e-mail address." |
| 69 | :group 'mouse | 79 | :group 'mouse |
| @@ -100,8 +110,10 @@ But only if `goto-address-highlight-p' is also non-nil." | |||
| 100 | 110 | ||
| 101 | (defvar goto-address-highlight-keymap | 111 | (defvar goto-address-highlight-keymap |
| 102 | (let ((m (make-sparse-keymap))) | 112 | (let ((m (make-sparse-keymap))) |
| 103 | (define-key m [mouse-2] 'goto-address-at-mouse) | 113 | (if (featurep 'xemacs) |
| 104 | (define-key m "\C-c\r" 'goto-address-at-point) | 114 | (define-key m (kbd "<button2>") 'goto-address-at-mouse) |
| 115 | (define-key m (kbd "<mouse-2>") 'goto-address-at-mouse)) | ||
| 116 | (define-key m (kbd "C-c RET") 'goto-address-at-point) | ||
| 105 | m) | 117 | m) |
| 106 | "keymap to hold goto-addr's mouse key defs under highlighted URLs.") | 118 | "keymap to hold goto-addr's mouse key defs under highlighted URLs.") |
| 107 | 119 | ||