;;; -*- lexical-binding: t -*- ;; ;; this file: ;; https://dataswamp.org/~incal/emacs-init/gnus/message-header.el (require 'message) (require 'moggle) (setq mail-header-separator "---") (setq message-default-headers "Mail-Copies-To: never") (setq message-default-mail-headers "Newsgroups: ") (setq message-default-news-headers "To: ") (setq message-subject-trailing-was-query nil) (setq message-hidden-headers '("^Face" "^Mail-Copies-To" "^References" "^X-Draft-From" "^X-Face") ) (defun remove-empty-headers () (flush-lines "^.+: $" (point-min) (get-header-separator-pos)) ) (defun message-yank-subject () (interactive) (save-excursion (let ((subj (message-fetch-field "Subject"))) (when subj (message-goto-body) (insert (format "%s\n" subj)) )))) (defun message-transpose-headers (hdr1 hdr2) (interactive "sheader 1: \nsheader 2: ") (save-excursion (let ((v1 (or (message-fetch-field hdr1) "")) (v2 (or (message-fetch-field hdr2) "")) ) (message-replace-header hdr1 v2 hdr1 t) (message-replace-header hdr2 v1 hdr2 t)) )) (provide 'message-header)