Mercurial > emacs
comparison lisp/gnus/nnoo.el @ 82951:0fde48feb604
Import Gnus 5.10 from the v5_10 branch of the Gnus repository.
author | Andreas Schwab <schwab@suse.de> |
---|---|
date | Thu, 22 Jul 2004 16:45:51 +0000 |
parents | 695cf19ef79e |
children | 18a818a2ee7c cce1c0ee76ee |
comparison
equal
deleted
inserted
replaced
56503:8bbd2323fbf2 | 82951:0fde48feb604 |
---|---|
1 ;;; nnoo.el --- OO Gnus Backends | 1 ;;; nnoo.el --- OO Gnus Backends |
2 | 2 |
3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000 | 3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 |
4 ;; Free Software Foundation, Inc. | 4 ;; Free Software Foundation, Inc. |
5 | 5 |
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> | 6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
7 ;; Keywords: news | 7 ;; Keywords: news |
8 | 8 |
36 | 36 |
37 (defmacro defvoo (var init &optional doc &rest map) | 37 (defmacro defvoo (var init &optional doc &rest map) |
38 "The same as `defvar', only takes list of variables to MAP to." | 38 "The same as `defvar', only takes list of variables to MAP to." |
39 `(prog1 | 39 `(prog1 |
40 ,(if doc | 40 ,(if doc |
41 `(defvar ,var ,init ,doc) | 41 `(defvar ,var ,init ,(concat doc "\n\nThis is a Gnus server variable. See Info node `(gnus)Select Methods'.")) |
42 `(defvar ,var ,init)) | 42 `(defvar ,var ,init)) |
43 (nnoo-define ',var ',map))) | 43 (nnoo-define ',var ',map))) |
44 (put 'defvoo 'lisp-indent-function 2) | 44 (put 'defvoo 'lisp-indent-function 2) |
45 (put 'defvoo 'edebug-form-spec '(var init &optional doc &rest map)) | 45 (put 'defvoo 'edebug-form-spec '(var init &optional doc &rest map)) |
46 | 46 |
199 (setcar bstate server) | 199 (setcar bstate server) |
200 (unless (cdr (assoc server (cddr bstate))) | 200 (unless (cdr (assoc server (cddr bstate))) |
201 (while (setq def (pop defs)) | 201 (while (setq def (pop defs)) |
202 (unless (assq (car def) bvariables) | 202 (unless (assq (car def) bvariables) |
203 (nconc bvariables | 203 (nconc bvariables |
204 (list (cons (car def) (and (boundp (car def)) | 204 (list (cons (car def) (and (boundp (car def)) |
205 (symbol-value (car def))))))) | 205 (symbol-value (car def))))))) |
206 (if (equal server "*internal-non-initialized-backend*") | 206 (if (equal server "*internal-non-initialized-backend*") |
207 (set (car def) (symbol-value (cadr def))) | 207 (set (car def) (symbol-value (cadr def))) |
208 (set (car def) (cadr def))))) | 208 (set (car def) (cadr def))))) |
209 (while parents | 209 (while parents |
210 (nnoo-change-server | 210 (nnoo-change-server |
252 (when bstate | 252 (when bstate |
253 (setcar bstate nil) | 253 (setcar bstate nil) |
254 (setcdr bstate (delq defs (cdr bstate))) | 254 (setcdr bstate (delq defs (cdr bstate))) |
255 (pop defs) | 255 (pop defs) |
256 (while defs | 256 (while defs |
257 (set (car (pop defs)) nil))))) | 257 (set (car (pop defs)) nil))))) |
258 t) | 258 t) |
259 | 259 |
260 (defun nnoo-close (backend) | 260 (defun nnoo-close (backend) |
261 (setq nnoo-state-alist | 261 (setq nnoo-state-alist |
262 (delq (assq backend nnoo-state-alist) | 262 (delq (assq backend nnoo-state-alist) |
302 (when (not (fboundp (setq fun (nnoo-symbol backend function)))) | 302 (when (not (fboundp (setq fun (nnoo-symbol backend function)))) |
303 (eval `(deffoo ,fun | 303 (eval `(deffoo ,fun |
304 (&rest args) | 304 (&rest args) |
305 (nnheader-report ',backend ,(format "%s-%s not implemented" | 305 (nnheader-report ',backend ,(format "%s-%s not implemented" |
306 backend function)))))))) | 306 backend function)))))))) |
307 | |
308 (defun nnoo-set (server &rest args) | |
309 (let ((parents (nnoo-parents (car server))) | |
310 (nnoo-parent-backend (car server))) | |
311 (while parents | |
312 (nnoo-change-server (caar parents) | |
313 (cadr server) | |
314 (cdar parents)) | |
315 (pop parents))) | |
316 (nnoo-change-server (car server) | |
317 (cadr server) (cddr server)) | |
318 (while args | |
319 (set (pop args) (pop args)))) | |
320 | |
307 (provide 'nnoo) | 321 (provide 'nnoo) |
308 | 322 |
309 ;;; arch-tag: 0196b5ed-6f34-4778-a455-73a971f837e7 | 323 ;;; arch-tag: 0196b5ed-6f34-4778-a455-73a971f837e7 |
310 ;;; nnoo.el ends here | 324 ;;; nnoo.el ends here |