home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / functions / gnus-auto-save.el < prev    next >
Encoding:
Text File  |  1991-03-20  |  943 b   |  27 lines

  1. ; From: montnaro@sprite.crd.ge.com (Skip Montanaro)
  2. ; Newsgroups: gnu.emacs.gnus
  3. ; Subject: Saving ~/.newsrc every now and again
  4. ; Date: 17 Oct 89 14:25:39 GMT
  5. ; Reply-To: <montanaro@crdgw1.ge.com> (Skip Montanaro)
  6. ; I was a annoyed that GNUS didn't save my .newsrc periodically (automatically
  7. ; - I know I can do it manually), so I added the following code to my .emacs
  8. ; file. All changes are made using hooks.
  9. (setq gnus-newsrc-save-frequency 20)
  10. (setq gnus-read-articles 0)
  11. (setq gnus-Select-group-hook
  12.       '(lambda ()
  13.      (if (> gnus-read-articles gnus-newsrc-save-frequency)
  14.          (progn
  15.            (gnus-save-newsrc-file)
  16.            (setq gnus-read-articles 0)))))
  17.  
  18. (setq gnus-Article-prepare-hook
  19.       '(lambda ()
  20.      (setq gnus-read-articles (1+ gnus-read-articles))))
  21.  
  22. ; Now, every time a new group is selected, if more than 20 articles have been
  23. ; read since the last time .newsrc was saved, it's saved, and the counter is
  24. ; reset. 
  25.