diff options
author | Katsumi Yamaoka <[email protected]> | 2010-09-01 04:22:17 +0000 |
---|---|---|
committer | Katsumi Yamaoka <[email protected]> | 2010-09-01 04:22:17 +0000 |
commit | a14b34178368bb33e425268fc8ddc105b9d52b0b (patch) | |
tree | 20ee74e9b11435f797a37515e3f76328311d85c2 | |
parent | 0a46a12f7a484e3fab96ea2f46fa738e90dabf1c (diff) |
Add compatibility functions gnus-process-get and gnus-process-put for Emacs 21 and XEmacs.
-rw-r--r-- | lisp/gnus/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/gnus/gnus-ems.el | 53 |
2 files changed, 38 insertions, 20 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index dd1b54f9a0..d7bc81bcac 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-09-01 Katsumi Yamaoka <[email protected]> + + * gnus-ems.el (gnus-process-get, gnus-process-put): New compatibility + functions. + 2010-08-31 Julien Danjou <[email protected]> (tiny change) * nnimap.el (nnimap-request-newgroups): Use nnimap-request-list-method diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el index 32b126a271..06b1803ef0 100644 --- a/lisp/gnus/gnus-ems.el +++ b/lisp/gnus/gnus-ems.el @@ -305,26 +305,39 @@ (setq start end end nil)))))) -(if (fboundp 'set-process-plist) - (progn - (defalias 'gnus-set-process-plist 'set-process-plist) - (defalias 'gnus-process-plist 'process-plist)) - (defun gnus-set-process-plist (process plist) - "Replace the plist of PROCESS with PLIST. Returns PLIST." - (put 'gnus-process-plist process plist)) - (defun gnus-process-plist (process) - "Return the plist of PROCESS." - ;; Remove those of dead processes from `gnus-process-plist' - ;; to prevent it from growing. - (let ((plist (symbol-plist 'gnus-process-plist)) - proc) - (while (setq proc (car plist)) - (if (and (processp proc) - (memq (process-status proc) '(open run))) - (setq plist (cddr plist)) - (setcar plist (caddr plist)) - (setcdr plist (or (cdddr plist) '(nil)))))) - (get 'gnus-process-plist process))) +(eval-and-compile + (if (fboundp 'set-process-plist) + (progn + (defalias 'gnus-set-process-plist 'set-process-plist) + (defalias 'gnus-process-plist 'process-plist) + (defalias 'gnus-process-get 'process-get) + (defalias 'gnus-process-put 'process-put)) + (defun gnus-set-process-plist (process plist) + "Replace the plist of PROCESS with PLIST. Returns PLIST." + (put 'gnus-process-plist process plist)) + (defun gnus-process-plist (process) + "Return the plist of PROCESS." + ;; Remove those of dead processes from `gnus-process-plist' + ;; to prevent it from growing. + (let ((plist (symbol-plist 'gnus-process-plist)) + proc) + (while (setq proc (car plist)) + (if (and (processp proc) + (memq (process-status proc) '(open run))) + (setq plist (cddr plist)) + (setcar plist (caddr plist)) + (setcdr plist (or (cdddr plist) '(nil)))))) + (get 'gnus-process-plist process)) + (defun gnus-process-get (process propname) + "Return the value of PROCESS' PROPNAME property. +This is the last value stored with `(gnus-process-put PROCESS PROPNAME VALUE)'." + (plist-get (gnus-process-plist process) propname)) + (defun gnus-process-put (process propname value) + "Change PROCESS' PROPNAME property to VALUE. +It can be retrieved with `(gnus-process-get PROCESS PROPNAME)'." + (gnus-set-process-plist process + (plist-put (process-plist process) + propname value))))) (provide 'gnus-ems) |