the end of an article.
If nil, the marking commands do NOT go to the next unread article
-(they go to the next article instead). If `never', commands that
+\(they go to the next article instead). If `never', commands that
usually go to the next unread article, will go to the next article,
whether it is read or not."
:group 'gnus-summary-marks
. gnus-summary-low-ancient-face)
((eq mark gnus-ancient-mark)
. gnus-summary-normal-ancient-face)
+ (downloaded
+ . gnus-agent-downloaded-article-face)
((and (> score default-high) (eq mark gnus-unread-mark))
. gnus-summary-high-unread-face)
((and (< score default-low) (eq mark gnus-unread-mark))
"f" gnus-article-display-x-face
"l" gnus-summary-stop-page-breaking
"r" gnus-summary-caesar-message
+ "m" gnus-summary-morse-message
"t" gnus-summary-toggle-header
"g" gnus-treat-smiley
"v" gnus-summary-verbose-headers
["Rot 13" gnus-summary-caesar-message
,@(if (featurep 'xemacs) '(t)
'(:help "\"Caesar rotate\" article by 13"))]
+ ["Morse decode" gnus-summary-morse-message t]
["Unix pipe..." gnus-summary-pipe-message t]
["Add buttons" gnus-article-add-buttons t]
["Add buttons to head" gnus-article-add-buttons-to-head t]
marks of articles."
`(cond
((memq ,number gnus-newsgroup-unsendable) gnus-unsendable-mark)
- ((memq ,number gnus-newsgroup-undownloaded) gnus-undownloaded-mark)
+;;;; ((memq ,number gnus-newsgroup-undownloaded) gnus-undownloaded-mark)
((memq ,number gnus-newsgroup-downloadable) gnus-downloadable-mark)
((memq ,number gnus-newsgroup-unreads) gnus-unread-mark)
((memq ,number gnus-newsgroup-marked) gnus-ticked-mark)
;; Adjust and set lists of article marks.
(when info
(gnus-adjust-marked-articles info))
-
(if (setq articles select-articles)
(setq gnus-newsgroup-unselected
(gnus-sorted-difference gnus-newsgroup-unreads articles))
(gnus-make-hashtable (length articles)))
(gnus-set-global-variables)
;; Retrieve the headers and read them in.
+
(setq gnus-newsgroup-headers (gnus-fetch-headers articles))
;; Kludge to avoid having cached articles nixed out in virtual groups.
(message-caesar-buffer-body arg)
(set-window-start (get-buffer-window (current-buffer)) start))))))
+(autoload 'unmorse-region "morse"
+ "Convert morse coded text in region to ordinary ASCII text."
+ t)
+
+(defun gnus-summary-morse-message (&optional arg)
+ "Morse decode the current article."
+ (interactive "P")
+ (gnus-summary-select-article)
+ (let ((mail-header-separator ""))
+ (gnus-eval-in-buffer-window gnus-article-buffer
+ (save-excursion
+ (save-restriction
+ (widen)
+ (let ((pos (window-start))
+ buffer-read-only)
+ (goto-char (point-min))
+ (when (message-goto-body)
+ (gnus-narrow-to-body))
+ (goto-char (point-min))
+ (while (re-search-forward "ยท" (point-max) t)
+ (replace-match "."))
+ (unmorse-region (point-min) (point-max))
+ (widen)
+ (set-window-start (get-buffer-window (current-buffer)) pos)))))))
+
(defun gnus-summary-stop-page-breaking ()
"Stop page breaking in the current article."
(interactive)
(setq gnus-newsgroup-selected-overlay (gnus-make-overlay from to))
'face gnus-summary-selected-face))))))
+(defvar gnus-summary-highlight-line-cached nil)
+(defvar gnus-summary-highlight-line-trigger nil)
+(defun gnus-summary-highlight-line-0 ()
+ (if (and (eq gnus-summary-highlight-line-trigger
+ gnus-summary-highlight)
+ gnus-summary-highlight-line-cached)
+ gnus-summary-highlight-line-cached
+ (setq gnus-summary-highlight-line-trigger gnus-summary-highlight
+ gnus-summary-highlight-line-cached
+ (let* ((cond (list 'cond))
+ (c cond)
+ (list gnus-summary-highlight))
+ (while list
+ (setcdr c (cons (list (caar list) (list 'quote (cdar list))) nil))
+ (setq c (cdr c)
+ list (cdr list)))
+ (gnus-byte-compile (list 'lambda nil cond))))))
+
+(defvar gnus-summary-highlight-line-downloaded-alist nil)
+(defvar gnus-summary-highlight-line-downloaded-cached nil)
+
;; New implementation by Christian Limpach <Christian.Limpach@nice.ch>.
(defun gnus-summary-highlight-line ()
"Highlight current line according to `gnus-summary-highlight'."
(inhibit-read-only t)
(default gnus-summary-default-score)
(default-high gnus-summary-default-high-score)
- (default-low gnus-summary-default-low-score))
- ;; Eval the cars of the lists until we find a match.
- (while (and list
- (not (eval (caar list))))
- (setq list (cdr list)))
- (let ((face (cdar list)))
+ (default-low gnus-summary-default-low-score)
+ (downloaded (and (boundp 'gnus-agent-article-alist)
+ gnus-agent-article-alist
+ ;; Optimized for when gnus-summary-highlight-line is called multiple times for articles in ascending order (i.e. initial generation of summary buffer).
+ (progn
+ (if (and (eq gnus-summary-highlight-line-downloaded-alist gnus-agent-article-alist)
+ (<= (caar gnus-summary-highlight-line-downloaded-cached) article))
+ nil
+ (setq gnus-summary-highlight-line-downloaded-alist gnus-agent-article-alist
+ gnus-summary-highlight-line-downloaded-cached gnus-agent-article-alist))
+ (let (n)
+ (while (and (< (caar gnus-summary-highlight-line-downloaded-cached) article)
+ (setq n (cdr gnus-summary-highlight-line-downloaded-cached)))
+ (setq gnus-summary-highlight-line-downloaded-cached n)))
+ (and (eq (caar gnus-summary-highlight-line-downloaded-cached) article)
+ (cdar gnus-summary-highlight-line-downloaded-cached))))))
+ (let ((face (funcall (gnus-summary-highlight-line-0))))
(unless (eq face (get-text-property beg 'face))
(gnus-put-text-property-excluding-characters-with-faces
beg (gnus-point-at-eol) 'face
(let ((old (sort (mapcar 'car gnus-newsgroup-data) '<))
older len)
(setq older
- (gnus-sorted-difference
- (gnus-uncompress-range (list gnus-newsgroup-active))
- old))
- (setq len (length older))
+;;; Some nntp servers lie about their active range. When this happens, the active range can be in the millions.
+;;; (gnus-sorted-difference
+;;; (gnus-uncompress-range (list gnus-newsgroup-active))
+;;; old)
+ (gnus-uncompress-range
+ (gnus-remove-from-range (list gnus-newsgroup-active) old))
+)
+ (setq len (gnus-range-length older))
(cond
((null older) nil)
((numberp all)
(if (< all len)
- (setq older (last older all))))
+ (let ((older-range (nreverse older)))
+ (setq older nil)
+
+ (while (> all 0)
+ (let* ((r (pop older-range))
+ (min (if (numberp r) r (car r)))
+ (max (if (numberp r) r (cdr r))))
+ (while (and (<= min max)
+ (> all 0))
+ (push max older)
+ (setq all (1- all)
+ max (1- max))))))
+ (setq older (gnus-uncompress-range older))))
(all nil)
(t
(if (and (numberp gnus-large-newsgroup)
(unless (string-match "^[ \t]*$" input)
(setq all (string-to-number input))
(if (< all len)
- (setq older (last older all))))))))
+ (let ((older-range (nreverse older)))
+ (setq older nil)
+
+ (while (> all 0)
+ (let* ((r (pop older-range))
+ (min (if (numberp r) r (car r)))
+ (max (if (numberp r) r (cdr r))))
+ (while (and (<= min max)
+ (> all 0))
+ (push max older)
+ (setq all (1- all)
+ max (1- max))))))
+ (setq older (gnus-uncompress-range older))))))))
(if (not older)
(message "No old news.")
(gnus-summary-insert-articles older)