;;; User data
-(defvar erc-server-current-nick nil
+(defvar-local erc-server-current-nick nil
"Nickname on the current server.
Use `erc-current-nick' to access this.")
-(make-variable-buffer-local 'erc-server-current-nick)
;;; Server attributes
-(defvar erc-server-process nil
+(defvar-local erc-server-process nil
"The process object of the corresponding server connection.")
-(make-variable-buffer-local 'erc-server-process)
-(defvar erc-session-server nil
+(defvar-local erc-session-server nil
"The server name used to connect to for this session.")
-(make-variable-buffer-local 'erc-session-server)
-(defvar erc-session-connector nil
+(defvar-local erc-session-connector nil
"The function used to connect to this session (nil for the default).")
-(make-variable-buffer-local 'erc-session-connector)
-(defvar erc-session-port nil
+(defvar-local erc-session-port nil
"The port used to connect to.")
-(make-variable-buffer-local 'erc-session-port)
-(defvar erc-server-announced-name nil
+(defvar-local erc-server-announced-name nil
"The name the server announced to use.")
-(make-variable-buffer-local 'erc-server-announced-name)
-(defvar erc-server-version nil
+(defvar-local erc-server-version nil
"The name and version of the server's ircd.")
-(make-variable-buffer-local 'erc-server-version)
-(defvar erc-server-parameters nil
+(defvar-local erc-server-parameters nil
"Alist listing the supported server parameters.
This is only set if the server sends 005 messages saying what is
SILENCE=10 - supports the SILENCE command, maximum allowed number of entries
TOPICLEN=160 - maximum allowed topic length
WALLCHOPS - supports sending messages to all operators in a channel")
-(make-variable-buffer-local 'erc-server-parameters)
;;; Server and connection state
(defvar erc-server-ping-timer-alist nil
"Mapping of server buffers to their specific ping timer.")
-(defvar erc-server-connected nil
+(defvar-local erc-server-connected nil
"Non-nil if the current buffer has been used by ERC to establish
an IRC connection.
If you wish to determine whether an IRC connection is currently
active, use the `erc-server-process-alive' function instead.")
-(make-variable-buffer-local 'erc-server-connected)
-(defvar erc-server-reconnect-count 0
+(defvar-local erc-server-reconnect-count 0
"Number of times we have failed to reconnect to the current server.")
-(make-variable-buffer-local 'erc-server-reconnect-count)
-(defvar erc-server-quitting nil
+(defvar-local erc-server-quitting nil
"Non-nil if the user requests a quit.")
-(make-variable-buffer-local 'erc-server-quitting)
-(defvar erc-server-reconnecting nil
+(defvar-local erc-server-reconnecting nil
"Non-nil if the user requests an explicit reconnect, and the
current IRC process is still alive.")
-(make-variable-buffer-local 'erc-server-reconnecting)
-(defvar erc-server-timed-out nil
+(defvar-local erc-server-timed-out nil
"Non-nil if the IRC server failed to respond to a ping.")
-(make-variable-buffer-local 'erc-server-timed-out)
-(defvar erc-server-banned nil
+(defvar-local erc-server-banned nil
"Non-nil if the user is denied access because of a server ban.")
-(make-variable-buffer-local 'erc-server-banned)
-(defvar erc-server-error-occurred nil
+(defvar-local erc-server-error-occurred nil
"Non-nil if the user triggers some server error.")
-(make-variable-buffer-local 'erc-server-error-occurred)
-(defvar erc-server-lines-sent nil
+(defvar-local erc-server-lines-sent nil
"Line counter.")
-(make-variable-buffer-local 'erc-server-lines-sent)
-(defvar erc-server-last-peers '(nil . nil)
+(defvar-local erc-server-last-peers '(nil . nil)
"Last peers used, both sender and receiver.
Those are used for /MSG destination shortcuts.")
-(make-variable-buffer-local 'erc-server-last-peers)
-(defvar erc-server-last-sent-time nil
+(defvar-local erc-server-last-sent-time nil
"Time the message was sent.
This is useful for flood protection.")
-(make-variable-buffer-local 'erc-server-last-sent-time)
-(defvar erc-server-last-ping-time nil
+(defvar-local erc-server-last-ping-time nil
"Time the last ping was sent.
This is useful for flood protection.")
-(make-variable-buffer-local 'erc-server-last-ping-time)
-(defvar erc-server-last-received-time nil
+(defvar-local erc-server-last-received-time nil
"Time the last message was received from the server.
This is useful for detecting hung connections.")
-(make-variable-buffer-local 'erc-server-last-received-time)
-(defvar erc-server-lag nil
+(defvar-local erc-server-lag nil
"Calculated server lag time in seconds.
This variable is only set in a server buffer.")
-(make-variable-buffer-local 'erc-server-lag)
-(defvar erc-server-filter-data nil
+(defvar-local erc-server-filter-data nil
"The data that arrived from the server
but has not been processed yet.")
-(make-variable-buffer-local 'erc-server-filter-data)
-(defvar erc-server-duplicates (make-hash-table :test 'equal)
+(defvar-local erc-server-duplicates (make-hash-table :test 'equal)
"Internal variable used to track duplicate messages.")
-(make-variable-buffer-local 'erc-server-duplicates)
;; From Circe
-(defvar erc-server-processing-p nil
+(defvar-local erc-server-processing-p nil
"Non-nil when we're currently processing a message.
When ERC receives a private message, it sets up a new buffer for
quickly after each other, ispell is started for the first, but
might take long enough for the second message to be processed
first.")
-(make-variable-buffer-local 'erc-server-processing-p)
-(defvar erc-server-flood-last-message 0
+(defvar-local erc-server-flood-last-message 0
"When we sent the last message.
See `erc-server-flood-margin' for an explanation of the flood
protection algorithm.")
-(make-variable-buffer-local 'erc-server-flood-last-message)
-(defvar erc-server-flood-queue nil
+(defvar-local erc-server-flood-queue nil
"The queue of messages waiting to be sent to the server.
See `erc-server-flood-margin' for an explanation of the flood
protection algorithm.")
-(make-variable-buffer-local 'erc-server-flood-queue)
-(defvar erc-server-flood-timer nil
+(defvar-local erc-server-flood-timer nil
"The timer to resume sending.")
-(make-variable-buffer-local 'erc-server-flood-timer)
;;; IRC protocol and misc options
:type '(choice (const :tag "Disabled" nil)
(integer :tag "Seconds")))
-(defvar erc-server-ping-handler nil
+(defvar-local erc-server-ping-handler nil
"This variable holds the periodic ping timer.")
-(make-variable-buffer-local 'erc-server-ping-handler)
;;;; Helper functions
;;; Variables:
-(defvar erc-capab-identify-activated nil
+(defvar-local erc-capab-identify-activated nil
"CAPAB IDENTIFY-MSG has been activated.")
-(make-variable-buffer-local 'erc-capab-identify-activated)
-(defvar erc-capab-identify-sent nil
+(defvar-local erc-capab-identify-sent nil
"CAPAB IDENTIFY-MSG and IDENTIFY-CTCP messages have been sent.")
-(make-variable-buffer-local 'erc-capab-identify-sent)
;;; Functions:
nil '(notice error) 'active
'dcc-get-notfound ?n nick ?f filename))))
-(defvar erc-dcc-byte-count nil)
-(make-variable-buffer-local 'erc-dcc-byte-count)
+(defvar-local erc-dcc-byte-count nil)
(defun erc-dcc-do-LIST-command (proc)
"This is the handler for the /dcc list command.
'dcc-malformed ?n nick ?u login ?h host ?q query)))))
-(defvar erc-dcc-entry-data nil
+(defvar-local erc-dcc-entry-data nil
"Holds the `erc-dcc-list' entry for this DCC connection.")
-(make-variable-buffer-local 'erc-dcc-entry-data)
;;; SEND handling
:group 'erc-dcc
:type 'integer)
-(defvar erc-dcc-file-name nil)
-(make-variable-buffer-local 'erc-dcc-file-name)
+(defvar-local erc-dcc-file-name nil)
(defun erc-dcc-get-file (entry file parent-proc)
"Set up a transfer from the remote client to the local over a TCP connection.
"Alist of actions to take on NOTICEs from EZBounce.")
-(defvar erc-ezb-session-list '()
+(defvar-local erc-ezb-session-list '()
"List of detached EZBounce sessions.")
-(make-variable-buffer-local 'erc-ezb-session-list)
(defvar erc-ezb-inside-session-listing nil
"Indicate whether current notices are expected to be EZB session listings.")
:group 'erc-autojoin
:type 'boolean)
-(defvar erc--autojoin-timer nil)
-(make-variable-buffer-local 'erc--autojoin-timer)
+(defvar-local erc--autojoin-timer nil)
(defun erc-autojoin-channels-delayed (server nick buffer)
"Attempt to autojoin channels.
:group 'erc-hooks
:type 'hook)
-(defvar erc-netsplit-list nil
+(defvar-local erc-netsplit-list nil
"This is a list of the form
\((\"a.b.c.d e.f.g\" TIMESTAMP FIRST-JOIN \"nick1\" ... \"nickn\") ...)
where FIRST-JOIN is t or nil, depending on whether or not the first
join from that split has been detected or not.")
-(make-variable-buffer-local 'erc-netsplit-list)
(defun erc-netsplit-install-message-catalogs ()
(erc-define-catalog
(regexp)
(const :tag "Network has no common server ending" nil)))))
-(defvar erc-network nil
+(defvar-local erc-network nil
"The name of the network you are connected to (a symbol).")
-(make-variable-buffer-local 'erc-network)
;; Functions:
;;;; Internal variables
-(defvar erc-last-ison nil
+(defvar-local erc-last-ison nil
"Last ISON information received through `erc-notify-timer'.")
-(make-variable-buffer-local 'erc-last-ison)
-(defvar erc-last-ison-time 0
+(defvar-local erc-last-ison-time 0
"Last time ISON was sent to the server in `erc-notify-timer'.")
-(make-variable-buffer-local 'erc-last-ison-time)
;;;; Setup
(define-key erc-mode-map "\M-p" 'undefined)
(define-key erc-mode-map "\M-n" 'undefined)))
-(defvar erc-input-ring nil "Input ring for erc.")
-(make-variable-buffer-local 'erc-input-ring)
+(defvar-local erc-input-ring nil "Input ring for erc.")
-(defvar erc-input-ring-index nil
+(defvar-local erc-input-ring-index nil
"Position in the input ring for erc.
If nil, the input line is blank and the user is conceptually after
the most recently added item in the ring. If an integer, the input
line is non-blank and displays the item from the ring indexed by this
variable.")
-(make-variable-buffer-local 'erc-input-ring-index)
(defun erc-input-ring-setup ()
"Do the setup required so that we can use comint style input rings.
(list (lambda (_window _before dir)
(erc-echo-timestamp dir ct))))))))
-(defvar erc-timestamp-last-inserted nil
+(defvar-local erc-timestamp-last-inserted nil
"Last timestamp inserted into the buffer.")
-(make-variable-buffer-local 'erc-timestamp-last-inserted)
-(defvar erc-timestamp-last-inserted-left nil
+(defvar-local erc-timestamp-last-inserted-left nil
"Last timestamp inserted into the left side of the buffer.
This is used when `erc-insert-timestamp-function' is set to
`erc-timestamp-left-and-right'")
-(make-variable-buffer-local 'erc-timestamp-last-inserted-left)
-(defvar erc-timestamp-last-inserted-right nil
+(defvar-local erc-timestamp-last-inserted-right nil
"Last timestamp inserted into the right side of the buffer.
This is used when `erc-insert-timestamp-function' is set to
`erc-timestamp-left-and-right'")
-(make-variable-buffer-local 'erc-timestamp-last-inserted-right)
(defcustom erc-timestamp-only-if-changed-flag t
"Insert timestamp only if its value changed since last insertion.
:group 'erc-ignore
:type 'erc-message-type)
-(defvar erc-session-password nil
+(defvar-local erc-session-password nil
"The password used for the current session.")
-(make-variable-buffer-local 'erc-session-password)
(defcustom erc-disconnected-hook nil
"Run this hook with arguments (NICK IP REASON) when disconnected.
:type 'hook)
-(defvar erc-channel-users nil
+(defvar-local erc-channel-users nil
"A hash table of members in the current channel, which
associates nicknames with cons cells of the form:
\(USER . MEMBER-DATA) where USER is a pointer to an
erc-server-user struct, and MEMBER-DATA is a pointer to an
erc-channel-user struct.")
-(make-variable-buffer-local 'erc-channel-users)
-(defvar erc-server-users nil
+(defvar-local erc-server-users nil
"A hash table of users on the current server, which associates
nicknames with erc-server-user struct instances.")
-(make-variable-buffer-local 'erc-server-users)
(defun erc-downcase (string)
"Convert STRING to IRC standard conforming downcase."
(or (not nicky)
(string-lessp nickx nicky))))))))
-(defvar erc-channel-topic nil
+(defvar-local erc-channel-topic nil
"A topic string for the channel. Should only be used in channel-buffers.")
-(make-variable-buffer-local 'erc-channel-topic)
-(defvar erc-channel-modes nil
+(defvar-local erc-channel-modes nil
"List of strings representing channel modes.
E.g. (\"i\" \"m\" \"s\" \"b Quake!*@*\")
\(not sure the ban list will be here, but why not)")
-(make-variable-buffer-local 'erc-channel-modes)
-(defvar erc-insert-marker nil
+(defvar-local erc-insert-marker nil
"The place where insertion of new text in erc buffers should happen.")
-(make-variable-buffer-local 'erc-insert-marker)
-(defvar erc-input-marker nil
+(defvar-local erc-input-marker nil
"The marker where input should be inserted.")
-(make-variable-buffer-local 'erc-input-marker)
(defun erc-string-no-properties (string)
"Return a copy of STRING will all text-properties removed."
:group 'erc-scripts
:type 'boolean)
-(defvar erc-last-saved-position nil
+(defvar-local erc-last-saved-position nil
"A marker containing the position the current buffer was last saved at.")
-(make-variable-buffer-local 'erc-last-saved-position)
(defcustom erc-kill-buffer-on-part nil
"Kill the channel buffer on PART.
(defvar erc-debug-log-file (expand-file-name "ERC.debug")
"Debug log file name.")
-(defvar erc-dbuf nil)
-(make-variable-buffer-local 'erc-dbuf)
+(defvar-local erc-dbuf nil)
(defmacro define-erc-module (name alias doc enable-body disable-body
&optional local-p)
;; Last active buffer, to print server messages in the right place
-(defvar erc-active-buffer nil
+(defvar-local erc-active-buffer nil
"The current active buffer, the one where the user typed the last command.
Defaults to the server buffer, and should only be set in the
server buffer.")
-(make-variable-buffer-local 'erc-active-buffer)
(defun erc-active-buffer ()
"Return the value of `erc-active-buffer' for the current server.
;; Some local variables
-(defvar erc-default-recipients nil
+(defvar-local erc-default-recipients nil
"List of default recipients of the current buffer.")
-(make-variable-buffer-local 'erc-default-recipients)
-(defvar erc-session-user-full-name nil
+(defvar-local erc-session-user-full-name nil
"Full name of the user on the current server.")
-(make-variable-buffer-local 'erc-session-user-full-name)
-(defvar erc-channel-user-limit nil
+(defvar-local erc-channel-user-limit nil
"Limit of users per channel.")
-(make-variable-buffer-local 'erc-channel-user-limit)
-(defvar erc-channel-key nil
+(defvar-local erc-channel-key nil
"Key needed to join channel.")
-(make-variable-buffer-local 'erc-channel-key)
-(defvar erc-invitation nil
+(defvar-local erc-invitation nil
"Last invitation channel.")
-(make-variable-buffer-local 'erc-invitation)
-(defvar erc-away nil
+(defvar-local erc-away nil
"Non-nil indicates that we are away.
Use `erc-away-time' to access this if you might be in a channel
buffer rather than a server buffer.")
-(make-variable-buffer-local 'erc-away)
-(defvar erc-channel-list nil
+(defvar-local erc-channel-list nil
"Server channel list.")
-(make-variable-buffer-local 'erc-channel-list)
-(defvar erc-bad-nick nil
+(defvar-local erc-bad-nick nil
"Non-nil indicates that we got a `nick in use' error while connecting.")
-(make-variable-buffer-local 'erc-bad-nick)
-(defvar erc-logged-in nil
+(defvar-local erc-logged-in nil
"Non-nil indicates that we are logged in.")
-(make-variable-buffer-local 'erc-logged-in)
-(defvar erc-default-nicks nil
+(defvar-local erc-default-nicks nil
"The local copy of `erc-nick' - the list of nicks to choose from.")
-(make-variable-buffer-local 'erc-default-nicks)
-(defvar erc-nick-change-attempt-count 0
+(defvar-local erc-nick-change-attempt-count 0
"Used to keep track of how many times an attempt at changing nick is made.")
-(make-variable-buffer-local 'erc-nick-change-attempt-count)
(defun erc-migrate-modules (mods)
"Migrate old names of ERC modules to new ones."
(let ((prop-val (erc-get-parsed-vector position)))
(and prop-val (member (erc-response.command prop-val) list))))
-(defvar erc-send-input-line-function 'erc-send-input-line)
-(make-variable-buffer-local 'erc-send-input-line-function)
+(defvar-local erc-send-input-line-function 'erc-send-input-line)
(defun erc-send-input-line (target line &optional force)
"Send LINE to TARGET.
(defalias 'erc-cmd-CHANNEL 'erc-cmd-JOIN)
(defalias 'erc-cmd-J 'erc-cmd-JOIN)
-(defvar erc-channel-new-member-names nil
+(defvar-local erc-channel-new-member-names nil
"If non-nil, a names list is currently being received.
If non-nil, this variable is a hash-table that associates
received nicks with t.")
-(make-variable-buffer-local 'erc-channel-new-member-names)
(defun erc-cmd-NAMES (&optional channel)
"Display the users in CHANNEL.
;;; Banlists
-(defvar erc-channel-banlist nil
+(defvar-local erc-channel-banlist nil
"A list of bans seen for the current channel.
Each ban is an alist of the form:
The property `received-from-server' indicates whether
or not the ban list has been requested from the server.")
-(make-variable-buffer-local 'erc-channel-banlist)
(put 'erc-channel-banlist 'received-from-server nil)
(defun erc-cmd-BANLIST ()
"")))))
-(defvar erc-current-message-catalog 'english)
-(make-variable-buffer-local 'erc-current-message-catalog)
+(defvar-local erc-current-message-catalog 'english)
(defun erc-retrieve-catalog-entry (entry &optional catalog)
"Retrieve ENTRY from CATALOG.