[Top][All Lists]

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

Re: message-toggle-gcc

From: Joe Casadonte
Subject: Re: message-toggle-gcc
Date: Tue, 24 Aug 2004 13:50:23 -0400
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (windows-nt)

On Mon, 23 Aug 2004, Joe Casadonte wrote:

> On Sat, 14 Aug 2004, Emilio Lopes wrote:
>> Despite its name, it also needs Gnus.  I bind it to "C-c C-f C-g"
>> in `message-mode-map'.
> Great idea, Emilio!
> Here's a variation that:
> a) does not require gnus
> b) stores the previous value to be restored later

Tweaked a little to handle empty GCC fields (can now add it if it
didn't exist previously):

 (defvar message-save-gcc nil
   "Stores current value of GCC header - used with `message-toggle-gcc'."))

(defun message-toggle-gcc ()
  "Insert or remove the \"Gcc\" header.

Uses buffer-local variable `message-save-gcc' to store current Gcc:
value before removing it."
        (let (gcc)
                (setq gcc (mail-fetch-field "Gcc")))
          (if gcc
                        (setq message-save-gcc gcc)
                        (message-remove-header "Gcc"))
                (message-position-on-field "Gcc" "Subject")
                (insert (or message-save-gcc "")))


Joe Casadonte

         Llama Fresh Farms =>
   Gay Media Resource List =>
            Perl for Win32 =>
               Emacs Stuff =>
          Music CD Trading =>
                       Live Free, that's the message!

reply via email to

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