Mercurial > emacs
annotate lisp/gnus/gnus-move.el @ 87595:4c6c79916238
* configure.in: Remove references to unsupported systems.
* notes/copyright:
* MAINTAINERS: Remove references to files that have been removed.
* os.texi (System Environment): Remove references to OSes that are
not supported anymore.
* PROBLEMS:
* MACHINES: Remove references to systems not supported anymore.
* makefile.w32-in:
* Makefile.in: Remove references to Xenix.
* gnus.el (gnus-use-long-file-name): Remove reference to xenix.
* obsolete/x-apollo.el: Remove file for unsupported system.
* term/x-win.el (vendor-specific-keysyms): Remove reference to
Apollo.
* progmodes/gud.el (gud-dgux-p): Remove.
(dbx): Remove reference to dgux.
* progmodes/ps-mode.el (ps-mode-print-function):
* ps-print.el (ps-lp-system):
* paths.el (rmail-spool-directory):
* ls-lisp.el (ls-lisp-emulation):
* lpr.el (lpr-lp-system):
* dired.el (dired-chown-program): Remove references to dgux.
* m/7300.h:
* m/acorn.h:
* m/alliant-2800.h:
* m/alliant.h:
* m/alliant1.h:
* m/alliant4.h:
* m/altos.h:
* m/amdahl.h:
* m/apollo.h:
* m/att3b.h:
* m/aviion-intel.h:
* m/aviion.h:
* m/celerity.h:
* m/clipper.h:
* m/cnvrgnt.h:
* m/convex.h:
* m/cydra5.h:
* m/delta88k.h:
* m/dpx2.h:
* m/dual.h:
* m/elxsi.h:
* m/f301.h:
* m/gould-np1.h:
* m/gould.h:
* m/i860.h:
* m/ibmps2-aix.h:
* m/ibmrt-aix.h:
* m/ibmrt.h:
* m/irist.h:
* m/is386.h:
* m/isi-ov.h:
* m/mega68.h:
* m/mg1.h:
* m/news-r6.h:
* m/news-risc.h:
* m/news.h:
* m/nh3000.h:
* m/nh4000.h:
* m/ns16000.h:
* m/ns32000.h:
* m/nu.h:
* m/orion.h:
* m/orion105.h:
* m/paragon.h:
* m/pfa50.h:
* m/plexus.h:
* m/pyramid.h:
* m/pyrmips.h:
* m/sh3el.h:
* m/sps7.h:
* m/sr2k.h:
* m/stride.h:
* m/sun1.h:
* m/sun2.h:
* m/sun3-68881.h:
* m/sun3-fpa.h:
* m/sun3-soft.h:
* m/sun3.h:
* m/sun386.h:
* m/symmetry.h:
* m/tad68k.h:
* m/tahoe.h:
* m/targon31.h:
* m/tek4300.h:
* m/tekxd88.h:
* m/tower32.h:
* m/tower32v3.h:
* m/ustation.h:
* m/wicat.h:
* m/xps100.h:
* s/cxux.h:
* s/cxux7.h:
* s/dgux.h:
* s/dgux4.h:
* s/dgux5-4-3.h:
* s/dgux5-4r2.h:
* s/esix.h:
* s/esix5r4.h:
* s/hiuxmpp.h:
* s/hiuxwe2.h:
* s/iris3-5.h:
* s/iris3-6.h:
* s/isc2-2.h:
* s/isc3-0.h:
* s/isc4-0.h:
* s/isc4-1.h:
* s/newsos5.h:
* s/newsos6.h:
* s/osf1.h:
* s/osf5-0.h:
* s/riscix1-1.h:
* s/riscix12.h:
* s/sco4.h:
* s/sco5.h:
* s/sunos4-0.h:
* s/sunos4-1.h:
* s/sunos413.h:
* s/sunos4shr.h:
* s/umax.h:
* s/unipl5-2.h:
* s/xenix.h:
* cxux-crt0.s:
* unexapollo.c:
* unexconvex.c:
* unexenix.c:
* unexsni.c: Remove files for systems no longer supported.
* m/intel386.h: Remove references to unsupported systems.
* w32.c (get_emacs_configuration): Remove reference to i860.
* sysdep.c: Remove dead code.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Sun, 06 Jan 2008 00:56:56 +0000 |
parents | 781256628613 |
children | 107ccd98fa12 53108e6cea98 |
rev | line source |
---|---|
17493 | 1 ;;; gnus-move.el --- commands for moving Gnus from one server to another |
64754
fafd692d1e40
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64085
diff
changeset
|
2 |
74547 | 3 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
75347 | 4 ;; 2005, 2006, 2007 Free Software Foundation, Inc. |
17493 | 5 |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
6 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> |
17493 | 7 ;; Keywords: news |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
78224
24202b793a08
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
75347
diff
changeset
|
13 ;; the Free Software Foundation; either version 3, or (at your option) |
17493 | 14 ;; any later version. |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
64085 | 23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
24 ;; Boston, MA 02110-1301, USA. | |
17493 | 25 |
26 ;;; Commentary: | |
27 | |
28 ;;; Code: | |
29 | |
19634
118761d47324
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
30 (eval-when-compile (require 'cl)) |
118761d47324
Require cl at compile time.
Richard M. Stallman <rms@gnu.org>
parents:
17493
diff
changeset
|
31 |
17493 | 32 (require 'gnus) |
33 (require 'gnus-start) | |
34 (require 'gnus-int) | |
35 (require 'gnus-range) | |
36 | |
37 ;;; | |
38 ;;; Moving by comparing Message-ID's. | |
39 ;;; | |
40 | |
41 ;;;###autoload | |
42 (defun gnus-change-server (from-server to-server) | |
43 "Move from FROM-SERVER to TO-SERVER. | |
44 Update the .newsrc.eld file to reflect the change of nntp server." | |
45 (interactive | |
46 (list gnus-select-method (gnus-read-method "Move to method: "))) | |
47 | |
48 ;; First start Gnus. | |
49 (let ((gnus-activate-level 0) | |
87097 | 50 (mail-sources nil)) |
17493 | 51 (gnus)) |
52 | |
53 (save-excursion | |
54 ;; Go through all groups and translate. | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
55 (let ((nntp-nov-gap nil)) |
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
56 (dolist (info gnus-newsrc-alist) |
17493 | 57 (when (gnus-group-native-p (gnus-info-group info)) |
58 (gnus-move-group-to-server info from-server to-server)))))) | |
59 | |
60 (defun gnus-move-group-to-server (info from-server to-server) | |
61 "Move group INFO from FROM-SERVER to TO-SERVER." | |
62 (let ((group (gnus-info-group info)) | |
63 to-active hashtb type mark marks | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
64 to-article to-reads to-marks article |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
65 act-articles) |
17493 | 66 (gnus-message 7 "Translating %s..." group) |
67 (when (gnus-request-group group nil to-server) | |
68 (setq to-active (gnus-parse-active) | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
69 hashtb (gnus-make-hashtable 1024) |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
70 act-articles (gnus-uncompress-range to-active)) |
17493 | 71 ;; Fetch the headers from the `to-server'. |
72 (when (and to-active | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
73 act-articles |
17493 | 74 (setq type (gnus-retrieve-headers |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
75 act-articles |
17493 | 76 group to-server))) |
77 ;; Convert HEAD headers. I don't care. | |
78 (when (eq type 'headers) | |
79 (nnvirtual-convert-headers)) | |
80 ;; Create a mapping from Message-ID to article number. | |
81 (set-buffer nntp-server-buffer) | |
82 (goto-char (point-min)) | |
83 (while (looking-at | |
84 "^[0-9]+\t[^\t]*\t[^\t]*\t[^\t]*\t\\([^\t]*\\)\t") | |
85 (gnus-sethash | |
86 (buffer-substring (match-beginning 1) (match-end 1)) | |
87 (read (current-buffer)) | |
88 hashtb) | |
89 (forward-line 1)) | |
90 ;; Then we read the headers from the `from-server'. | |
91 (when (and (gnus-request-group group nil from-server) | |
92 (gnus-active group) | |
31716
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
93 (gnus-uncompress-range |
9968f55ad26e
Update to emacs-21-branch of the Gnus CVS repository.
Gerd Moellmann <gerd@gnu.org>
parents:
24357
diff
changeset
|
94 (gnus-active group)) |
17493 | 95 (setq type (gnus-retrieve-headers |
96 (gnus-uncompress-range | |
97 (gnus-active group)) | |
98 group from-server))) | |
99 ;; Make it easier to map marks. | |
100 (let ((mark-lists (gnus-info-marks info)) | |
101 ms type m) | |
102 (while mark-lists | |
103 (setq type (caar mark-lists) | |
104 ms (gnus-uncompress-range (cdr (pop mark-lists)))) | |
105 (while ms | |
106 (if (setq m (assq (car ms) marks)) | |
107 (setcdr m (cons type (cdr m))) | |
108 (push (list (car ms) type) marks)) | |
109 (pop ms)))) | |
110 ;; Convert. | |
111 (when (eq type 'headers) | |
112 (nnvirtual-convert-headers)) | |
113 ;; Go through the headers and map away. | |
114 (set-buffer nntp-server-buffer) | |
115 (goto-char (point-min)) | |
116 (while (looking-at | |
117 "^[0-9]+\t[^\t]*\t[^\t]*\t[^\t]*\t\\([^\t]*\\)\t") | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
118 (when (setq to-article |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
119 (gnus-gethash |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
120 (buffer-substring (match-beginning 1) (match-end 1)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
121 hashtb)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
122 ;; Add this article to the list of read articles. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
123 (push to-article to-reads) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
124 ;; See if there are any marks and then add them. |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
125 (when (setq mark (assq (read (current-buffer)) marks)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
126 (setq marks (delq mark marks)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
127 (setcar mark to-article) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
128 (push mark to-marks)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
129 (forward-line 1))) |
17493 | 130 ;; Now we know what the read articles are and what the |
131 ;; article marks are. We transform the information | |
132 ;; into the Gnus info format. | |
133 (setq to-reads | |
134 (gnus-range-add | |
24357
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
135 (gnus-compress-sequence |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
136 (and (setq to-reads (delq nil to-reads)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
137 (sort to-reads '<)) |
15fc6acbae7a
Upgrading to Gnus 5.7; see ChangeLog
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19969
diff
changeset
|
138 t) |
17493 | 139 (cons 1 (1- (car to-active))))) |
140 (gnus-info-set-read info to-reads) | |
141 ;; Do the marks. I'm sure y'all understand what's | |
142 ;; going on down below, so I won't bother with any | |
143 ;; further comments. <duck> | |
144 (let ((mlists gnus-article-mark-lists) | |
145 lists ms a) | |
146 (while mlists | |
147 (push (list (cdr (pop mlists))) lists)) | |
148 (while (setq ms (pop marks)) | |
149 (setq article (pop ms)) | |
150 (while ms | |
151 (setcdr (setq a (assq (pop ms) lists)) | |
152 (cons article (cdr a))))) | |
153 (setq a lists) | |
154 (while a | |
19969
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
155 (setcdr (car a) (gnus-compress-sequence |
5f1ab3dd344d
*** empty log message ***
Lars Magne Ingebrigtsen <larsi@gnus.org>
parents:
19634
diff
changeset
|
156 (and (cdar a) (sort (cdar a) '<)))) |
17493 | 157 (pop a)) |
158 (gnus-info-set-marks info lists t))))) | |
159 (gnus-message 7 "Translating %s...done" group))) | |
160 | |
161 (defun gnus-group-move-group-to-server (info from-server to-server) | |
162 "Move the group on the current line from FROM-SERVER to TO-SERVER." | |
163 (interactive | |
164 (let ((info (gnus-get-info (gnus-group-group-name)))) | |
165 (list info (gnus-find-method-for-group (gnus-info-group info)) | |
166 (gnus-read-method (format "Move group %s to method: " | |
167 (gnus-info-group info)))))) | |
168 (save-excursion | |
169 (gnus-move-group-to-server info from-server to-server) | |
170 ;; We have to update the group info to point use the right server. | |
171 (gnus-info-set-method info to-server t) | |
172 ;; We also have to change the name of the group and stuff. | |
173 (let* ((group (gnus-info-group info)) | |
174 (new-name (gnus-group-prefixed-name | |
175 (gnus-group-real-name group) to-server))) | |
176 (gnus-info-set-group info new-name) | |
85712
a3c27999decb
Update Gnus to No Gnus 0.7 from the Gnus CVS trunk
Miles Bader <miles@gnu.org>
parents:
78224
diff
changeset
|
177 (gnus-sethash new-name (gnus-group-entry group) gnus-newsrc-hashtb) |
17493 | 178 (gnus-sethash group nil gnus-newsrc-hashtb)))) |
179 | |
180 (provide 'gnus-move) | |
181 | |
52401 | 182 ;;; arch-tag: 503742b8-7d66-4d79-bb31-4a698070707b |
17493 | 183 ;;; gnus-move.el ends here |