MMCT TEAM
Server IP : 111.118.215.189  /  Your IP : 18.117.158.174
Web Server : Apache
System : Linux md-in-83.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : a1673wkz ( 2475)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/emacs/24.3/lisp/erc/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //usr/share/emacs/24.3/lisp/erc/erc-button.elc
;ELC
;;; Compiled by mockbuild@buildfarm06-new.corp.cloudlinux.com on Fri Oct 11 10:08:34 2024
;;; from file /builddir/build/BUILD/emacs-24.3/lisp/erc/erc-button.el
;;; in Emacs version 24.3.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\301%\210\311\312\306\313\314\315\316\317\310\305\320\321&\207" [require erc wid-edit erc-fill custom-declare-group erc-button nil "Define how text can be turned into clickable buttons." :group custom-declare-variable erc-button-mode "Non-nil if Erc-Button mode is enabled.\nSee the command `erc-button-mode' for a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `erc-button-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :type boolean] 12)
#@244 Toggle ERC button mode.
With a prefix argument ARG, enable button if ARG is positive,
and disable it otherwise.  If called from Lisp, enable the mode
if ARG is omitted or nil.
This mode buttonizes all messages according to `erc-button-alist'.
(defalias 'erc-button-mode #[(&optional arg) "\303 	\304=\203\n?\202\305	!\306V\211\203\307 \210\202!\310 \210\311\312\n\203+\313\202,\314\"\210\315\316!\203Q\317\302!\210\303 \203D\303 \232\203Q\320\321\n\203N\322\202O\323\"\210)\324 \210\n\207" [#1=#:last-message arg erc-button-mode current-message toggle prefix-numeric-value 0 erc-button-enable erc-button-disable run-hooks erc-button-mode-hook erc-button-mode-on-hook erc-button-mode-off-hook called-interactively-p any customize-mark-as-set message "Erc-Button mode %sabled" "en" "dis" force-mode-line-update] 4 (#$ . 1219) (list (or current-prefix-arg 'toggle))])
(byte-code "\301\302\303\304\300!\205\n\303\211%\207" [erc-button-mode-map add-minor-mode erc-button-mode nil boundp] 6)
#@25 Enable ERC button mode.
(defalias 'erc-button-enable #[nil "\301\302\303\"\210\304\305\306\307\310#\210\305\311\307\310#\210\305\312\313\"\210\305\314\315\"\207" [erc-button-mode add-to-list erc-modules button t add-hook erc-insert-modify-hook erc-button-add-buttons append erc-send-modify-hook erc-complete-functions erc-button-next-function erc-mode-hook erc-button-setup] 4 (#$ . 2230) nil])
#@26 Disable ERC button mode.
(defalias 'erc-button-disable #[nil "\302\303\"\304\305\306\307\"\210\305\310\307\"\210\305\311\312\"\210\305\313\314\"\210\304\207" [erc-modules erc-button-mode delq button nil remove-hook erc-insert-modify-hook erc-button-add-buttons erc-send-modify-hook erc-complete-functions erc-button-next-function erc-mode-hook erc-button-setup] 3 (#$ . 2632) nil])
(byte-code "\300\301\302\303#\210\300\304\302\303#\210\300\305\302\303#\210\306\307\310\311\312\313%\210\314\315\316\317\320\321\312\313&\210\314\322\323\324\320\321\312\313&\210\314\325\326\327\320\321\312\313&\210\314\330\331\332\312\307\320\333&\210\314\334\335\336\312\307\320\337&\210\314\340\341\342\312\307\320\343&\210\314\344\345\346\312\307\320\347&\210\314\350\351\352\312\307\320\347&\210\314\353\354\355\312\307\356\357\320\360&	\210\314\361\362\363\312\307\320\347&\210\314\364\365\366\312\307\320\347&\207" [put erc-button-mode definition-name button erc-button-enable erc-button-disable custom-declare-face erc-button ((t :weight bold)) "ERC button face." :group erc-faces custom-declare-variable erc-button-face 'erc-button "Face used for highlighting buttons in ERC buffers.\n\nA button is a piece of text that you can activate by pressing\n`RET' or `mouse-2' above it. See also `erc-button-keymap'." :type face erc-button-nickname-face 'erc-nick-default-face "Face used for ERC nickname buttons." erc-button-mouse-face 'highlight "Face used for mouse highlighting in ERC buffers.\n\nButtons will be displayed in this face when the mouse cursor is\nabove them." erc-button-url-regexp (concat "\\(www\\.\\|\\(s?https?\\|" "ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\)" "\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?" "[-a-zA-Z0-9_=!?#$@~`%&*+\\/:;.,()]+[-a-zA-Z0-9_=#$@~`%&*+\\/()]") "Regular expression that matches URLs." regexp erc-button-wrap-long-urls nil "If non-nil, \"long\" URLs matching `erc-button-url-regexp' will be wrapped.\n\nIf this variable is a number, consider URLs longer than its value to\nbe \"long\".  If t, URLs will be considered \"long\" if they are\nlonger than `erc-fill-column'." (choice integer boolean) erc-button-buttonize-nicks t "Flag indicating whether nicks should be buttonized or not." boolean erc-button-rfc-url "http://www.faqs.org/rfcs/rfc%s.html" "URL used to browse rfc references.\n%s is replaced by the number." string erc-button-google-url "http://www.google.com/search?q=%s" "URL used to browse Google search references.\n%s is replaced by the search string." erc-button-alist '(('nicknames 0 erc-button-buttonize-nicks erc-nick-popup 0) (erc-button-url-regexp 0 t browse-url 0) ("<URL: *\\([^<> ]+\\) *>" 0 t browse-url 1) ("[`]\\([a-zA-Z][-a-zA-Z_0-9]+\\)[']" 1 t erc-button-describe-symbol 1) ("\\bInfo:[\"]\\([^\"]+\\)[\"]" 0 t Info-goto-node 1) ("\\b\\(Ward\\|Wiki\\|WardsWiki\\|TheWiki\\):\\([A-Z][a-z]+\\([A-Z][a-z]+\\)+\\)" 0 t (lambda (page) (browse-url (concat "http://c2.com/cgi-bin/wiki?" page))) 2) ("EmacsWiki:\\([A-Z][a-z]+\\([A-Z][a-z]+\\)+\\)" 0 t erc-browse-emacswiki 1) ("Lisp:\\([a-zA-Z.+-]+\\)" 0 t erc-browse-emacswiki-lisp 1) ("\\bGoogle:\\([^ 	\n
\f]+\\)" 0 t (lambda (keywords) (browse-url (format erc-button-google-url keywords))) 1) ("\\brfc[#: ]?\\([0-9]+\\)" 0 t (lambda (num) (browse-url (format erc-button-rfc-url num))) 1) ("\\s-\\(@\\([0-9][0-9][0-9]\\)\\)" 1 t erc-button-beats-to-time 2)) "Alist of regexps matching buttons in ERC buffers.\nEach entry has the form (REGEXP BUTTON FORM CALLBACK PAR...), where\n\nREGEXP is the string matching text around the button or a symbol\n  indicating a variable holding that string, or a list of\n  strings, or an alist with the strings in the car.  Note that\n  entries in lists or alists are considered to be nicks or other\n  complete words.  Therefore they are enclosed in \\< and \\>\n  while searching.  REGEXP can also be the quoted symbol\n  'nicknames, which matches the nickname of any user on the\n  current server.\n\nBUTTON is the number of the regexp grouping actually matching the\n  button,  This is ignored if REGEXP is 'nicknames.\n\nFORM is a lisp expression which must eval to true for the button to\n  be added,\n\nCALLBACK is the function to call when the user push this button.\n  CALLBACK can also be a symbol.  Its variable value will be used\n  as the callback function.\n\nPAR is a number of a regexp grouping whose text will be passed to\n  CALLBACK.  There can be several PAR arguments.  If REGEXP is\n  'nicknames, these are ignored, and CALLBACK will be called with\n  the nickname matched as the argument." :version "24.3" (repeat (list :tag "Button" (choice :tag "Matches" regexp (variable :tag "Variable containing regexp") (const :tag "Nicknames" 'nicknames)) (integer :tag "Number of the regexp section that matches") (choice :tag "When to buttonize" (const :tag "Always" t) (sexp :tag "Only when this evaluates to non-nil")) (function :tag "Function to call when button is pressed") (repeat :tag "Sections of regexp to send to the function" :inline t (integer :tag "Regexp section number")))) erc-emacswiki-url "http://www.emacswiki.org/cgi-bin/wiki.pl?" "URL of the EmacsWiki Homepage." erc-emacswiki-lisp-url "http://www.emacswiki.org/elisp/" "URL of the EmacsWiki ELisp area."] 10)
#@31 Local keymap for ERC buttons.
(defvar erc-button-keymap (byte-code "\302 \303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\303\314\315#\210\316	\"\210)\207" [map erc-mode-map make-sparse-keymap define-key "
" erc-button-press-button [mouse-2] erc-button-click-button "	" erc-button-next [backtab] erc-button-previous [follow-link] mouse-face set-keymap-parent] 4) (#$ . 7894))
#@125 Syntax table used when buttonizing messages.
This syntax table should make all the valid nick characters word
constituents.
(defvar erc-button-syntax-table (byte-code "\301 \302\303\304#\210\302\305\304#\210\302\306\304#\210\302\307\304#\210\302\310\304#\210\302\311\304#\210\302\312\304#\210\302\313\304#\210\302\314\304#\210\302\315\304#\210\302\316\304#\210\302\317\304#\210\302\320\304#\210)\207" [table make-syntax-table modify-syntax-entry 40 "w" 41 91 93 123 125 96 39 94 45 95 124 92] 4) (#$ . 8305))
#@99 Internal variable used to keep track of whether we've added the
global-level ERC button keys yet.
(defvar erc-button-keys-added nil (#$ . 8835))
#@67 Add ERC mode-level button movement keys.  This is only done once.
(defalias 'erc-button-setup #[nil "?\205\302	\303\304#\210\305\211\207" [erc-button-keys-added erc-mode-map define-key [backtab] erc-button-previous t] 4 (#$ . 8986)])
#@154 Find external references in the current buffer and make buttons of them.
"External references" are things like URLs, as
specified by `erc-button-alist'.
(defalias 'erc-button-add-buttons #[nil "\212\306 p\307\216\310\n!\210\311\312\211\311\211\211\313 \210\311\211\205\342@\211@\314\232\203A\315!\210\202\330@;\203N@\206Z\316@!\205Z@J\211;\203i\317
\"\210\202\330
<\203\234
@;\203\234
\311\211\203\230@\317\320\321!\322Q\"\210A\211\204~*\202\330
<\203\330
@<\203\330
\211@@);\203\330
\311\211\203\327@\317\320\321@!\322Q\"\210A\211\204\274*A\211\204-\311.
\207" [#1=#:buffer #2=#:table erc-button-syntax-table erc-button-alist data regexp syntax-table ((byte-code "rq\210\302	!\210)\302\207" [#1# #2# set-syntax-table] 2)) set-syntax-table nil t erc-button-remove-old-buttons 'nicknames erc-button-add-nickname-buttons boundp erc-button-add-buttons-1 "\\<" regexp-quote "\\>" entry alist inhibit-field-text-motion inhibit-point-motion-hooks buffer-read-only --dolist-tail-- r x elem] 8 (#$ . 9231) nil])
#@59 Search through the buffer for nicknames, and add buttons.
(defalias 'erc-button-add-nickname-buttons #[(entry) "\3068\3078\310\211\211\311=\204\312\f!\205neb\210\313v\205n\314\301!\315\n@\nA\"\316 \203N	\317 \320!\205Jrq\210\321\322
!\")*\204`\203	\321\322
!\")\203\323\n@\nA\311	C%\210\202,\207" [entry word bounds fun form nick 2 3 nil t eval 1 bounds-of-thing-at-point buffer-substring-no-properties erc-server-buffer-p erc-server-buffer buffer-live-p gethash erc-downcase erc-button-add-button #1=#:buffer erc-server-users erc-channel-users] 7 (#$ . 10337)])
#@65 Search through the buffer for matches to ENTRY and add buttons.
(defalias 'erc-button-add-buttons-1 #[(regexp entry) "eb\210\306\307\310#\205@	A@\224	A@\225\311	8\312	8\313\314\315	\233\"\f\310=\2041\316\f!\203<\317
\307\n&\210-\202\207" [regexp entry data fun form end re-search-forward nil t 2 3 mapcar match-string 4 eval erc-button-add-button start] 8 (#$ . 10942)])
#@223 Remove all existing buttons.
This is called with narrowing in effect, just before the text is
buttonized again.  Removing a button means to remove all the properties
that `erc-button-add-button' adds, except for the face.
(defalias 'erc-button-remove-old-buttons #[nil "\300ed\301#\207" [remove-text-properties (erc-callback nil erc-data nil mouse-face nil keymap nil)] 4 (#$ . 11337)])
#@181 Create a button between FROM and TO with callback FUN and data DATA.
NICK-P specifies if this is a nickname button.
REGEXP is the regular expression which matched for this button.
(defalias 'erc-button-add-button #[(from to fun nick-p &optional data regexp) "\306	\203W\n\230\203W\f
Z	\247\203	\202GZ\211V\203W\307 \310c\210
b\210\307 \311c\210\312
!\fZV\203V\\b\210\313\261\210`\306\223\210\2028))\203l\203x\314
\f#\210\202x\203x\314
\f#\210\315
\f\205\204\316D\317D\244\320D\244\321\322D\244\205\233\323D\244#\210\306\207" [fill-column erc-button-wrap-long-urls regexp erc-button-url-regexp to from nil point-marker ">" "<URL: " copy-marker "\n" erc-button-add-face add-text-properties mouse-face erc-callback keymap rear-nonsticky t erc-data erc-fill-column erc-fill-prefix pos nick-p erc-button-nickname-face erc-button-face erc-button-mouse-face fun erc-button-keymap data] 6 (#$ . 11731)])
#@45 Add FACE to the region between FROM and TO.
(defalias 'erc-button-add-face #[(from to face) "\306\307\310\"!\311\310\312	$\312\f	W\205@
\203#
B\202%\313\f\310\n$\210\306\307\f\310\"!\311\f\310\312	$\202,\207" [from to new end pos old erc-list get-text-property face next-single-property-change nil put-text-property] 7 (#$ . 12692)])
#@33 Call `erc-button-press-button'.
(defalias 'erc-button-click-button #[(ignore event) "\212\301!\210\302 )\207" [event mouse-set-point erc-button-press-button] 2 (#$ . 13054) "P\ne"])
#@154 Check text at point for a callback function.
If the text at point has a `erc-callback' property,
call it with the value of the `erc-data' text property.
(defalias 'erc-button-press-button #[(&rest ignore) "\302`\303\"\302`\304\"\211\204\305\306!\210	\203&	9\203&\307	!\204&\310\311	\"\210\312	\"*\207" [data fun get-text-property erc-data erc-callback message "No button at point" fboundp error "Function %S is not bound" apply] 4 (#$ . 13244) nil])
#@112 Pseudo completion function that actually jumps to the next button.
For use on `completion-at-point-functions'.
(defalias 'erc-button-next-function #[nil "`\300 W\205\301\302\303\304`DC\305BBE\207" [erc-beg-of-input-line lambda nil let here ((while (and (get-text-property here 'erc-callback) (not (= here (point-max)))) (setq here (1+ here))) (while (and (not (get-text-property here 'erc-callback)) (not (= here (point-max)))) (setq here (1+ here))) (if (< here (point-max)) (goto-char here) (error "No next button")) t)] 5 (#$ . 13709)])
#@39 Go to the next button in this buffer.
(defalias 'erc-button-next #[nil "\301 \211\205	 )\207" [f erc-button-next-function] 2 (#$ . 14257) nil])
#@43 Go to the previous button in this buffer.
(defalias 'erc-button-previous #[nil "`\211\301 W\205@\302\303\"\203eU\204S\202	\302\303\"\204/eU\204/S\202eV\203;b\210\202?\304\305!\210\306)\207" [here erc-beg-of-input-line get-text-property erc-callback error "No previous button" t] 4 (#$ . 14410) nil])
#@36 Browse to thing in the emacs-wiki.
(defalias 'erc-browse-emacswiki #[(thing) "\302	P!\207" [erc-emacswiki-url thing browse-url] 3 (#$ . 14739)])
#@47 Browse to THING in the emacs-wiki elisp area.
(defalias 'erc-browse-emacswiki-lisp #[(thing) "\302	P!\207" [erc-emacswiki-lisp-url thing browse-url] 3 (#$ . 14891)])
#@310 An alist of possible actions to take on a nickname.
An entry looks like ("Action" . SEXP) where SEXP is evaluated with
the variable `nick' bound to the nick in question.

Examples:
 ("DebianDB" .
  (shell-command
   (format
    "ldapsearch -x -P 2 -h db.debian.org -b dc=debian,dc=org ircnick=%s"
    nick)))
(custom-declare-variable 'erc-nick-popup-alist ''(("DeOp" erc-cmd-DEOP nick) ("Kick" erc-cmd-KICK (concat nick " " (read-from-minibuffer (concat "Kick " nick ", reason: ")))) ("Msg" erc-cmd-MSG (concat nick " " (read-from-minibuffer (concat "Message to " nick ": ")))) ("Op" erc-cmd-OP nick) ("Query" erc-cmd-QUERY nick) ("Whois" erc-cmd-WHOIS nick) ("Lastlog" erc-cmd-LASTLOG nick)) '(#$ . 15065) :group 'erc-button :type '(repeat (cons (string :tag "Op") sexp)))
(defalias 'erc-nick-popup #[(nick) "\305\306\307	\310Q\n\"\311\n\"A\211\205\312p!\210\313\f!+\207" [completion-ignore-case nick erc-nick-popup-alist action code t completing-read "What action to take on '" "'? " assoc erc-set-active-buffer eval] 5])
#@130 Describe SYMBOL-NAME.
Use `describe-function' for functions, `describe-variable' for variables,
and `apropos' for other symbols.
(defalias 'erc-button-describe-symbol #[(symbol-name) "\302!\211\203\303	!\203\304	!\202'	\203$\305	!\203$\306	!\202'\307!)\207" [symbol-name symbol intern-soft fboundp describe-function boundp describe-variable apropos] 3 (#$ . 16102)])
#@42 Display BEATS in a readable time format.
(defalias 'erc-button-beats-to-time #[(beats) "\304\305!\306_\307\310 @[#\311\312	\307\"\313\"\311\314	\315\"\315\"\316\317\320\n$!+\207" [beats seconds hours minutes - string-to-number 86.4 3600 current-time-zone mod floor 24 round 60 message format "@%s is %d:%02d local time"] 6 (#$ . 16486)])
(provide 'erc-button)

MMCT - 2023