comparison lisp/erc/erc-button.el @ 105209:53bc42d507c5

(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.
author Johan Bockgård <bojohan@gnu.org>
date Sat, 26 Sep 2009 14:16:33 +0000
parents a9dc0e7c3f2b
children f4bcd333d869
comparison
equal deleted inserted replaced
105208:bf36d53a4b8f 105209:53bc42d507c5
365 (list 'mouse-face erc-button-mouse-face)) 365 (list 'mouse-face erc-button-mouse-face))
366 (list 'erc-callback fun) 366 (list 'erc-callback fun)
367 (list 'keymap erc-button-keymap) 367 (list 'keymap erc-button-keymap)
368 (list 'rear-nonsticky t) 368 (list 'rear-nonsticky t)
369 (and data (list 'erc-data data)))) 369 (and data (list 'erc-data data))))
370 (widget-convert-button 'link from to :action 'erc-button-press-button 370 (when (featurep 'xemacs)
371 :suppress-face t 371 (widget-convert-button 'link from to :action 'erc-button-press-button
372 ;; Make XEmacs use our faces. 372 :suppress-face t
373 :button-face (if nick-p 373 ;; Make XEmacs use our faces.
374 erc-button-nickname-face 374 :button-face (if nick-p
375 erc-button-face) 375 erc-button-nickname-face
376 ;; Make XEmacs behave with mouse-clicks, for 376 erc-button-face)
377 ;; some reason, widget stuff overrides the 377 ;; Make XEmacs behave with mouse-clicks, for
378 ;; 'keymap text-property. 378 ;; some reason, widget stuff overrides the
379 :mouse-down-action 'erc-button-click-button)) 379 ;; 'keymap text-property.
380 :mouse-down-action 'erc-button-click-button)))
380 381
381 (defun erc-button-add-face (from to face) 382 (defun erc-button-add-face (from to face)
382 "Add FACE to the region between FROM and TO." 383 "Add FACE to the region between FROM and TO."
383 ;; If we just use `add-text-property', then this will overwrite any 384 ;; If we just use `add-text-property', then this will overwrite any
384 ;; face text property already used for the button. It will not be 385 ;; face text property already used for the button. It will not be