[gnu.emacs.gnus] Re: keybindings for changing mail addreasses
Andrey Slusar <[email protected]>
| Newsgroups | gmane.emacs.xemacs.user.russian |
|---|---|
| Organization | Santinel |
| Message-ID | <[email protected]> |
-------------------- Start of forwarded message -------------------- Newsgroups: gnu.emacs.gnus Subject: Re: keybindings for changing mail addreasses From: Reiner Steib <[email protected]> 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/ -------------------- End of forwarded message -------------------- Hi, вот и решение, кому это интересно :) --anray