(let ((b (search-forward "\n@@BEGIN NCM BODY\n" nil t))
(e (search-forward "\n@@END NCM BODY\n" nil t))
(buf (current-buffer))
- ncm id)
+ ncm id group)
(when (and b e)
(narrow-to-region b (1+ (match-beginning 0)))
(goto-char (point-min))
(while (search-forward "\t" nil t)
- (when (condition-case nil
- (boundp (let ((obarray gnus-active-hashtb)) (read buf)))
- (error nil))
- (beginning-of-line)
- (while (= (following-char) ?\t)
- (forward-line -1))
- (setq id (buffer-substring (point) (1- (search-forward "\t"))))
- (push id ncm)
- (gnus-sethash id t gnus-nocem-hashtb)
- (forward-line 1)
- (while (= (following-char) ?\t)
- (forward-line 1))))
+ (condition-case nil
+ (setq group (let ((obarray gnus-active-hashtb)) (read buf)))
+ (error nil))
+ (if (not (boundp group))
+ ;; Make sure all entries in the hashtb are bound.
+ (set group nil)
+ (when (gnus-gethash (symbol-name group) gnus-newsrc-hashtb)
+ ;; Valid group.
+ (beginning-of-line)
+ (while (= (following-char) ?\t)
+ (forward-line -1))
+ (setq id (buffer-substring (point) (1- (search-forward "\t"))))
+ (push id ncm)
+ (gnus-sethash id t gnus-nocem-hashtb)
+ (forward-line 1)
+ (while (= (following-char) ?\t)
+ (forward-line 1)))))
(when ncm
(setq gnus-nocem-touched-alist t)
(push (cons (let ((time (current-time))) (setcdr (cdr time) nil) time)