diff options
Diffstat (limited to 'lisp/erc/erc-button.el')
-rw-r--r-- | lisp/erc/erc-button.el | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index 0a81da38974..8b13d1cf49c 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -52,14 +52,14 @@ ;;;###autoload(autoload 'erc-button-mode "erc-button" nil t) (define-erc-module button nil "This mode buttonizes all messages according to `erc-button-alist'." - ((add-hook 'erc-insert-modify-hook 'erc-button-add-buttons 'append) - (add-hook 'erc-send-modify-hook 'erc-button-add-buttons 'append) - (add-hook 'erc-complete-functions 'erc-button-next-function) - (add-hook 'erc-mode-hook 'erc-button-setup)) - ((remove-hook 'erc-insert-modify-hook 'erc-button-add-buttons) - (remove-hook 'erc-send-modify-hook 'erc-button-add-buttons) - (remove-hook 'erc-complete-functions 'erc-button-next-function) - (remove-hook 'erc-mode-hook 'erc-button-setup))) + ((add-hook 'erc-insert-modify-hook #'erc-button-add-buttons 'append) + (add-hook 'erc-send-modify-hook #'erc-button-add-buttons 'append) + (add-hook 'erc-complete-functions #'erc-button-next-function) + (add-hook 'erc-mode-hook #'erc-button-setup)) + ((remove-hook 'erc-insert-modify-hook #'erc-button-add-buttons) + (remove-hook 'erc-send-modify-hook #'erc-button-add-buttons) + (remove-hook 'erc-complete-functions #'erc-button-next-function) + (remove-hook 'erc-mode-hook #'erc-button-setup))) ;;; Variables @@ -91,7 +91,6 @@ above them." (defcustom erc-button-url-regexp browse-url-button-regexp "Regular expression that matches URLs." :version "27.1" - :group 'erc-button :type 'regexp) (defcustom erc-button-wrap-long-urls nil @@ -100,18 +99,15 @@ above them." If this variable is a number, consider URLs longer than its value to be \"long\". If t, URLs will be considered \"long\" if they are longer than `erc-fill-column'." - :group 'erc-button :type '(choice integer boolean)) (defcustom erc-button-buttonize-nicks t "Flag indicating whether nicks should be buttonized or not." - :group 'erc-button :type 'boolean) (defcustom erc-button-rfc-url "http://www.faqs.org/rfcs/rfc%s.html" "URL used to browse rfc references. %s is replaced by the number." - :group 'erc-button :type 'string) (define-obsolete-variable-alias 'erc-button-google-url @@ -121,7 +117,6 @@ longer than `erc-fill-column'." "URL used to search for a term. %s is replaced by the search string." :version "27.1" - :group 'erc-button :type 'string) (defcustom erc-button-alist @@ -179,7 +174,6 @@ PAR is a number of a regexp grouping whose text will be passed to CALLBACK. There can be several PAR arguments. If REGEXP is \\='nicknames, these are ignored, and CALLBACK will be called with the nickname matched as the argument." - :group 'erc-button :version "24.1" ; remove finger (bug#4443) :type '(repeat (list :tag "Button" @@ -200,20 +194,18 @@ PAR is a number of a regexp grouping whose text will be passed to (defcustom erc-emacswiki-url "https://www.emacswiki.org/cgi-bin/wiki.pl?" "URL of the EmacsWiki Homepage." - :group 'erc-button :type 'string) (defcustom erc-emacswiki-lisp-url "https://www.emacswiki.org/elisp/" "URL of the EmacsWiki ELisp area." - :group 'erc-button :type 'string) (defvar erc-button-keymap (let ((map (make-sparse-keymap))) - (define-key map (kbd "RET") 'erc-button-press-button) - (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 (kbd "RET") #'erc-button-press-button) + (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) @@ -244,7 +236,7 @@ global-level ERC button keys yet.") "Add ERC mode-level button movement keys. This is only done once." ;; Add keys. (unless erc-button-keys-added - (define-key erc-mode-map (kbd "<backtab>") 'erc-button-previous) + (define-key erc-mode-map (kbd "<backtab>") #'erc-button-previous) (setq erc-button-keys-added t))) (defun erc-button-add-buttons () @@ -287,7 +279,7 @@ specified by `erc-button-alist'." (fun (nth 3 entry)) bounds word) (when (or (eq t form) - (eval form)) + (eval form t)) (goto-char (point-min)) (while (erc-forward-word) (when (setq bounds (erc-bounds-of-word-at-point)) @@ -306,9 +298,9 @@ specified by `erc-button-alist'." (end (match-end (nth 1 entry))) (form (nth 2 entry)) (fun (nth 3 entry)) - (data (mapcar 'match-string (nthcdr 4 entry)))) + (data (mapcar #'match-string (nthcdr 4 entry)))) (when (or (eq t form) - (eval form)) + (eval form t)) (erc-button-add-button start end fun nil data regexp))))) (defun erc-button-remove-old-buttons () @@ -483,7 +475,6 @@ Examples: (format \"ldapsearch -x -P 2 -h db.debian.org -b dc=debian,dc=org ircnick=%s\" nick)))" - :group 'erc-button :type '(repeat (cons (string :tag "Op") sexp))) |