diff options
author | Gerd Moellmann <gerd@gnu.org> | 2001-04-23 10:16:54 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 2001-04-23 10:16:54 +0000 |
commit | 67ac0f7ae4a598b10507f8b25e03abe96962ea17 (patch) | |
tree | 130114ec5b84494a7a4e3509c6541c6079127994 /lisp/net/goto-addr.el | |
parent | c21b85086ad914628cdbbdb8c758765c2b80baeb (diff) | |
download | emacs-67ac0f7ae4a598b10507f8b25e03abe96962ea17.tar.gz |
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.
Diffstat (limited to 'lisp/net/goto-addr.el')
-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 @@ ;;; goto-addr.el --- click to browse URL or to send to e-mail address -;; Copyright (C) 1995, 2000 Free Software Foundation, Inc. +;; Copyright (C) 1995, 2000, 2001 Free Software Foundation, Inc. ;; Author: Eric Ding <ericding@alum.mit.edu> ;; Maintainer: FSF @@ -64,6 +64,16 @@ (require 'thingatpt) (autoload 'browse-url-url-at-point "browse-url") +;; XEmacs needs the following definitions. +(unless (fboundp 'overlays-in) + (require 'overlay)) +(unless (fboundp 'line-beginning-position) + (defalias 'line-beginning-position 'point-at-bol)) +(unless (fboundp 'line-end-position) + (defalias 'line-end-position 'point-at-eol)) +(unless (fboundp 'match-string-no-properties) + (defalias 'match-string-no-properties 'match-string)) + (defgroup goto-address nil "Click to browse URL or to send to e-mail address." :group 'mouse @@ -100,8 +110,10 @@ But only if `goto-address-highlight-p' is also non-nil." (defvar goto-address-highlight-keymap (let ((m (make-sparse-keymap))) - (define-key m [mouse-2] 'goto-address-at-mouse) - (define-key m "\C-c\r" 'goto-address-at-point) + (if (featurep 'xemacs) + (define-key m (kbd "<button2>") 'goto-address-at-mouse) + (define-key m (kbd "<mouse-2>") 'goto-address-at-mouse)) + (define-key m (kbd "C-c RET") 'goto-address-at-point) m) "keymap to hold goto-addr's mouse key defs under highlighted URLs.") |