info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: keybindings for changing mail addreasses


From: Reiner Steib
Subject: Re: keybindings for changing mail addreasses
Date: Sat, 21 Aug 2004 13:06:29 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux)

On Sat, Aug 21 2004, Andrey Slusar wrote:

> if i using gnus-postings-styles, then followup/reply is used one my
> custom headers. I am wanted for:
>
> If i am pressing key F(quote followup)/R(quote reply) and 1 F/1 R, used
> posting style for this group, if i am pressing 2 F/2 R, for this group
> using 2 customing headers.

This is not feasible as the prefix argument for `F'/`R' already has a
different meaning.

With the code below [1], you can change From and Reply-To using `C-c a
1' or `C-c a 2' while composing a message.

If you use BBDB and you can cycle thru different addresses by using
`bbdb-complete-name' (usually bound to `TAB' in message headers):

,----[ C-h v bbdb-complete-name-allow-cycling RET ]
| bbdb-complete-name-allow-cycling's value is t
| 
| Whether to allow cycling of email addresses when calling
| `bbdb-complete-name' on a completed address in a composition buffer.
`----

Bye, Reiner.

[1]
--8<---------------cut here---------------start------------->8---
(defun rs-message-replace-header (header new-value)
  "Remove HEADER and insert the NEW-VALUE."
  ;; Similar to `nnheader-replace-header' but for message buffers.
  (save-excursion
    (save-restriction
      (message-narrow-to-headers)
      (message-remove-header header))
    (message-position-on-field header)
    (insert new-value)))

(defun rs-message-change-address (from reply-to)
  "Change FROM and REPLY-TO."
  (interactive)
  (rs-message-replace-header "Reply-To"
                             (format "%s (%s)" reply-to user-full-name))
  (rs-message-replace-header "From"
                             (format "%s (%s)" from user-full-name)))

(define-key message-mode-map (kbd "C-c a 1")
  (lambda ()
    (interactive)
    (rs-message-change-address "myfrom-1@invalid" "replyto-1@invalid")))
(define-key message-mode-map (kbd "C-c a 2")
  (lambda ()
    (interactive)
    (rs-message-change-address "myfrom-2@invalid" "replyto-2@invalid")))
--8<---------------cut here---------------end--------------->8---
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]