Show
Ignore:
Timestamp:
2004年10月31日 15時41分47秒 (4 years ago)
Author:
miyoshi
Message:

* fringe.c: Sync up with Emacs CVS HEAD.

* xdisp.c (handle_single_display_prop): Merge codes related with
the changes in fringe.c.

* xfaces.c: Update declarations.

* w32console.c: Partially sync up with Emacs CVS HEAD.

* mw32term.c (note_mouse_highlight): Update arguments for
window_from_coordinates().
(glyph_rect): Ditto.
(mw32_message_loop): Ditto.
Merge codes related with the changes in fringe.c.

* lisp.h: Update declarations.

* keymap.c: Update declarations.
(describe_command): Add a dummy argument.
(describe_translation): Ditto.

* keyboard.c (make_lispy_event): Update arguments for
window_from_coordinates().
(make_lispy_movement): Ditto.

* dispextern.h: Update declarations.

* eval.c: Ditto.

* alloc.c (make_string): Sync up with Emacs CVS HEAD.
(make_unibyte_string): Ditto.
(make_multibyte_string): Ditto.

* lisp/cus-load.el: Update.

* lisp/loaddefs.el: Ditto.

* lisp/calc/calc-embed.el: Sync up with Emacs CVS HEAD.

* lisp/calc/calc-graph.el: Ditto.

* lisp/calc/calc-help.el: Ditto.

* lisp/calc/calc-misc.el: Ditto.

* lisp/calc/calc-units.el: Ditto.

* lisp/calc/calc.el: Ditto.

* lisp/calendar/cal-iso.el: Ditto.

* lisp/calendar/cal-menu.el: Ditto.

* lisp/calendar/calendar.el: Ditto.

* lisp/calendar/diary-lib.el: Ditto.

* lisp/calendar/holidays.el: Ditto.

* lisp/calendar/time-date.el: Ditto.

* lisp/emacs-lisp/cl-macs.el: Ditto.

* lisp/emacs-lisp/helper.el: Ditto.

* lisp/emulation/cua-base.el: Ditto.

* lisp/emulation/cua-rect.el: Ditto.

* lisp/eshell/em-pred.el: Ditto.

* lisp/eshell/esh-ext.el: Ditto.

* lisp/gnus/ChangeLog: Ditto.

* lisp/gnus/binhex.el: Ditto.

* lisp/gnus/catchup.xpm: Ditto.

* lisp/gnus/cu-exit.xpm: Ditto.

* lisp/gnus/describe-group.xpm: Ditto.

* lisp/gnus/earcon.el: Ditto.

* lisp/gnus/exit-gnus.xpm: Ditto.

* lisp/gnus/exit-summ.xpm: Ditto.

* lisp/gnus/flow-fill.el: Ditto.

* lisp/gnus/followup.xpm: Ditto.

* lisp/gnus/fuwo.xpm: Ditto.

* lisp/gnus/get-news.xpm: Ditto.

* lisp/gnus/gnntg.xpm: Ditto.

* lisp/gnus/gnus-agent.el: Ditto.

* lisp/gnus/gnus-art.el: Ditto.

* lisp/gnus/gnus-async.el: Ditto.

* lisp/gnus/gnus-audio.el: Ditto.

* lisp/gnus/gnus-bcklg.el: Ditto.

* lisp/gnus/gnus-cache.el: Ditto.

* lisp/gnus/gnus-cite.el: Ditto.

* lisp/gnus/gnus-cus.el: Ditto.

* lisp/gnus/gnus-demon.el: Ditto.

* lisp/gnus/gnus-draft.el: Ditto.

* lisp/gnus/gnus-dup.el: Ditto.

* lisp/gnus/gnus-eform.el: Ditto.

* lisp/gnus/gnus-ems.el: Ditto.

* lisp/gnus/gnus-gl.el: Ditto.

* lisp/gnus/gnus-group.el: Ditto.

* lisp/gnus/gnus-int.el: Ditto.

* lisp/gnus/gnus-kill.el: Ditto.

* lisp/gnus/gnus-logic.el: Ditto.

* lisp/gnus/gnus-mh.el: Ditto.

* lisp/gnus/gnus-ml.el: Ditto.

* lisp/gnus/gnus-mlspl.el: Ditto.

* lisp/gnus/gnus-msg.el: Ditto.

* lisp/gnus/gnus-nocem.el: Ditto.

* lisp/gnus/gnus-range.el: Ditto.

* lisp/gnus/gnus-salt.el: Ditto.

* lisp/gnus/gnus-score.el: Ditto.

* lisp/gnus/gnus-setup.el: Ditto.

* lisp/gnus/gnus-soup.el: Ditto.

* lisp/gnus/gnus-spec.el: Ditto.

* lisp/gnus/gnus-srvr.el: Ditto.

* lisp/gnus/gnus-start.el: Ditto.

* lisp/gnus/gnus-sum.el: Ditto.

* lisp/gnus/gnus-topic.el: Ditto.

* lisp/gnus/gnus-undo.el: Ditto.

* lisp/gnus/gnus-util.el: Ditto.

* lisp/gnus/gnus-uu.el: Ditto.

* lisp/gnus/gnus-vm.el: Ditto.

* lisp/gnus/gnus-win.el: Ditto.

* lisp/gnus/gnus.el: Ditto.

* lisp/gnus/ietf-drums.el: Ditto.

* lisp/gnus/imap.el: Ditto.

* lisp/gnus/kill-group.xpm: Ditto.

* lisp/gnus/mail-parse.el: Ditto.

* lisp/gnus/mail-prsvr.el: Ditto.

* lisp/gnus/mail-reply.xpm: Ditto.

* lisp/gnus/mail-source.el: Ditto.

* lisp/gnus/mailcap.el: Ditto.

* lisp/gnus/message.el: Ditto.

* lisp/gnus/messcompat.el: Ditto.

* lisp/gnus/mm-bodies.el: Ditto.

* lisp/gnus/mm-decode.el: Ditto.

* lisp/gnus/mm-encode.el: Ditto.

* lisp/gnus/mm-partial.el: Ditto.

* lisp/gnus/mm-util.el: Ditto.

* lisp/gnus/mm-uu.el: Ditto.

* lisp/gnus/mm-view.el: Ditto.

* lisp/gnus/mml.el: Ditto.

* lisp/gnus/next-ur.xpm: Ditto.

* lisp/gnus/nnagent.el: Ditto.

* lisp/gnus/nnbabyl.el: Ditto.

* lisp/gnus/nndoc.el: Ditto.

* lisp/gnus/nndraft.el: Ditto.

* lisp/gnus/nneething.el: Ditto.

* lisp/gnus/nnfolder.el: Ditto.

