[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: Mon, 23 Aug 2004 11:29:00 -0400
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (windows-nt)

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

 (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 (message-fetch-field "Gcc")))
          (if gcc
                        (setq message-save-gcc gcc)
                        (message-remove-header "Gcc"))
                (message-position-on-field "Gcc" "Subject")
                (insert message-save-gcc))

Tested briefly -- seems to work!


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]