Function: nnoo-define-basics

nnoo-define-basics is a macro defined in nnoo.el.gz.

Signature

(nnoo-define-basics BACKEND)

Documentation

Define close-server, server-opened and status-message.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnoo.el.gz
(defmacro nnoo-define-basics (backend)
  "Define `close-server', `server-opened' and `status-message'."
  (let ((form
         ;; We wrap the definitions in `when t' here so that a subsequent
         ;; "real" definition of one those doesn't trigger a "defined multiple
         ;; times" warning.
         `(when t
            ,@(mapcar (lambda (fun)
                       `(deffoo ,(nnoo-symbol backend fun) (&optional server)
                          (,(nnoo-symbol 'nnoo fun) ',backend server)))
                     '(server-opened status-message))
	   (deffoo ,(nnoo-symbol backend 'close-server) (&optional server _defs)
             (,(nnoo-symbol 'nnoo 'close-server) ',backend server))
           (deffoo ,(nnoo-symbol backend 'open-server) (server &optional defs)
             (nnoo-change-server ',backend server defs)))))
    ;; Wrapping with `when' has the downside that the compiler now doesn't
    ;; "know" that these functions are defined, so to avoid "not known to be
    ;; defined" warnings we eagerly define them during the compilation.
    ;; This is fairly nasty since it will override previous "real" definitions
    ;; (e.g. when compiling this in an Emacs instance that's running Gnus), but
    ;; that's also what the previous code did, so it sucks but is not worse.
    (eval form t)
    form))