From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: mail-add-attachment Date: Fri, 09 Sep 2011 10:32:19 -0400 Message-ID: References: <838vq60wm6.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1315578753 21401 80.91.229.12 (9 Sep 2011 14:32:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Sep 2011 14:32:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 09 16:32:29 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R2284-00088X-7L for ged-emacs-devel@m.gmane.org; Fri, 09 Sep 2011 16:32:28 +0200 Original-Received: from localhost ([::1]:38100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R2282-0004jr-VN for ged-emacs-devel@m.gmane.org; Fri, 09 Sep 2011 10:32:26 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:37512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R227z-0004jl-Un for emacs-devel@gnu.org; Fri, 09 Sep 2011 10:32:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R227y-0001pt-Qu for emacs-devel@gnu.org; Fri, 09 Sep 2011 10:32:23 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3578 helo=ironport2-out.pppoe.ca) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R227x-0001pW-7c; Fri, 09 Sep 2011 10:32:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAIoiak64rwMJ/2dsb2JhbABBqA55gVIBAQQBViMFCws0EhQYDSSICbdPhm4EoC2EQQ X-IronPort-AV: E=Sophos;i="4.68,356,1312171200"; d="scan'208";a="135329145" Original-Received: from 184-175-3-9.dsl.teksavvy.com (HELO pastel.home) ([184.175.3.9]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 09 Sep 2011 10:32:19 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 817A64E039; Fri, 9 Sep 2011 10:32:19 -0400 (EDT) In-Reply-To: <838vq60wm6.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 03 Sep 2011 13:05:21 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:143826 Archived-At: > Is it okay to install this command at this time? I know we're in a > feature freeze, but the new command is actually a very thin wrapper > around code we already use elsewhere (gnus-dired.el and mml.el). The > result will be that users of sendmail.el will be able to send MIME > attachments. Here's the patch: I guess it could be OK. I have a few comments, tho: > +(autoload 'mml-attach-file "mml" > + "Attach a file to the outgoing MIME message. > +The file is not inserted or encoded until you send the message with > +`\\[message-send-and-exit]' or `\\[message-send]'. > + > +FILE is the name of the file to attach. TYPE is its > +content-type, a string of the form \"type/subtype\". DESCRIPTION > +is a one-line description of the attachment. The DISPOSITION > +specifies how the attachment is intended to be displayed. It can > +be either \"inline\" (displayed automatically within the message > +body) or \"attachment\" (separate from the body).") > + > +(autoload 'mm-default-file-encoding "mm-encode" > + "Return the default encoding for FILE.") I must say I don't like such manually-managed autoloads. I'd rather use a declare-function plus an explicit require call. My favorite would be to use a new require-autoload construct which the byte-compiler would replace by autoloads of the functions actually called (so the byte-compiler would manage the list of autoloads rather than doing it by hand). > +\\[mail-attach-file] insert a text file into the message. > +\\[mail-add-attachment] add to the message a file as a MIME attachment. I think mail-attach-file needs to be renamed to mail-insert-file. Stefan