all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: mail-add-attachment
Date: Fri, 09 Sep 2011 17:49:44 -0400	[thread overview]
Message-ID: <jwvy5xxfky5.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <837h5h69lf.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Sep 2011 18:04:12 +0300")

> Andreas suggested to add autoload cookies to the corresponding Gnus
> files, but I see that both mml.el and mm-encode.el are entirely devoid
> of such cookies, so I guess there are some Gnus coding standards
> involved, which I don't want to break.

I don't have an opinion on whether autoload cookies should be placed in
those files.

>> I'd rather use a declare-function plus an explicit require call.
> You mean, require in the function body, like below?

>     (defun mail-add-attachment (file)
>       "Add FILE as a MIME attachment to the end of the message."
>       (interactive "fAttach file: ")
>>>>> (require 'mml)
>>>>> (require 'mm-encode)
>       (mml-attach-file file
> 		       (or (mm-default-file-encoding file)
> 			   "application/octet-stream") nil)
>       (setq mail-encode-mml t))

Yes.  It's not great, but it's better than manually managed autoload
cookies (which fail to include the (fn ARG1 AG2) calling
convention info, and are likely to get out of date).

>> 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).
> I'll leave that project to you ;-)

Damn!

>> > +\\[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.
> I thought about this, but isn't it too late to introduce incompatible
> changes on the user level?  This command is there by that name since
> 1997.  I would at most go with a new name and an alias that is
> deprecated.

Of course we'd keep an osolete alias.  But since we're making changes
anyway, I'd rather add that extra change to your patch.


        Stefan



  parent reply	other threads:[~2011-09-09 21:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-03 10:05 mail-add-attachment Eli Zaretskii
2011-09-03 10:33 ` mail-add-attachment Andreas Schwab
2011-09-03 11:38   ` mail-add-attachment Eli Zaretskii
2011-09-03 11:54     ` mail-add-attachment Eli Zaretskii
2011-09-03 18:36       ` mail-add-attachment Chong Yidong
2011-09-08 16:38 ` mail-add-attachment Eli Zaretskii
2011-09-09 14:32 ` mail-add-attachment Stefan Monnier
2011-09-09 15:04   ` mail-add-attachment Eli Zaretskii
2011-09-09 16:15     ` mail-add-attachment Lars Magne Ingebrigtsen
2011-09-09 21:49     ` Stefan Monnier [this message]
2011-09-10  0:02       ` mail-add-attachment Lars Magne Ingebrigtsen
2011-09-10  1:40         ` mail-add-attachment Stefan Monnier
2011-09-10  8:32   ` mail-add-attachment Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvy5xxfky5.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.