* lisp/gnus/nngateway.el: Ditto.

* lisp/gnus/nnheader.el: Ditto.

* lisp/gnus/nnimap.el: Ditto.

* lisp/gnus/nnkiboze.el: Ditto.

* lisp/gnus/nnlistserv.el: Ditto.

* lisp/gnus/nnmail.el: Ditto.

* lisp/gnus/nnmbox.el: Ditto.

* lisp/gnus/nnmh.el: Ditto.

* lisp/gnus/nnml.el: Ditto.

* lisp/gnus/nnoo.el: Ditto.

* lisp/gnus/nnslashdot.el: Ditto.

* lisp/gnus/nnsoup.el: Ditto.

* lisp/gnus/nnspool.el: Ditto.

* lisp/gnus/nntp.el: Ditto.

* lisp/gnus/nnultimate.el: Ditto.

* lisp/gnus/nnvirtual.el: Ditto.

* lisp/gnus/nnwarchive.el: Ditto.

* lisp/gnus/nnweb.el: Ditto.

* lisp/gnus/pop3.el: Ditto.

* lisp/gnus/post.xpm: Ditto.

* lisp/gnus/prev-ur.xpm: Ditto.

* lisp/gnus/qp.el: Ditto.

* lisp/gnus/reply-wo.xpm: Ditto.

* lisp/gnus/reply.xpm: Ditto.

* lisp/gnus/rfc1843.el: Ditto.

* lisp/gnus/rfc2045.el: Ditto.

* lisp/gnus/rfc2047.el: Ditto.

* lisp/gnus/rfc2231.el: Ditto.

* lisp/gnus/rot13.xpm: Ditto.

* lisp/gnus/save-aif.xpm: Ditto.

* lisp/gnus/save-art.xpm: Ditto.

* lisp/gnus/score-mode.el: Ditto.

* lisp/gnus/subscribe.xpm: Ditto.

* lisp/gnus/unsubscribe.xpm: Ditto.

* lisp/gnus/utf7.el: Ditto.

* lisp/gnus/uu-decode.xpm: Ditto.

* lisp/gnus/uu-post.xpm: Ditto.

* lisp/gnus/uudecode.el: Ditto.

* lisp/gnus/webmail.el: Ditto.

* lisp/international/characters.el: Ditto.

* lisp/language/cyrillic.el: Ditto.

* lisp/language/indian.el: Ditto.

* lisp/mail/mail-extr.el: Ditto.

* lisp/mail/smtpmail.el: Ditto.

* lisp/mail/supercite.el: Ditto.

* lisp/menu-bar.el: Ditto.

* lisp/mh-e/ChangeLog: Ditto.

* lisp/mh-e/mh-alias.el: Ditto.

* lisp/mh-e/mh-comp.el: Ditto.

* lisp/mh-e/mh-customize.el: Ditto.

* lisp/mh-e/mh-e.el: Ditto.

* lisp/mh-e/mh-funcs.el: Ditto.

* lisp/mh-e/mh-gnus.el: Ditto.

* lisp/mh-e/mh-identity.el: Ditto.

* lisp/mh-e/mh-inc.el: Ditto.

* lisp/mh-e/mh-index.el: Ditto.

* lisp/mh-e/mh-junk.el: Ditto.

* lisp/mh-e/mh-loaddefs.el: Ditto.

* lisp/mh-e/mh-mime.el: Ditto.

* lisp/mh-e/mh-pick.el: Ditto.

* lisp/mh-e/mh-seq.el: Ditto.

* lisp/mh-e/mh-speed.el: Ditto.

* lisp/mh-e/mh-utils.el: Ditto.

* lisp/mouse-sel.el: Ditto.

* lisp/mouse.el: Ditto.

* lisp/msb.el: Ditto.

* lisp/mwheel.el: Ditto.

* lisp/newcomment.el: Ditto.

* lisp/novice.el: Ditto.

* lisp/outline.el: Ditto.

* lisp/paren.el: Ditto.

* lisp/paths.el: Ditto.

* lisp/play/animate.el: Ditto.

* lisp/play/blackbox.el: Ditto.

* lisp/play/gamegrid.el: Ditto.

* lisp/play/landmark.el: Ditto.

* lisp/play/morse.el: Ditto.

* lisp/play/zone.el: Ditto.

* lisp/printing.el: Ditto.

* lisp/simple.el: Ditto.

* lisp/term/mac-win.el: Ditto.

* lisp/term/x-win.el: Ditto.

* lisp/term/xterm.el: Ditto.

* lisp/textmodes/bibtex.el: Ditto.

* lisp/textmodes/enriched.el: Ditto.

* lisp/textmodes/flyspell.el: Ditto.

* lisp/textmodes/ispell.el: Ditto.

* lisp/textmodes/paragraphs.el: Ditto.

* lisp/textmodes/reftex-auc.el: Ditto.

* lisp/textmodes/tex-mode.el: Ditto.

* lisp/url/ChangeLog: Ditto.

* lisp/url/url-auth.el: Ditto.

* lisp/url/url-cache.el: Ditto.

* lisp/url/url-cookie.el: Ditto.

* lisp/url/url-dired.el: Ditto.

* lisp/url/url-file.el: Ditto.

* lisp/url/url-ftp.el: Ditto.

* lisp/url/url-gw.el: Ditto.

* lisp/url/url-handlers.el: Ditto.

* lisp/url/url-history.el: Ditto.

* lisp/url/url-https.el: Ditto.

* lisp/url/url-irc.el: Ditto.

* lisp/url/url-ldap.el: Ditto.

* lisp/url/url-mailto.el: Ditto.

* lisp/url/url-methods.el: Ditto.

* lisp/url/url-misc.el: Ditto.

* lisp/url/url-news.el: Ditto.

* lisp/url/url-nfs.el: Ditto.

* lisp/url/url-parse.el: Ditto.

* lisp/url/url-privacy.el: Ditto.

* lisp/url/url-util.el: Ditto.

* lisp/url/url-vars.el: Ditto.

* lisp/url/url.el: Ditto.

* lisp/calendar/icalendar.el: New file.

* lisp/gnus/ChangeLog.2: Ditto.

* lisp/gnus/TODO: Ditto.

* lisp/gnus/bar.xbm: Ditto.

* lisp/gnus/bar.xpm: Ditto.

* lisp/gnus/blink.pbm: Ditto.

* lisp/gnus/blink.xpm: Ditto.

* lisp/gnus/braindamaged.xpm: Ditto.

* lisp/gnus/canlock.el: Ditto.

* lisp/gnus/compface.el: Ditto.

* lisp/gnus/cry.xpm: Ditto.

