aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/erc/erc-button.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/erc/erc-button.el')
-rw-r--r--lisp/erc/erc-button.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el
index 1fd224fb956..435c72bba23 100644
--- a/lisp/erc/erc-button.el
+++ b/lisp/erc/erc-button.el
@@ -56,10 +56,12 @@
56 "This mode buttonizes all messages according to `erc-button-alist'." 56 "This mode buttonizes all messages according to `erc-button-alist'."
57 ((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append) 57 ((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append)
58 (add-hook 'erc-send-modify-hook 'erc-button-add-buttons 'append) 58 (add-hook 'erc-send-modify-hook 'erc-button-add-buttons 'append)
59 (add-hook 'erc-complete-functions 'erc-button-next)) 59 (add-hook 'erc-complete-functions 'erc-button-next)
60 (add-hook 'erc-mode-hook 'erc-button-add-keys))
60 ((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons) 61 ((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons)
61 (remove-hook 'erc-send-modify-hook 'erc-button-add-buttons) 62 (remove-hook 'erc-send-modify-hook 'erc-button-add-buttons)
62 (remove-hook 'erc-complete-functions 'erc-button-next))) 63 (remove-hook 'erc-complete-functions 'erc-button-next)
64 (remove-hook 'erc-mode-hook 'erc-button-add-keys)))
63 65
64;; Make XEmacs use `erc-button-face'. 66;; Make XEmacs use `erc-button-face'.
65(when (featurep 'xemacs) 67(when (featurep 'xemacs)
@@ -241,6 +243,16 @@ PAR is a number of a regexp grouping whose text will be passed to
241This syntax table should make all the legal nick characters word 243This syntax table should make all the legal nick characters word
242constituents.") 244constituents.")
243 245
246(defvar erc-button-keys-added nil
247 "Internal variable used to keep track of whether we've added the
248global-level ERC button keys yet.")
249
250(defun erc-button-add-keys ()
251 "Add ERC mode-level button movement keys. This is only done once."
252 (unless erc-button-keys-added
253 (define-key erc-mode-map (kbd "<backtab>") 'erc-button-previous)
254 (setq erc-button-keys-added t)))
255
244(defun erc-button-add-buttons () 256(defun erc-button-add-buttons ()
245 "Find external references in the current buffer and make buttons of them. 257 "Find external references in the current buffer and make buttons of them.
246\"External references\" are things like URLs, as 258\"External references\" are things like URLs, as