(defcustom gnus-site-init-file
(ignore-errors
- (concat (file-name-directory
+ (concat (file-name-directory
(directory-file-name installation-directory))
"site-lisp/gnus-init"))
"The site-wide Gnus elisp startup file.
(const :tag "none" nil)))
(defcustom gnus-modtime-botch nil
- "*Non-nil means .newsrc should be deleted prior to save.
+ "*Non-nil means .newsrc should be deleted prior to save.
Its use is due to the bogus appearance that .newsrc was modified on
disc."
:group 'gnus-newsrc
:group 'gnus-start
:type 'hook)
+(defcustom gnus-started-hook nil
+ "A hook called as the last thing after startup."
+ :group 'gnus-start
+ :type 'hook)
+
(defcustom gnus-get-new-news-hook nil
"A hook run just before Gnus checks for new news."
:group 'gnus-group-new
:type 'hook)
-(defcustom gnus-after-getting-new-news-hook
+(defcustom gnus-after-getting-new-news-hook
(when (gnus-boundp 'display-time-timer)
'(display-time-event-handler))
"A hook run after Gnus checks for new news."
;; Suggested by Brian Edmonds <edmonds@cs.ubc.ca>.
(defvar gnus-init-inhibit nil)
(defun gnus-read-init-file (&optional inhibit-next)
- ;; Don't load .gnus if -q option was used.
+ ;; Don't load .gnus if the -q option was used.
(when init-file-user
(if gnus-init-inhibit
(setq gnus-init-inhibit nil)
(eq major-mode 'gnus-group-mode)))
(progn
(switch-to-buffer gnus-group-buffer)
- (gnus-group-get-new-news))
+ (gnus-group-get-new-news
+ (and (numberp arg)
+ (> arg 0)
+ (max (car gnus-group-list-mode) arg))))
(gnus-splash)
(gnus-clear-system)
(gnus-group-list-groups level)
(gnus-group-first-unread-group)
(gnus-configure-windows 'group)
- (gnus-group-set-mode-line))))))
+ (gnus-group-set-mode-line)
+ (run-hooks 'gnus-started-hook))))))
;;;###autoload
(defun gnus-unload ()
If LEVEL is non-nil, the news will be set up at level LEVEL."
(let ((init (not (and gnus-newsrc-alist gnus-active-hashtb (not rawfile)))))
- (when init
+ (when init
;; Clear some variables to re-initialize news information.
(setq gnus-newsrc-alist nil
gnus-active-hashtb nil)
(gnus-cache-open))
;; Possibly eval the dribble file.
- (and init
- (or gnus-use-dribble-file gnus-slave)
+ (and init
+ (or gnus-use-dribble-file gnus-slave)
(gnus-dribble-eval-file))
;; Slave Gnusii should then clear the dribble buffer.
(gnus-find-new-newsgroups))
;; We might read in new NoCeM messages here.
- (when (and gnus-use-nocem
+ (when (and gnus-use-nocem
(not level)
(not dont-connect))
(gnus-nocem-scan-groups))
;; Finally we enter (if needed) the list where it is supposed to
;; go, and change the subscription level. If it is to be killed,
;; we enter it into the killed or zombie list.
- (cond
+ (cond
((>= level gnus-level-zombie)
;; Remove from the hash table.
(gnus-sethash group nil gnus-newsrc-hashtb)
"Alter the ACTIVE info for GROUP to reflect the articles in the cache."
(when gnus-cache-active-hashtb
(let ((cache-active (gnus-gethash group gnus-cache-active-hashtb)))
- (and cache-active
+ (and cache-active
(< (car cache-active) (car active))
(setcar active (car cache-active)))
(and cache-active
(defun gnus-get-unread-articles-in-group (info active &optional update)
(when active
;; Allow the backend to update the info in the group.
- (when (and update
+ (when (and update
(gnus-request-update-info
info (gnus-find-method-for-group (gnus-info-group info))))
(gnus-activate-group (gnus-info-group info) nil t))
(num 0))
;; If a cache is present, we may have to alter the active info.
(when (and gnus-use-cache info)
- (inline (gnus-cache-possibly-alter-active
+ (inline (gnus-cache-possibly-alter-active
(gnus-info-group info) active)))
;; Modify the list of read articles according to what articles
;; are available; then tally the unread articles and add the
;; Get the active file(s) from the backend(s).
(defun gnus-read-active-file (&optional force)
(gnus-group-set-mode-line)
- (let ((methods
+ (let ((methods
(append
(if (gnus-check-server gnus-select-method)
;; The native server is available.
groups info)
(while (setq info (pop newsrc))
(when (gnus-server-equal
- (gnus-find-method-for-group
+ (gnus-find-method-for-group
(gnus-info-group info) info)
gmethod)
(push (gnus-group-real-name (gnus-info-group info))
;; (concat (regexp-quote "^to\\.") "\\($\\|" (regexp-quote "\\|") "\\)")
(string-match "\\^to\\\\\\.\\($\\|\\\\|\\)"
gnus-ignored-newsgroups))
-
+
;; Read an active file and place the results in `gnus-active-hashtb'.
(defun gnus-active-to-gnus-format (&optional method hashtb ignore-errors)
(unless method
(gnus-newsrc-to-gnus-format)
(kill-buffer (current-buffer))
(gnus-message 5 "Reading %s...done" newsrc-file)))
-
+
;; Convert old to new.
(gnus-convert-old-newsrc))))
(condition-case nil
(load ding-file t t t)
(error
- (gnus-error 1 "Error in %s" ding-file)))
+ (ding)
+ (unless (gnus-yes-or-no-p
+ (format "Error in %s; continue? " ding-file))
+ (error "Error in %s" ding-file))))
(when gnus-newsrc-assoc
(setq gnus-newsrc-alist gnus-newsrc-assoc)))
(gnus-make-hashtable-from-newsrc-alist)
(unless (nthcdr 3 info)
(nconc info (list nil)))
(gnus-info-set-marks
- info (list (cons 'tick (gnus-compress-sequence
+ info (list (cons 'tick (gnus-compress-sequence
(sort (cdr m) '<) t))))))
(setq newsrc killed)
(while newsrc
(point)))))
(forward-line -1))
(symbol
- ;; Group names can be just numbers.
+ ;; Group names can be just numbers.
(when (numberp symbol)
(setq symbol (intern (int-to-string symbol) gnus-active-hashtb)))
(unless (boundp symbol)
;;;
(defun gnus-read-all-descriptions-files ()
- (let ((methods (cons gnus-select-method
+ (let ((methods (cons gnus-select-method
(nconc
(when (gnus-archive-server-wanted-p)
(list "archive"))
(defun gnus-set-default-directory ()
"Set the default directory in the current buffer to `gnus-default-directory'.
If this variable is nil, don't do anything."
- (setq default-directory
+ (setq default-directory
(if (and gnus-default-directory
(file-exists-p gnus-default-directory))
(file-name-as-directory (expand-file-name gnus-default-directory))