changeset 37423:3ab2c865a8e5

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.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 23 Apr 2001 10:16:54 +0000
parents 98ffe6c6b815
children d642d15dec6b
files lisp/net/goto-addr.el
diffstat 1 files changed, 15 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/net/goto-addr.el	Mon Apr 23 10:09:46 2001 +0000
+++ b/lisp/net/goto-addr.el	Mon Apr 23 10:16:54 2001 +0000
@@ -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 @@
 
 (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.")