* lisp/gnus/dead.xpm: Ditto.

* lisp/gnus/deuglify.el: Ditto.

* lisp/gnus/dig.el: Ditto.

* lisp/gnus/dns.el: Ditto.

* lisp/gnus/evil.xpm: Ditto.

* lisp/gnus/forced.xpm: Ditto.

* lisp/gnus/frown.xpm: Ditto.

* lisp/gnus/gnus-delay.el: Ditto.

* lisp/gnus/gnus-diary.el: Ditto.

* lisp/gnus/gnus-dired.el: Ditto.

* lisp/gnus/gnus-fun.el: Ditto.

* lisp/gnus/gnus-picon.el: Ditto.

* lisp/gnus/gnus-pointer.xbm: Ditto.

* lisp/gnus/gnus-pointer.xpm: Ditto.

* lisp/gnus/gnus-registry.el: Ditto.

* lisp/gnus/gnus-sieve.el: Ditto.

* lisp/gnus/important.xpm: Ditto.

* lisp/gnus/indifferent.xpm: Ditto.

* lisp/gnus/mm-extern.el: Ditto.

* lisp/gnus/mm-url.el: Ditto.

* lisp/gnus/mml-sec.el: Ditto.

* lisp/gnus/mml-smime.el: Ditto.

* lisp/gnus/mml1991.el: Ditto.

* lisp/gnus/mml2015.el: Ditto.

* lisp/gnus/nndb.el: Ditto.

* lisp/gnus/nndiary.el: Ditto.

* lisp/gnus/gnus.xbm: Ditto.

* lisp/gnus/gnus.xpm: Ditto.

* lisp/gnus/grin.xpm: Ditto.

* lisp/gnus/hex-util.el: Ditto.

* lisp/gnus/html2text.el: Ditto.

* lisp/gnus/nnmaildir.el: Ditto.

* lisp/gnus/nnnil.el: Ditto.

* lisp/gnus/nnrss.el: Ditto.

* lisp/gnus/nnwfm.el: Ditto.

* lisp/gnus/pgg-def.el: Ditto.

* lisp/gnus/pgg-gpg.el: Ditto.

* lisp/gnus/pgg-parse.el: Ditto.

* lisp/gnus/pgg-pgp.el: Ditto.

* lisp/gnus/pgg-pgp5.el: Ditto.

* lisp/gnus/pgg.el: Ditto.

* lisp/gnus/preview.xbm: Ditto.

* lisp/gnus/preview.xpm: Ditto.

* lisp/gnus/receipt.xpm: Ditto.

* lisp/gnus/reverse-smile.xpm: Ditto.

* lisp/gnus/sad.pbm: Ditto.

* lisp/gnus/sad.xpm: Ditto.

* lisp/gnus/sha1.el: Ditto.

* lisp/gnus/sieve-manage.el: Ditto.

* lisp/gnus/sieve-mode.el: Ditto.

* lisp/gnus/sieve.el: Ditto.

* lisp/gnus/smile.xpm: Ditto.

* lisp/gnus/smiley.el: Ditto.

* lisp/gnus/smime.el: Ditto.

* lisp/gnus/spam-report.el: Ditto.

* lisp/gnus/spam-stat.el: Ditto.

* lisp/gnus/spam.el: Ditto.

* lisp/gnus/unimportant.xpm: Ditto.

* lisp/gnus/wry.xpm: Ditto.

* lisp/gnus/yenc.el: Ditto.

* lisp/mh-e/mh-acros.el: Ditto.

* lisp/mh-e/mh-init.el: Ditto.

* lisp/mh-e/mh-print.el: Ditto.

* lisp/net/password.el: Ditto.

* lisp/textmodes/dns-mode.el: Ditto.

* lisp/gnus/gnus-mule.el: Removed.

