Post by Clemens SchüllerPost by Wolfgang BauerServus.
Meine .gnus.el ist mit den Jahren gewachsen und angepaßt worden.
Ein Abschnitt ist noch von Sani Schulz.
;; einleitungszeile
(defun my-citation-line ()
(when message-reply-headers
(insert
(or (my-replace-name (car (gnus-extract-address-components
(mail-header-from message-reply-headers))))
"Namenlos")
" schrieb:\n\n")))
Wann würde das denn greifen?
Gruß
Wolfgang
Kommt mir bekannt vor — erinnerlich dann, wenn Du eine
Reply an einen Vorposter ohne Vor- UND Zunamen verfasst.
Aber: Ich kenn das nur mit der Einleitungszeile „ein Realnamenloser
schrieb“
Da scheint also noch was zu fehlen.
Nachtrag — da hat wirklich was gefehlt:
Hier der komplette Code
;; ;; Matthias Wiehl in <***@fulmine.dhs.org>
(defun my-citation-format-date-string (date)
"Convert a Date header value to `dd.mm.yyyy' format."
(let ((time (date-to-time date)))
(format-time-string "%d. %b. %Y um %H:%M" time)))
;; ;; better use gnus-extract-address-components?
(defun my-citation-extract-sender-name (from)
"Extract the sender's name from FROM."
;; ;; We use `mail-extract-address-components' from the mail-lib
;; ;; package to fetch the sender's name.
(let ((names (mail-extract-address-components from)))
(if names
;; If `mail-extr-ignore-single-names' is set to t, (car names)
;; will be nil if the sender of the message you're responding
;; to didn't provide a full name. In that case, the second
;; string will be returned.
(or (car names)
(if (message-news-p)
"Ein Realnamenloser"
nil)))))
(defun my-insert-citation-line ()
"Insert a citation line that includes the original article's date."
(when message-reply-headers
(let ((from (my-citation-extract-sender-name
(mail-header-from message-reply-headers)))
(date (my-citation-format-date-string
(mail-header-date message-reply-headers)))
(groups (message-fetch-reply-field "newsgroups")))
;; In mail messages, we want to use a somewhat personal
;; introduction.
(if (message-mail-p)
;; (insert "Hallo"
;; ;; Insert the name of the person you're replying to.
;; (if from
;; (concat " " from)
;; "")
;; ",\n\n" "am " date " schriebst Du"
(insert "Servus!" "\n\n"
"Am " date " schrieb" (concat " " from)""
;; Include the name of the newsgroup which the
;; original message was posted to.
(if groups
(progn
;; Shorten `groups' if necessary.
(if (string-match "\\(,\\)" groups)
(setq groups
(concat
(substring groups 0 (match-beginning 0))
" et al.")))
(concat " in " groups))
"")
":\n\n")
;; This is for news messages.
(insert "Servus!\n\n" from " schrieb am " date ":\n\n")))))
(setq mail-extr-ignore-single-names t)
(setq message-citation-line-function 'my-insert-citation-line)
--
Beste Grüße, Clemens Schüller