(erc-button-add-button): Only call `widget-convert-button' in XEmacs.
authorJohan Bockgård <bojohan@gnu.org>
Sat, 26 Sep 2009 14:16:33 +0000 (14:16 +0000)
committerJohan Bockgård <bojohan@gnu.org>
Sat, 26 Sep 2009 14:16:33 +0000 (14:16 +0000)
For Emacs (at least), it doesn't seem to have any purpose except
creating lots of overlays, slowing everything down.

lisp/erc/ChangeLog
lisp/erc/erc-button.el

index cf17080..c2e8391 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-26  Johan Bockgård  <bojohan@gnu.org>
+
+       * erc-button.el (erc-button-add-button): Only call
+       `widget-convert-button' in XEmacs. For Emacs (at least), it
+       doesn't seem to have any purpose except creating lots of overlays,
+       slowing everything down.
+
 2009-09-19  Glenn Morris  <rgm@gnu.org>
 
        * erc-lang.el (line): Define for compiler.
index f0fa72f..8eee1ce 100644 (file)
@@ -367,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."