* lisp/gnus/smiley-ems.el: Ditto.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/2.2/lisp/gnus/gnus-start.el

    r3505 r3526  
    11;;; gnus-start.el --- startup functions for Gnus 
    2 ;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 
     2;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 
    33;;        Free Software Foundation, Inc. 
    44 
     
    3333(require 'gnus-range) 
    3434(require 'gnus-util) 
    35 (require 'message) 
     35(autoload 'message-make-date "message") 
     36(autoload 'gnus-agent-read-servers-validate "gnus-agent") 
     37(autoload 'gnus-agent-possibly-alter-active "gnus-agent") 
    3638(eval-when-compile (require 'cl)) 
    3739 
     
    4143  :group 'gnus-start 
    4244  :type 'file) 
     45 
     46(defcustom gnus-backup-startup-file 'never 
     47  "Whether to create backup files. 
     48This variable takes the same values as the `version-control' 
     49variable." 
     50  :version "21.4" 
     51  :group 'gnus-start 
     52  :type '(choice (const :tag "Never" never) 
     53                 (const :tag "If existing" nil) 
     54                 (other :tag "Always" t))) 
     55 
     56(defcustom gnus-save-startup-file-via-temp-buffer t 
     57  "Whether to write the startup file contents to a buffer then save 
     58the buffer or write directly to the file.  The buffer is faster 
     59because all of the contents are written at once.  The direct write 
     60uses considerably less memory." 
     61  :version "21.4" 
     62  :group 'gnus-start 
     63  :type '(choice (const :tag "Write via buffer" t) 
     64                 (const :tag "Write directly to file" nil))) 
    4365 
    4466(defcustom gnus-init-file (nnheader-concat gnus-home-directory ".gnus") 
     
    225247not match this regexp will be removed before saving the list." 
    226248  :group 'gnus-newsrc 
    227   :type 'boolean) 
     249  :type '(radio (sexp :format "Non-nil\n" 
     250                      :match (lambda (widget value) 
     251                               (and value (not (stringp value)))) 
     252                      :value t) 
     253                (const nil) 
     254                (regexp :format "%t: %v\n" :size 0))) 
    228255 
    229256(defcustom gnus-ignored-newsgroups 
    230257  (mapconcat 'identity 
    231258             '("^to\\."                 ; not "real" groups 
    232                "^[0-9. \t]+       ; all digits in name 
     259               "^[0-9. \t]+\\( \\|$\\)"       ; all digits in name 
    233260               "^[\"][]\"[#'()]"        ; bogus characters 
    234261               ) 
     
    242269 
    243270(defcustom gnus-subscribe-newsgroup-method 'gnus-subscribe-zombies 
    244   "*Function called with a group name when new group is detected. 
     271  "*Function(s) called with a group name when new group is detected. 
    245272A few pre-made functions are supplied: `gnus-subscribe-randomly' 
    246273inserts new groups at the beginning of the list of groups; 
     
    260287                (function-item gnus-subscribe-zombies) 
    261288                (function-item gnus-subscribe-topics) 
    262                 function)) 
     289                function 
     290                (repeat function))) 
     291 
     292(defcustom gnus-subscribe-newsgroup-hooks nil 
     293  "*Hooks run after you subscribe to a new group. 
     294The hooks will be called with new group's name as argument." 
     295  :group 'gnus-group-new 
     296  :type 'hook) 
    263297 
    264298(defcustom gnus-subscribe-options-newsgroup-method 
    265299  'gnus-subscribe-alphabetically 
    266   "*This function is called to subscribe newsgroups mentioned on \"options -n\" lines. 
     300  "*Function(s) called to subscribe newsgroups mentioned on \"options -n\" lines. 
    267301If, for instance, you want to subscribe to all newsgroups in the 
    268302\"no\" and \"alt\" hierarchies, you'd put the following in your 
     
    280314                (function-item gnus-subscribe-killed) 
    281315                (function-item gnus-subscribe-zombies) 
    282                 function)) 
     316                (function-item gnus-subscribe-topics) 
     317                function 
     318                (repeat function))) 
    283319 
    284320(defcustom gnus-subscribe-hierarchical-interactive nil 
     
    295331 
    296332(defcustom gnus-auto-subscribed-groups 
    297   "nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl
     333  "^nnml\\|^nnfolder\\|^nnmbox\\|^nnmh\\|^nnbabyl\\|^nnmaildir
    298334  "*All new groups that match this regexp will be subscribed automatically. 
    299335Note that this variable only deals with new groups.  It has no effect 
     
    355391  :type 'hook) 
    356392 
    357 (defcustom gnus-setup-news-hook nil 
     393(defcustom gnus-setup-news-hook 
     394  '(gnus-fixup-nnimap-unread-after-getting-new-news) 
    358395  "A hook after reading the .newsrc file, but before generating the buffer." 
    359396  :group 'gnus-start 
     397  :type 'hook) 
     398 
     399(defcustom gnus-get-top-new-news-hook nil 
     400  "A hook run just before Gnus checks for new news globally." 
     401  :group 'gnus-group-new 
    360402  :type 'hook) 
    361403 
     
    366408 
    367409(defcustom gnus-after-getting-new-news-hook 
    368   (when (gnus-boundp 'display-time-timer) 
    369     '(display-time-event-handler)
     410  '(gnus-display-time-event-handler 
     411    gnus-fixup-nnimap-unread-after-getting-new-news
    370412  "*A hook run after Gnus checks for new news when Gnus is already running." 
    371413  :group 'gnus-group-new 
     414  :type 'hook) 
     415 
     416(defcustom gnus-read-newsrc-el-hook nil 
     417  "A hook called after reading the newsrc.eld? file." 
     418  :group 'gnus-newsrc 
    372419  :type 'hook) 
    373420 
     
    387434Can be used to turn version control on or off." 
    388435  :group 'gnus-newsrc 
     436  :type 'hook) 
     437 
     438(defcustom gnus-group-mode-hook nil 
     439  "Hook for Gnus group mode." 
     440  :group 'gnus-group-various 
     441  :options '(gnus-topic-mode) 
    389442  :type 'hook) 
    390443 
     
    433486                (load file nil t) 
    434487              (error 
    435                (error "Error in %s: %s" file var))))))))) 
     488               (error "Error in %s: %s" file (cadr var)))))))))) 
    436489 
    437490;; For subscribing new newsgroup 
     
    509562 
    510563(defun gnus-subscribe-alphabetically (newgroup) 
    511   "Subscribe new NEWSGROUP and insert it in alphabetical order." 
     564  "Subscribe new NEWGROUP and insert it in alphabetical order." 
    512565  (let ((groups (cdr gnus-newsrc-alist)) 
    513566        before) 
     
    519572 
    520573(defun gnus-subscribe-hierarchically (newgroup) 
    521   "Subscribe new NEWSGROUP and insert it in hierarchical newsgroup order." 
     574  "Subscribe new NEWGROUP and insert it in hierarchical newsgroup order." 
    522575  ;; Basic ideas by mike-w@cs.aukuni.ac.nz (Mike Williams) 
    523576  (save-excursion 
    524577    (set-buffer (nnheader-find-file-noselect gnus-current-startup-file)) 
    525     (let ((groupkey newgroup) 
    526         before) 
    527       (while (and (not before) groupkey) 
    528         (goto-char (point-min)) 
    529         (let ((groupkey-re 
    530                (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]"))) 
    531           (while (and (re-search-forward groupkey-re nil t) 
    532                       (progn 
    533                         (setq before (match-string 1)) 
    534                         (string< before newgroup))))) 
    535         ;; Remove tail of newsgroup name (eg. a.b.c -> a.b) 
    536         (setq groupkey 
    537               (when (string-match "^\\(.*\\)\\.[^.]+$" groupkey) 
    538                 (substring groupkey (match-beginning 1) (match-end 1))))) 
    539       (gnus-subscribe-newsgroup newgroup before)) 
    540     (kill-buffer (current-buffer)))) 
     578    (prog1 
     579        (let ((groupkey newgroup) before) 
     580         (while (and (not before) groupkey) 
     581            (goto-char (point-min)) 
     582            (let ((groupkey-re 
     583                  (concat "^\\(" (regexp-quote groupkey) ".*\\)[!:]"))) 
     584              (while (and (re-search-forward groupkey-re nil t) 
     585                         (progn 
     586                            (setq before (match-string 1)) 
     587                            (string< before newgroup))))) 
     588            ;; Remove tail of newsgroup name (eg. a.b.c -> a.b) 
     589            (setq groupkey 
     590                 (when (string-match "^\\(.*\\)\\.[^.]+$" groupkey) 
     591                    (substring groupkey (match-beginning 1) (match-end 1))))) 
     592         (gnus-subscribe-newsgroup newgroup before)) 
     593      (kill-buffer (current-buffer))))) 
    541594 
    542595(defun gnus-subscribe-interactively (group) 
     
    567620     gnus-level-killed (gnus-gethash (or next "dummy.group") 
    568621                                     gnus-newsrc-hashtb)) 
    569     (gnus-message 5 "Subscribe newsgroup: %s" newsgroup))) 
     622    (gnus-message 5 "Subscribe newsgroup: %s" newsgroup) 
     623    (run-hook-with-args 'gnus-subscribe-newsgroup-hooks newsgroup) 
     624    t)) 
    570625 
    571626(defun gnus-read-active-file-p () 
     
    576631 
    577632;; Silence byte-compiler. 
    578 (defvar gnus-current-headers) 
    579 (defvar gnus-thread-indent-array) 
    580 (defvar gnus-newsgroup-name) 
    581 (defvar gnus-newsgroup-headers) 
    582 (defvar gnus-group-list-mode) 
    583 (defvar gnus-group-mark-positions) 
    584 (defvar gnus-newsgroup-data) 
    585 (defvar gnus-newsgroup-unreads) 
    586 (defvar nnoo-state-alist) 
    587 (defvar gnus-current-select-method) 
     633(eval-when-compile 
     634  (defvar gnus-current-headers) 
     635  (defvar gnus-thread-indent-array) 
     636  (defvar gnus-newsgroup-name) 
     637  (defvar gnus-newsgroup-headers) 
     638  (defvar gnus-group-list-mode) 
     639  (defvar gnus-group-mark-positions) 
     640  (defvar gnus-newsgroup-data) 
     641  (defvar gnus-newsgroup-unreads) 
     642  (defvar nnoo-state-alist) 
     643  (defvar gnus-current-select-method) 
     644  (defvar mail-sources) 
     645  (defvar nnmail-scan-directory-mail-source-once) 
     646  (defvar nnmail-split-history) 
     647  (defvar nnmail-spool-file)) 
     648 
     649(defun gnus-close-all-servers () 
     650  "Close all servers." 
     651  (interactive) 
     652  (dolist (server gnus-opened-servers) 
     653    (gnus-close-server (car server)))) 
    588654 
    589655(defun gnus-clear-system () 
    590656  "Clear all variables and buffers." 
    591657  ;; Clear Gnus variables. 
    592   (let ((variables gnus-variable-list)) 
     658  (let ((variables (remove 'gnus-format-specs gnus-variable-list))) 
    593659    (while variables 
    594660      (set (car variables) nil) 
     
    597663  (setq gnus-list-of-killed-groups nil 
    598664        gnus-have-read-active-file nil 
     665        gnus-agent-covered-methods nil 
     666        gnus-server-method-cache nil 
    599667        gnus-newsrc-alist nil 
    600668        gnus-newsrc-hashtb nil 
     
    631699  (gnus-kill-buffer nntp-server-buffer) 
    632700  ;; Kill Gnus buffers. 
    633   (let ((buffers (gnus-buffers))) 
    634     (when buffers 
    635       (mapcar 'kill-buffer buffers))) 
     701  (dolist (buffer (gnus-buffers)) 
     702    (gnus-kill-buffer buffer)) 
    636703  ;; Remove Gnus frames. 
    637704  (gnus-kill-gnus-frames)) 
     
    671738    (setq gnus-slave slave) 
    672739    (gnus-read-init-file) 
     740    (if gnus-agent 
     741        (gnus-agentize)) 
    673742 
    674743    (when gnus-simple-splash 
     
    708777 
    709778          ;; Do the actual startup. 
     779          (if gnus-agent 
     780              (gnus-request-create-group "queue" '(nndraft ""))) 
     781          (gnus-request-create-group "drafts" '(nndraft "")) 
    710782          (gnus-setup-news nil level dont-connect) 
    711783          (gnus-run-hooks 'gnus-setup-news-hook) 
     
    727799     "nndraft:drafts" 'gnus-dummy '((gnus-draft-mode))))) 
    728800 
    729 ;;;###autoload 
    730 (defun gnus-unload () 
    731   "Unload all Gnus features. 
    732 \(For some value of `all' or `Gnus'.)  Currently, features whose names 
    733 have prefixes `gnus-', `nn', `mm-' or `rfc' are unloaded.  Use 
    734 cautiously -- unloading may cause trouble." 
    735   (interactive) 
    736   (dolist (feature features) 
    737     (if (string-match "^\\(gnus-\\|nn\\|mm-\\|rfc\\)" (symbol-name feature)) 
    738         (unload-feature feature 'force)))) 
    739  
    740801  
    741802;;; 
     
    764825      (goto-char (point-max)) 
    765826      (insert string "\n") 
    766       (set-window-point (get-buffer-window (current-buffer)) (point-max)) 
     827      ;; This has been commented by Josh Huber <huber@alum.wpi.edu> 
     828      ;; It causes problems with both XEmacs and Emacs 21, and doesn't 
     829      ;; seem to be of much value. (FIXME: remove this after we make sure 
     830      ;; it's not needed). 
     831      ;; (set-window-point (get-buffer-window (current-buffer)) (point-max)) 
    767832      (bury-buffer gnus-dribble-buffer) 
    768833      (save-excursion 
     
    790855      (let ((auto (make-auto-save-file-name)) 
    791856            (gnus-dribble-ignore t) 
     857            (purpose nil) 
    792858            modes) 
    793859        (when (or (file-exists-p auto) (file-exists-p dribble-file)) 
     
    805871                     (setq modes (file-modes gnus-current-startup-file))) 
    806872            (set-file-modes dribble-file modes)) 
     873          (goto-char (point-min)) 
     874          (when (search-forward "Gnus was exited on purpose" nil t) 
     875            (setq purpose t)) 
    807876          ;; Possibly eval the file later. 
    808877          (when (or gnus-always-read-dribble-file 
    809878                    (gnus-y-or-n-p 
    810                      "Gnus auto-save file exists.  Do you want to read it? ")) 
     879                     (if purpose 
     880                         "Gnus exited on purpose without saving; read auto-save file anyway? " 
     881                     "Gnus auto-save file exists.  Do you want to read it? "))) 
    811882            (setq gnus-dribble-eval-file t))))))) 
    812883 
     
    870941    ;; Make sure the archive server is available to all and sundry. 
    871942    (when gnus-message-archive-method 
    872       (setq gnus-server-alist (delq (assoc "archive" gnus-server-alist) 
    873                                     gnus-server-alist)) 
    874       (push (cons "archive" gnus-message-archive-method) 
    875             gnus-server-alist)) 
     943      (unless (assoc "archive" gnus-server-alist) 
     944        (push `("archive" 
     945                nnfolder 
     946                "archive" 
     947                (nnfolder-directory 
     948                 ,(nnheader-concat message-directory "archive")) 
     949                (nnfolder-active-file 
     950                 ,(nnheader-concat message-directory "archive/active")) 
     951                (nnfolder-get-new-mail nil) 
     952                (nnfolder-inhibit-expiry t)) 
     953              gnus-server-alist))) 
    876954 
    877955    ;; If we don't read the complete active file, we fill in the 
     
    880958              (eq gnus-read-active-file 'some)) 
    881959      (gnus-update-active-hashtb-from-killed)) 
     960 
     961    ;; Validate agent covered methods now that gnus-server-alist has 
     962    ;; been initialized. 
     963    ;; NOTE: This is here for one purpose only.  By validating the 
     964    ;; agentized server's, it converts the old 5.10.3, and earlier, 
     965    ;; format to the current format.  That enables the agent code 
     966    ;; within gnus-read-active-file to function correctly. 
     967    (if gnus-agent 
     968        (gnus-agent-read-servers-validate)) 
    882969 
    883970    ;; Read the active file and create `gnus-active-hashtb'. 
     
    909996    ;; See whether we need to read the description file. 
    910997    (when (and (boundp 'gnus-group-line-format) 
     998               (stringp gnus-group-line-format) 
    911999               (let ((case-fold-search nil)) 
    9121000                 (string-match "%[-,0-9]*D" gnus-group-line-format)) 
     
    9231011      (gnus-find-new-newsgroups)) 
    9241012 
     1013    ;; Check and remove bogus newsgroups. 
     1014    (when (and init gnus-check-bogus-newsgroups 
     1015               gnus-read-active-file (not level) 
     1016               (gnus-server-opened gnus-select-method)) 
     1017      (gnus-check-bogus-newsgroups)) 
     1018 
    9251019    ;; We might read in new NoCeM messages here. 
    9261020    (when (and gnus-use-nocem 
     
    9341028    ;; Find the number of unread articles in each non-dead group. 
    9351029    (let ((gnus-read-active-file (and (not level) gnus-read-active-file))) 
    936       (gnus-get-unread-articles level)) 
    937  
    938     (when (and init gnus-check-bogus-newsgroups 
    939                gnus-read-active-file (not level) 
    940                (gnus-server-opened gnus-select-method)) 
    941       (gnus-check-bogus-newsgroups)))) 
     1030      (gnus-get-unread-articles level)))) 
     1031 
     1032(defun gnus-call-subscribe-functions (method group) 
     1033  "Call METHOD to subscribe GROUP. 
     1034If no function returns `non-nil', call `gnus-subscribe-zombies'." 
     1035  (unless (cond 
     1036           ((functionp method) 
     1037            (funcall method group)) 
     1038           ((listp method) 
     1039            (catch 'found 
     1040              (dolist (func method) 
     1041                (if (funcall func group) 
     1042                    (throw 'found t))) 
     1043              nil)) 
     1044           (t nil)) 
     1045    (gnus-subscribe-zombies group))) 
    9421046 
    9431047(defun gnus-find-new-newsgroups (&optional arg) 
     
    9931097                   (setq groups (1+ groups)) 
    9941098                   (gnus-sethash group group gnus-killed-hashtb) 
    995                    (funcall gnus-subscribe-options-newsgroup-method group)) 
     1099                   (gnus-call-subscribe-functions 
     1100                    gnus-subscribe-options-newsgroup-method group)) 
    9961101                  ((eq do-sub 'ignore) 
    9971102                   nil) 
     
    10011106                   (if gnus-subscribe-hierarchical-interactive 
    10021107                       (push group new-newsgroups) 
    1003                      (funcall gnus-subscribe-newsgroup-method group))))))) 
     1108                     (gnus-call-subscribe-functions 
     1109                      gnus-subscribe-newsgroup-method group))))))) 
    10041110           gnus-active-hashtb) 
    10051111          (when new-newsgroups 
     
    10861192                 (incf groups) 
    10871193                 (gnus-sethash group group gnus-killed-hashtb) 
    1088                  (funcall gnus-subscribe-options-newsgroup-method group)) 
     1194                 (gnus-call-subscribe-functions 
     1195                  gnus-subscribe-options-newsgroup-method group)) 
    10891196                ((eq do-sub 'ignore) 
    10901197                 nil) 
     
    10941201                 (if gnus-subscribe-hierarchical-interactive 
    10951202                     (push group new-newsgroups) 
    1096                    (funcall gnus-subscribe-newsgroup-method group))))))) 
     1203                   (gnus-call-subscribe-functions 
     1204                    gnus-subscribe-newsgroup-method group))))))) 
    10971205         hashtb)) 
    10981206      (when new-newsgroups 
     
    11101218    ;; First check if any of the following files exist.  If they do, 
    11111219    ;; it's not the first time the user has used Gnus. 
    1112     (dolist (file (list gnus-current-startup-file 
    1113                         (concat gnus-current-startup-file ".el") 
     1220    (dolist (file (list (concat gnus-current-startup-file ".el") 
    11141221                        (concat gnus-current-startup-file ".eld") 
    1115                         gnus-startup-file 
    11161222                        (concat gnus-startup-file ".el") 
    11171223                        (concat gnus-startup-file ".eld"))) 
     
    11271233                      gnus-backup-default-subscribed-newsgroups)) 
    11281234          group) 
    1129       (when (eq groups t) 
    1130         ;; If t, we subscribe (or not) all groups as if they were new. 
    1131         (mapatoms 
    1132          (lambda (sym) 
    1133            (when (setq group (symbol-name sym)) 
    1134              (let ((do-sub (gnus-matches-options-n group))) 
    1135                (cond 
    1136                 ((eq do-sub 'subscribe) 
    1137                  (gnus-sethash group group gnus-killed-hashtb) 
    1138                  (funcall gnus-subscribe-options-newsgroup-method group)) 
    1139                 ((eq do-sub 'ignore) 
    1140                  nil) 
    1141                 (t 
    1142                  (push group gnus-killed-list)))))) 
    1143          gnus-active-hashtb) 
     1235      (if (eq groups t) 
     1236          ;; If t, we subscribe (or not) all groups as if they were new. 
     1237          (mapatoms 
     1238           (lambda (sym) 
     1239             (when (setq group (symbol-name sym)) 
     1240               (let ((do-sub (gnus-matches-options-n group))) 
     1241                 (cond 
     1242                  ((eq do-sub 'subscribe) 
     1243                   (gnus-sethash group group gnus-killed-hashtb) 
     1244                   (gnus-call-subscribe-functions 
     1245                    gnus-subscribe-options-newsgroup-method group)) 
     1246                  ((eq do-sub 'ignore) 
     1247                   nil) 
     1248                  (t 
     1249                   (push group gnus-killed-list)))))) 
     1250           gnus-active-hashtb) 
    11441251        (dolist (group groups) 
    11451252          ;; Only subscribe the default groups that are activated. 
     
    11491256        (save-excursion 
    11501257          (set-buffer gnus-group-buffer) 
    1151           (gnus-group-make-help-group)) 
     1258          ;; Don't error if the group already exists. This happens when a 
     1259          ;; first-time user types 'F'. -- didier 
     1260          (gnus-group-make-help-group t)) 
    11521261        (when gnus-novice-user 
    11531262          (gnus-message 7 "`A k' to list killed groups")))))) 
    11541263 
    11551264(defun gnus-subscribe-group (group &optional previous method) 
    1156   "Subcribe GROUP and put it after PREVIOUS." 
     1265  "Subscribe GROUP and put it after PREVIOUS." 
    11571266  (gnus-group-change-level 
    11581267   (if method 
     
    12141323      (cond 
    12151324       ((>= oldlevel gnus-level-zombie) 
    1216         (if (= oldlevel gnus-level-zombie) 
    1217             (setq gnus-zombie-list (delete group gnus-zombie-list)) 
    1218           (setq gnus-killed-list (delete group gnus-killed-list)))) 
     1325        ;; oldlevel could be wrong. 
     1326        (setq gnus-zombie-list (delete group gnus-zombie-list)) 
     1327        (setq gnus-killed-list (delete group gnus-killed-list))) 
    12191328       (t 
    12201329        (when (and (>= level gnus-level-zombie) 
     
    12391348          (if (= level gnus-level-zombie) 
    12401349              (push group gnus-zombie-list) 
    1241             (push group gnus-killed-list)))) 
     1350            (if (= oldlevel gnus-level-killed) 
     1351                ;; Remove from active hashtb. 
     1352                (unintern group gnus-active-hashtb) 
     1353              ;; Don't add it into killed-list if it was killed. 
     1354              (push group gnus-killed-list))))) 
    12421355       (t 
    12431356        ;; If the list is to be entered into the newsrc assoc, and 
     
    13071420              group (gnus-info-group info)) 
    13081421        (unless (or (gnus-active group) ; Active 
    1309                     (gnus-info-method info)) ; Foreign 
     1422                    (and (gnus-info-method info) 
     1423                         (not (gnus-secondary-method-p 
     1424                               (gnus-info-method info))))) ; Foreign 
    13101425          ;; Found a bogus newsgroup. 
    13111426          (push group bogus))) 
     
    13781493                (gnus-request-scan group method)) 
    13791494           t) 
    1380          (condition-case (
     1495         (if (or debug-on-error debug-on-quit
    13811496             (inline (gnus-request-group group dont-check method)) 
    1382            ;;(error nil) 
    1383            (quit 
    1384             (message "Quit activating %s" group) 
    1385             nil)) 
    1386          (setq active (gnus-parse-active)) 
    1387          ;; If there are no articles in the group, the GROUP 
    1388          ;; command may have responded with the `(0 . 0)'.  We 
    1389          ;; ignore this if we already have an active entry 
    1390          ;; for the group. 
    1391          (if (and (zerop (car active)) 
    1392                   (zerop (cdr active)) 
    1393                   (gnus-active group)) 
    1394              (gnus-active group) 
    1395            (gnus-set-active group active) 
    1396            ;; Return the new active info. 
    1397            active)))) 
     1497           (condition-case nil 
     1498               (inline (gnus-request-group group dont-check method)) 
     1499             ;;(error nil) 
     1500             (quit 
     1501              (message "Quit activating %s" group) 
     1502              nil))) 
     1503         (unless dont-check 
     1504           (setq active (gnus-parse-active)) 
     1505           ;; If there are no articles in the group, the GROUP 
     1506           ;; command may have responded with the `(0 . 0)'.  We 
     1507           ;; ignore this if we already have an active entry 
     1508           ;; for the group. 
     1509           (if (and (zerop (car active)) 
     1510                    (zerop (cdr active)) 
     1511                    (gnus-active group)) 
     1512               (gnus-active group) 
     1513 
     1514             (gnus-set-active group active) 
     1515             ;; Return the new active info. 
     1516             active))))) 
    13981517 
    13991518(defun gnus-get-unread-articles-in-group (info active &optional update) 
     
    14121531        (inline (gnus-cache-possibly-alter-active 
    14131532                 (gnus-info-group info) active))) 
     1533 
     1534      ;; If the agent is enabled, we may have to alter the active info. 
     1535      (when (and gnus-agent info) 
     1536        (gnus-agent-possibly-alter-active 
     1537         (gnus-info-group info) active)) 
     1538 
    14141539      ;; Modify the list of read articles according to what articles 
    14151540      ;; are available; then tally the unread articles and add the 
     
    14781603        (setq num (max 0 (- (cdr active) num))))) 
    14791604      ;; Set the number of unread articles. 
    1480       (when info 
     1605      (when (and info 
     1606                 (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb)) 
    14811607        (setcar (gnus-gethash (gnus-info-group info) gnus-newsrc-hashtb) num)) 
    14821608      num))) 
     
    14851611;; and compute how many unread articles there are in each group. 
    14861612(defun gnus-get-unread-articles (&optional level) 
     1613  (setq gnus-server-method-cache nil) 
    14871614  (let* ((newsrc (cdr gnus-newsrc-alist)) 
    14881615         (level (or level gnus-activate-level (1+ gnus-level-subscribed))) 
     
    14961623                 (t 0)) 
    14971624           level)) 
    1498          scanned-methods info group active method retrievegroups) 
    1499     (gnus-message 5 "Checking new news...") 
     1625         (methods-cache nil) 
     1626         (type-cache nil) 
     1627         scanned-methods info group active method retrieve-groups cmethod 
     1628         method-type) 
     1629    (gnus-message 6 "Checking new news...") 
    15001630 
    15011631    (while newsrc 
     
    15151645      ;; t for unchecked foreign groups or bogus groups, or groups that can't 
    15161646      ;;   be checked, for one reason or other. 
    1517       (if (and (setq method (gnus-info-method info)) 
    1518                (not (inline 
    1519                       (gnus-server-equal 
    1520                        gnus-select-method 
    1521                        (setq method (gnus-server-get-method nil method))))) 
    1522                (not (gnus-secondary-method-p method))) 
     1647      (when (setq method (gnus-info-method info)) 
     1648        (if (setq cmethod (assoc method methods-cache)) 
     1649            (setq method (cdr cmethod)) 
     1650          (setq cmethod (inline (gnus-server-get-method nil method))) 
     1651          (push (cons method cmethod) methods-cache) 
     1652          (setq method cmethod))) 
     1653      (when (and method 
     1654                 (not (setq method-type (cdr (assoc method type-cache))))) 
     1655        (setq method-type 
     1656              (cond 
     1657               ((gnus-secondary-method-p method) 
     1658                'secondary) 
     1659               ((inline (gnus-server-equal gnus-select-method method)) 
     1660                'primary) 
     1661               (t 
     1662                'foreign))) 
     1663        (push (cons method method-type) type-cache)) 
     1664      (if (and method 
     1665               (eq method-type 'foreign)) 
    15231666          ;; These groups are foreign.  Check the level. 
    15241667          (when (and (<= (gnus-info-level info) foreign-level) 
    1525                      (setq active (gnus-activate-group group 'scan))) 
     1668                    (setq active (gnus-activate-group group 'scan))) 
    15261669            ;; Let the Gnus agent save the active file. 
    1527             (when (and gnus-agent gnus-plugged active
     1670            (when (and gnus-agent active (gnus-online method)
    15281671              (gnus-agent-save-group-info 
    15291672               method (gnus-group-real-name group) active)) 
     
    15431686              ;; if server support gnus-retrieve-groups we push 
    15441687              ;; the group onto retrievegroups for later checking 
    1545               (if (assoc method retrievegroups) 
    1546                   (setcdr (assoc method retrievegroups) 
    1547                           (cons group (cdr (assoc method retrievegroups)))) 
    1548                 (push (list method group) retrievegroups)) 
     1688              (if (assoc method retrieve-groups) 
     1689                  (setcdr (assoc method retrieve-groups) 
     1690                          (cons group (cdr (assoc method retrieve-groups)))) 
     1691                (push (list method group) retrieve-groups)) 
    15491692            ;; hack: `nnmail-get-new-mail' changes the mail-source depending 
    15501693            ;; on the group, so we must perform a scan for every group 
     
    15641707              (setq active (gnus-activate-group group 'scan)) 
    15651708              (push method scanned-methods)) 
    1566             (when active 
    1567               (gnus-close-group group)))))) 
     1709           (when active 
     1710             (gnus-close-group group)))))) 
    15681711 
    15691712      ;; Get the number of unread articles in the group. 
     
    15791722        (gnus-set-active group nil) 
    15801723        (let ((tmp (gnus-gethash group gnus-newsrc-hashtb))) 
    1581           (if tmp (setcar tmp t)))))) 
     1724          (when tmp 
     1725            (setcar tmp t)))))) 
    15821726 
    15831727    ;; iterate through groups on methods which support gnus-retrieve-groups 
    15841728    ;; and fetch a partial active file and use it to find new news. 
    1585     (while retrievegroups 
    1586       (let* ((mg (pop retrievegroups)) 
    1587              (method (or (car mg) gnus-select-method)) 
    1588              (groups (cdr mg))) 
     1729    (dolist (rg retrieve-groups) 
     1730      (let ((method (or (car rg) gnus-select-method)) 
     1731            (groups (cdr rg))) 
    15891732        (when (gnus-check-server method) 
    1590           ;; Request that the backend scan its incoming messages. 
    1591           (when (gnus-check-backend-function 'request-scan (car method)) 
    1592             (gnus-request-scan nil method)) 
    1593           (gnus-read-active-file-2 (mapcar (lambda (group) 
    1594                                              (gnus-group-real-name group)
    1595                                            groups) method) 
    1596           (dolist (group groups) 
    1597             (cond 
    1598              ((setq active (gnus-active (gnus-info-group 
    1599                                         (setq info (gnus-get-info group))))) 
    1600               (inline (gnus-get-unread-articles-in-group info active t))) 
    1601              (t 
    1602               ;; The group couldn't be reached, so we nix out the number of 
    1603               ;; unread articles and stuff. 
    1604               (gnus-set-active group nil) 
    1605               (setcar (gnus-gethash group gnus-newsrc-hashtb) t))))))) 
    1606  
    1607     (gnus-message 5 "Checking new news...done"))) 
     1733         ;; Request that the backend scan its incoming messages. 
     1734         (when (gnus-check-backend-function 'request-scan (car method)) 
     1735           (gnus-request-scan nil method)) 
     1736          (gnus-read-active-file-2 
     1737          (mapcar (lambda (group) (gnus-group-real-name group)) groups
     1738          method) 
     1739         (dolist (group groups) 
     1740           (cond 
     1741            ((setq active (gnus-active (gnus-info-group 
     1742                                        (setq info (gnus-get-info group))))) 
     1743             (inline (gnus-get-unread-articles-in-group info active t))) 
     1744            (t 
     1745             ;; The group couldn't be reached, so we nix out the number of 
     1746             ;; unread articles and stuff. 
     1747             (gnus-set-active group nil) 
     1748             (setcar (gnus-gethash group gnus-newsrc-hashtb) t))))))) 
     1749 
     1750    (gnus-message 6 "Checking new news...done"))) 
    16081751 
    16091752;; Create a hash table out of the newsrc alist.  The `car's of the 
     
    16651808        (push article news))) 
    16661809    (when news 
     1810      ;; Enter this list into the group info. 
    16671811      (gnus-info-set-read 
    16681812       info (gnus-remove-from-range (gnus-info-read info) (nreverse news))) 
     1813 
     1814      ;; Set the number of unread articles in gnus-newsrc-hashtb. 
     1815      (gnus-get-unread-articles-in-group info (gnus-active group)) 
     1816 
     1817      ;; Insert the change into the group buffer and the dribble file. 
     1818      (gnus-group-update-group group t)))) 
     1819 
     1820(defun gnus-make-ascending-articles-unread (group articles) 
     1821  "Mark ascending ARTICLES in GROUP as unread." 
     1822  (let* ((entry (or (gnus-gethash group gnus-newsrc-hashtb) 
     1823                    (gnus-gethash (gnus-group-real-name group) 
     1824                                  gnus-newsrc-hashtb))) 
     1825         (info (nth 2 entry)) 
     1826         (ranges (gnus-info-read info)) 
     1827         (r ranges) 
     1828         modified) 
     1829 
     1830    (while articles 
     1831      (let ((article (pop articles))) ; get the next article to remove from ranges 
     1832        (while (let ((range (car ranges))) ; note the current range 
     1833                 (if (atom range)       ; single value range 
     1834                     (cond ((not range) 
     1835                            ;; the articles extend past the end of the ranges 
     1836                            ;; OK - I'm done 
     1837                            (setq articles nil)) 
     1838                           ((< range article) 
     1839                            ;; this range preceeds the article. Leave the range unmodified. 
     1840                            (pop ranges) 
     1841                            ranges) 
     1842                           ((= range article) 
     1843                            ;; this range exactly matches the article; REMOVE THE RANGE. 
     1844                            ;; NOTE: When the range being removed is the last range, the list is corrupted by inserting null at its end. 
     1845                            (setcar ranges (cadr ranges)) 
     1846                            (setcdr ranges (cddr ranges)) 
     1847                            (setq modified (if (car ranges) t 'remove-null)) 
     1848                            nil)) 
     1849                   (let ((min (car range)) 
     1850                         (max (cdr range))) 
     1851                     ;; I have a min/max range to consider 
     1852                     (cond ((> min max) ; invalid range introduced by splitter 
     1853