From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/60932 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Posting styles override message-alternative-emails Date: Sat, 10 Sep 2005 13:36:41 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1126355276 14866 80.91.229.2 (10 Sep 2005 12:27:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 10 Sep 2005 12:27:56 +0000 (UTC) Original-X-From: ding-owner+m9464@lists.math.uh.edu Sat Sep 10 14:27:55 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EE4Rq-00006O-RD for ding-account@gmane.org; Sat, 10 Sep 2005 14:27:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EE4Rh-0007Le-00; Sat, 10 Sep 2005 07:27:01 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EE4My-0007LZ-00 for ding@lists.math.uh.edu; Sat, 10 Sep 2005 07:22:08 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1EE4Ms-0005hq-0V for ding@lists.math.uh.edu; Sat, 10 Sep 2005 07:22:08 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EE4Mq-0007Mg-00 for ; Sat, 10 Sep 2005 14:22:00 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EE4MA-00076q-90 for ding@gnus.org; Sat, 10 Sep 2005 14:21:18 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de ([134.60.10.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Sep 2005 14:21:18 +0200 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 10 Sep 2005 14:21:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 111 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: 3Phac&+dw=IZHjhua]bp}LH<*p{qzj8u+" the function `message-setup-1' inserts... | From: reinersteib+gmane@imap.cc But after this, `message-mode-hook' (?) modified by `gnus-msg.el' unconditionally replaces the From with the value from `gnus-posting-styles': | From: Reiner Steib Suggestions: (1a) It should be documented that posting styles overwrite values from `message-alternative-emails'. *or* (1b) Posting styles should *not* overwrite the From if it was derived from `message-alternative-emails'. I'd clearly prefer (1b). (2) `message-alternative-emails' should also use `user-full-name'. The feature to use "To" or "Cc" as "From" has often been requested (at least in the German Gnus newsgroup). Unaware of `message-alternative-emails', I used this code[3] based on posting styles upto now. Bye, Reiner. [1] (info "(gnus)Posting Styles") [2] ,----[ (info "(message)Message Headers") ] | `message-alternative-emails' | A regexp to match the alternative email addresses. The first | matched address (not primary one) is used in the `From' field. `---- [3] --8<---------------cut here---------------start------------->8--- (defvar rs-message-to-from-addresses gnus-ignored-from-addresses "Regexp matching To headers. When using entries like ((message-mail-p) (address (rs-message-to-from-address))) or ((message-mail-p) (address (rs-message-to-from-address \"foo@example.invalid\"))) in `gnus-posting-styles', the address in the From header is taken from the To header of the article you are replying to.") ;;;###autoload (defun rs-message-to-from-address (&optional fallback) "Return a suitable address. See `rs-message-to-from-addresses' for more." (let ((to (and (boundp 'gnus-article-buffer) (gnus-buffer-live-p gnus-article-buffer) ;; `gnus-buffer-live-p' already returns ;; `gnus-article-buffer', but it's not documented. So ;; let's be careful. gnus-article-buffer (with-current-buffer gnus-article-buffer (message-fetch-field "to"))))) (cond ((and to (not (string-match "," to));; FIXME (string-match rs-message-to-from-addresses to)) (let ((from (cadr (mail-extract-address-components to)))) ;; gnus-extract-address-components fails for Outlook stuff: ;; To: "'reiner.steib@...'" (if (and (string-match rs-message-to-from-addresses from) (string-match (concat "^" (if (boundp 'gnus-button-valid-localpart-regexp) gnus-button-valid-localpart-regexp "[a-z0-9-_+.]+") "@" message-valid-fqdn-regexp "$") from)) from (if (y-or-n-p (format "Address <%s> might be bogus. Use anyway? " from)) from)))) (fallback fallback) (t user-mail-address)))) --8<---------------cut here---------------end--------------->8--- -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/