Function: erc-cmd-LOAD

erc-cmd-LOAD is a byte-compiled function defined in erc.el.gz.

Signature

(erc-cmd-LOAD LINE)

Documentation

Load the script provided in the LINE.

If LINE continues beyond the file name, the rest of it is put in a (local) variable erc-script-args, which can be used in Emacs Lisp scripts.

The optional FORCE argument is ignored here - you can't force loading a script after exceeding the flood threshold.

Source Code

;; Defined in /usr/src/emacs/lisp/erc/erc.el.gz
(defun erc-cmd-LOAD (line)
  "Load the script provided in the LINE.
If LINE continues beyond the file name, the rest of
it is put in a (local) variable `erc-script-args',
which can be used in Emacs Lisp scripts.

The optional FORCE argument is ignored here - you can't force loading
a script after exceeding the flood threshold."
  (cond
   ((string-match "^\\s-*\\(\\S-+\\)\\(.*\\)$" line)
    (let* ((file-to-find (match-string 1 line))
           (erc-script-args (match-string 2 line))
           (file (erc-find-file file-to-find erc-script-path)))
      (erc-log (format "cmd: LOAD: %s" file-to-find))
      (cond
       ((not file)
        (erc-display-message nil 'error (current-buffer)
                             'cannot-find-file ?f file-to-find))
       ((not (file-readable-p file))
        (erc-display-message nil 'error (current-buffer)
                             'cannot-read-file ?f file))
       (t
        (message "Loading `%s'..." file)
        (erc-load-script file)
        (message "Loading `%s'...done" file))))
    t)
   (t nil)))