;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/gnus/summary.el (require 'dwim) (require 'gnus-msg) (require 'gnus-score) (require 'gnus-sum) (require 'group-summary) (require 'mode-line) (require 'scroll) (require 'super) (setq gnus-auto-select-first t) (setq gnus-confirm-mail-reply-to-news nil) (setq gnus-ignored-from-addresses user-mail-address) (setq gnus-summary-line-format "%*%U%3{%R%} %I%0{%f%} %4{%s%}\n") (setq gnus-summary-mode-line-format "%G") (setq gnus-summary-thread-gathering-function #'gnus-gather-threads-by-references) (defun gnus-summary-respool-all (&optional beg end) (interactive (use-region)) (or beg (setq beg (point-min))) (or end (setq end (point-max))) (let ((lines (count-lines beg end)) (method (gnus-find-method-for-group "nnml:mail.misc")) ) (goto-char beg) (gnus-summary-respool-article lines method) )) (defun gnus-summary-insert-all (&rest _) (gnus-summary-insert-old-articles t) ) (advice-add #'gnus-summary-limit-to-subject :before #'gnus-summary-insert-all) (advice-add #'gnus-summary-limit-to-author :before #'gnus-summary-insert-all) ;; (advice-remove #'gnus-summary-limit-to-subject #'gnus-summary-insert-all) ;; (advice-remove #'gnus-summary-limit-to-author #'gnus-summary-insert-all) (defun gnus-summary-exit-and-update-group () (interactive) (kill-buffer) (gnus-summary-save-newsrc) (gnus-switch-to-group-buffer) ) (defun gnus-summary-mark (mark beg end) (interactive (let ((m (read-char "mark: "))) (if (use-region-p) (list m (region-beginning) (region-end)) (let*((bg (point)) (ed (1+ bg)) ) (list m bg ed) )))) (goto-char beg) (beginning-of-line) (while (< (point) end) (gnus-summary-mark-article (gnus-summary-article-number) mark) (gnus-summary-find-next) )) ;; (setq gnus-summary-prepared-hook nil) (defun gnus-summary-prepared-hook-f () (goto-char (point-max)) (forward-line -1) ) (setq gnus-summary-prepared-hook #'gnus-summary-prepared-hook-f) (defun gnus-summary-set-keys () (let ((kmap gnus-summary-mode-map)) (disable-super-global-keys kmap) (set-vertical-keys kmap) ;; group (keymap-set kmap "o" #'gnus-summary-insert-old-articles) (keymap-set kmap "w" #'gnus-summary-exit-and-update-group) ;; reply (keymap-set kmap "r" #'gnus-summary-followup-with-original) (keymap-set kmap "R" #'gnus-summary-reply-with-original) ;; message (keymap-set kmap "f" #'gnus-article-fill-cited-article) (keymap-set kmap "F" (lambda () (interactive) (gnus-summary-mail-forward 4))) (keymap-set kmap "z" #'gnus-score-edit-current-scores) (keymap-set kmap "RET" #'gnus-summary-show-article) ;; mark (keymap-set kmap "l" #'gnus-summary-put-mark-as-unread-next) (keymap-set kmap "s" #'gnus-summary-mark-as-read-forward) )) (defun gnus-summary-mode-hook-f () (lines) (gnus-summary-set-keys) ) (add-hook 'gnus-summary-mode-hook #'gnus-summary-mode-hook-f) (provide 'summary)