help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Q: prevent Emacs from sending mail with no subject


From: Kin Cho
Subject: Re: Q: prevent Emacs from sending mail with no subject
Date: 23 Dec 2003 09:26:39 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Try this bit of elisp:

(defadvice mail-send (before check-for-null-subject activate)
  (or (mail-subject) (error "No subject!"))
  (or (string-match "^.+?:[ \t]*[^ \t]+"
                    (buffer-substring-no-properties
                     (progn (beginning-of-line) (point))
                     (progn (end-of-line) (point))))
      (error "No subject!")))

-kin

address@hidden (Eric Pement) writes:

> I would like to know how to prevent Emacs from sending email with no
> subject (or with a subject line that contains only whitespace). I've
> accidentally sent a couple of messages this way, and I think Emacs
> converted the subject line to "(unknown)" for me, but I'm not sure. At
> any rate, I want Emacs to not send the message if the subject line is
> empty, but to prompt me to enter the missing subject.
> 
> I've already checked the FAQ, the Customization menu, "Learning GNU
> Emacs" and searched the Google archives for this issue, but I can't
> seem to find the answer. Any help would be appreciated.
> 
> -- 
> Eric Pement


reply via email to

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