Convert consecutive FSF copyright years to ranges.
[bpt/emacs.git] / lisp / erc / erc-button.el
index 7e45c6c..0b11c3b 100644 (file)
@@ -1,7 +1,6 @@
 ;; erc-button.el --- A way of buttonizing certain things in ERC buffers
 
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1996-2004, 2006-2011 Free Software Foundation, Inc.
 
 ;; Author: Mario Lang <mlang@delysid.org>
 ;; Keywords: irc, button, url, regexp
@@ -9,10 +8,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,9 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -218,6 +215,7 @@ PAR is a number of a regexp grouping whose text will be passed to
       (define-key map (kbd "<mouse-2>") 'erc-button-click-button))
     (define-key map (kbd "TAB") 'erc-button-next)
     (define-key map (kbd "<backtab>") 'erc-button-previous)
+    (define-key map [follow-link] 'mouse-face)
     (set-keymap-parent map erc-mode-map)
     map)
   "Local keymap for ERC buttons.")
@@ -239,7 +237,7 @@ PAR is a number of a regexp grouping whose text will be passed to
     (modify-syntax-entry ?\\ "w" table)
     table)
   "Syntax table used when buttonizing messages.
-This syntax table should make all the legal nick characters word
+This syntax table should make all the valid nick characters word
 constituents.")
 
 (defvar erc-button-keys-added nil
@@ -369,16 +367,17 @@ REGEXP is the regular expression which matched for this button."
           (list 'keymap erc-button-keymap)
           (list 'rear-nonsticky t)
           (and data (list 'erc-data data))))
-  (widget-convert-button 'link from to :action 'erc-button-press-button
-                         :suppress-face t
-                         ;; Make XEmacs use our faces.
-                         :button-face (if nick-p
-                                          erc-button-nickname-face
-                                        erc-button-face)
-                         ;; Make XEmacs behave with mouse-clicks, for
-                         ;; some reason, widget stuff overrides the
-                         ;; 'keymap text-property.
-                         :mouse-down-action 'erc-button-click-button))
+  (when (featurep 'xemacs)
+    (widget-convert-button 'link from to :action 'erc-button-press-button
+                           :suppress-face t
+                           ;; Make XEmacs use our faces.
+                           :button-face (if nick-p
+                                            erc-button-nickname-face
+                                          erc-button-face)
+                           ;; Make XEmacs behave with mouse-clicks, for
+                           ;; some reason, widget stuff overrides the
+                           ;; 'keymap text-property.
+                           :mouse-down-action 'erc-button-click-button)))
 
 (defun erc-button-add-face (from to face)
   "Add FACE to the region between FROM and TO."
@@ -534,4 +533,3 @@ and `apropos' for other symbols."
 ;; indent-tabs-mode: nil
 ;; End:
 
-;; arch-tag: 7d23bed4-2f30-4273-a03f-d7a274c605c4