view emacs/my-news.el @ 3:870e13483642

sum outputs from multiple uniq -c, maybe?
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Tue, 25 May 2021 14:00:47 -0400
parents f005daf4488a
children
line wrap: on
line source

(load "gnus" nil t)
(setq       gnus-nntp-server nil		; override local default
      )

;(gnus-server-deny-server "nntp:news")	; no news is good news :-)
(setq 	gnus-use-scoring nil		; not used yet
	gnus-summary-gather-subject-limit nil
	gnus-thread-sort-functions
	'(gnus-thread-sort-by-number gnus-thread-sort-by-simpl-subject)
	gnus-article-sort-functions
	'(gnus-article-sort-by-number
	  gnus-article-sort-by-subject)
	gnus-summary-line-format "%U%R%5N%I%(%[%4L: %-12,12A%]%) %s\n"
	gnus-summary-make-false-root 'none
	gnus-simplify-subject-regexp "^\\(re[:;.]\\| \\|fwd:\\)*")

(defsubst gnus-trim-simplify-subject (text)
  (if (string-match gnus-simplify-subject-regexp text)
      (substring text (match-end 0))
    text))

(defun gnus-thread-sort-by-simpl-subject (h1 h2)
  "sort by slightly simplified subject"
;  (message (format "%s:%s %s:%s" (mail-header-number (gnus-thread-header h1))(mail-header-subject (gnus-thread-header h1))(mail-header-number (gnus-thread-header h2))(mail-header-subject (gnus-thread-header h2))))
  (let ((case-fold-search t))
    (let ((result
    (string-lessp
     (downcase (gnus-trim-simplify-subject (mail-header-subject
					    (gnus-thread-header h1))))
     (downcase (gnus-trim-simplify-subject (mail-header-subject
					    (gnus-thread-header h2)))))))
;      (message (format " %s\n" result))
      result)))

(defun mark-and-mark (n)
  (interactive "p")
  (while (>= n 1)
    (gnus-summary-mark-as-read)
    (gnus-summary-mark-as-processable 1)
    (setq n (- n 1))))

(provide 'my-news)