From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Mail mode and message mode hooks Date: Sun, 06 Dec 2009 18:52:22 -0500 Message-ID: <87tyw3fyo9.fsf@stupidchicken.com> References: <871vjfwi6a.fsf@stupidchicken.com> <87skbqm6q3.fsf@stupidchicken.com> <15483.128.165.0.81.1260038051.squirrel@webmail.lanl.gov> <87ljhfk8bp.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1260143597 3274 80.91.229.12 (6 Dec 2009 23:53:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Dec 2009 23:53:17 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 07 00:53:10 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NHQuR-0007U6-0G for ged-emacs-devel@m.gmane.org; Mon, 07 Dec 2009 00:53:08 +0100 Original-Received: from localhost ([127.0.0.1]:39355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHQuP-00041U-A4 for ged-emacs-devel@m.gmane.org; Sun, 06 Dec 2009 18:52:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHQu3-0003uH-Kr for emacs-devel@gnu.org; Sun, 06 Dec 2009 18:52:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHQtz-0003sS-58 for emacs-devel@gnu.org; Sun, 06 Dec 2009 18:52:35 -0500 Original-Received: from [199.232.76.173] (port=59163 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHQty-0003sN-Rm for emacs-devel@gnu.org; Sun, 06 Dec 2009 18:52:30 -0500 Original-Received: from pantheon-po42.its.yale.edu ([130.132.50.101]:33288) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NHQty-0006M7-FY for emacs-devel@gnu.org; Sun, 06 Dec 2009 18:52:30 -0500 Original-Received: from furry (adsl-99-58-202-243.dsl.wlfrct.sbcglobal.net [99.58.202.243]) (authenticated bits=0) by pantheon-po42.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id nB6NqM0q032112 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 6 Dec 2009 18:52:22 -0500 Original-Received: by furry (Postfix, from userid 1000) id 4E88DC071; Sun, 6 Dec 2009 18:52:22 -0500 (EST) In-Reply-To: <87ljhfk8bp.fsf@stupidchicken.com> (Chong Yidong's message of "Sun, 06 Dec 2009 18:10:18 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:118352 Archived-At: Chong Yidong writes: > Another idea I had is to change compose-mail to check for hook > duplication, and pop up a warning window telling the user that the > default mail-user-agent has changed. To flesh out this idea a bit more, here is a patch that implements it. Opinions? *** emacs/lisp/simple.el.~1.1035.~ 2009-12-06 13:48:05.000000000 -0500 --- emacs/lisp/simple.el 2009-12-06 18:48:37.000000000 -0500 *************** *** 5558,5563 **** --- 5558,5572 ---- :version "23.2" ; sendmail->message :group 'mail) + (defcustom compose-mail-user-agent-warnings t + "If non-nil, `compose-mail' warns about changes in `mail-user-agent'. + If the value of `mail-user-agent' is the default, and the user + appears to have customizations applying to the old default, + `compose-mail' issues a warning." + :type 'boolean + :version "23.2" + :group 'mail) + (define-mail-user-agent 'sendmail-user-agent 'sendmail-user-agent-compose 'mail-send-and-exit) *************** *** 5627,5632 **** --- 5636,5667 ---- Each action has the form (FUNCTION . ARGS)." (interactive (list nil nil nil current-prefix-arg)) + + ;; In Emacs 23.2, the default value of `mail-user-agent' changed + ;; from sendmail-user-agent to message-user-agent. Some users may + ;; encounter incompatibilities. This hack tries to detect problems + ;; and warn about them. + (and compose-mail-user-agent-warnings + (eq mail-user-agent 'message-user-agent) + (let (warn-vars) + (dolist (var '(mail-send-hook mail-setup-hook mail-yank-hooks + mail-citation-hook mail-mode-hook + mail-default-reply-to mail-archive-file-name + mail-self-blind mail-mailing-lists)) + (and (boundp var) + (symbol-value var) + (push var warn-vars))) + (when warn-vars + (display-warning 'mail + (format "\ + The default mail mode is now Message mode. + You have the following Mail mode variable%s customized: + \n%s\n\nTo use Mail mode, set `mail-user-agent' to sendmail-user-agent. + To disable this warning, set `compose-mail-check-user-agent' to nil." + (if (> (length warn-vars) 1) "s" "") + (mapconcat 'symbol-name + warn-vars " ")))))) + (let ((function (get mail-user-agent 'composefunc))) (funcall function to subject other-headers continue switch-function yank-action send-actions)))