From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Sharon Kimble Newsgroups: gmane.emacs.help Subject: Re: How can I get attachments to stick and actually be sent with an email using 27.0.91? Date: Sat, 20 Jun 2020 12:53:47 +0100 Message-ID: <87y2oi9cms.fsf@skimble.plus.com> References: <877dw4cn61.fsf@skimble.plus.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="77865"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 20 13:54:23 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jmc4k-000KA7-JG for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 20 Jun 2020 13:54:22 +0200 Original-Received: from localhost ([::1]:47784 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmc4j-0000WM-KV for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 20 Jun 2020 07:54:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmc4P-0000WG-Mv for help-gnu-emacs@gnu.org; Sat, 20 Jun 2020 07:54:01 -0400 Original-Received: from avasout01.plus.net ([84.93.230.227]:38002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmc4N-0005SY-0J for help-gnu-emacs@gnu.org; Sat, 20 Jun 2020 07:54:01 -0400 Original-Received: from london.london ([195.213.72.179]) by smtp with ESMTPA id mc4Ijvr0fjUVQmc4Jj4ltz; Sat, 20 Jun 2020 12:53:56 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019; t=1592654036; bh=if6gYU330WQN8ql32Mmw3ss5PAq6CbwuGGLEVJMVuyE=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=tNRWQmmS31wfWLXdbnh9YZoCAJv5IPFLkndcQPOhsalrqd8uRzfY7W+BaRTd4cuvs yfrGzZ8BaAcbqlLbdRFEyqms2H+gQwjmnQPz3BViGABElX4Ui2mtP/1nUeeB8S047K e1Tl2J7ak2uXZWiQoLHhMFtrN9NITStE3RNeDsa+GLI1FfERGU4n47Lp4a5Xu19GKR SX/0skjEsbA+k4t2zwQqepPYi3/Iq9vA1Ca7MXLWAKUbL9dvTo1IODGKRRdBjvdlx6 pi1Dc3PbMygDQvycZemMQ5gk9feu2/uDDbj0Q05Sj1SnLIrKN9zPPyKnCh9cvyMGzc Ly/Pt9lf7fAqg== X-Clacks-Overhead: "GNU Terry Pratchett" X-CM-Score: 0.00 X-CNFS-Analysis: v=2.3 cv=L5aGv9b8 c=1 sm=1 tr=0 a=b9oteIU6sQwwACWZwFHMwA==:117 a=b9oteIU6sQwwACWZwFHMwA==:17 a=iRZporoAAAAA:8 a=1XWaLZrsAAAA:8 a=LlzXLoV6AAAA:8 a=iI7HsYTVAAAA:8 a=bAHfVwKlAAAA:8 a=IqdFkng32HvCANeMGiMA:9 a=0MmxI76Re9207u-U:21 a=8QEaJfDFRsKXyhSS:21 a=NOBgFS-JBQ2l-kSd6-zu:22 a=diwpeB1DDhFXqWA7J4Up:22 a=KxyM1Xthmv57RbWRIpnN:22 a=fjrkRJ71zQ2jzMzczd-K:22 X-AUTH: skimble@:2500 In-Reply-To: (Stefan Monnier's message of "Thu, 18 Jun 2020 13:16:10 -0400") X-CMAE-Envelope: MS4wfCAXMVhfh1e6ciMlpbg5m7rnzkooCHNCEJzafl5cG3KdvRfQIBvEFW/nlMxEGT2PID6tXSUQPYzaKj3mV9HH8Q4w7K+OXEq4Q6yg69+ctJS6hIoq4GMI OrIhg0XDGEqtsTOIS0AP+3/tWqa4aUQPImWmI92OkMbhlltJN//+3J07wuFY0/DI/dwjk6hoq1mKvw== Received-SPF: none client-ip=84.93.230.227; envelope-from=boudiccas@skimble.plus.com; helo=avasout01.plus.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/20 07:53:56 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:123409 Archived-At: =2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Stefan Monnier writes: >> I've just spent a frustrating 20 minutes trying to attach a pdf file to >> an email to be sent with the email itself. I've tried attaching a file, >> attaching a buffer, and also attaching an external pdf file. None of >> them were successful, so how can I do it please? > > I do > > M-x *-att-fil RET > > which completes to `mml-attach-file`. > And searching for 'mm-substring-no-properties' in my config turns up this =2D --8<---------------cut here---------------start------------->8--- #+begin_src emacs-lisp (setq mml-attach-files-at-end t) (defun mml-attach-file (file &optional type description disposition) "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]' in Message mode, or `\\[mail-send-and-exit]' or `\\[mail-send]' in Mail mode. 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)." (interactive (let* ((file (mml-minibuffer-read-file "Attach file: ")) (type (mml-minibuffer-read-type file)) (description (mml-minibuffer-read-description)) (disposition (mml-minibuffer-read-disposition type nil file))) (list file type description disposition))) ;; If in the message header, attach at the end and leave point unchanged. (let ((head (unless (and (message-in-body-p) (not mml-attach-files-at-end= )) (point)))) (if (or head mml-attach-files-at-end) (goto-char (point-max))) (mml-insert-empty-tag 'part 'type type ;; icicles redefines read-file-name and returns a ;; string w/ text properties :-/ 'filename (mm-substring-no-properties file) 'disposition (or disposition "attachment") 'description description) ;; When using Mail mode, make sure it does the mime encoding ;; when you send the message. (or (eq mail-user-agent 'message-user-agent) (setq mail-encode-mml t)) (when (or head mml-attach-files-at-end) (unless (pos-visible-in-window-p) (message "The file \"%s\" has been attached at the end of the messa= ge" (file-name-nondirectory file))) (goto-char head)))) #+end_src [2015-03-27 Fri 16:34] https://groups.google.com/forum/#!msg/gnu.emacs.gnus/4hzShoQEff4/9-CjUhEkLF= MJ =2D --8<---------------cut here---------------end--------------->8--- Now that code worked in emacs-26, but its failing in emacs-27.0.91. And, being as that code has been in use since March 2015 it may well be past its use-by-date! So can anyone help me out please? Thanks Sharon. =2D --=20 A taste of linux =3D http://www.sharons.org.uk TGmeds =3D http://www.tgmeds.org.uk DrugFacts =3D https://www.drugfacts.org.uk Debian 10.2, fluxbox 1.3.7, emacs 27.0.91, org 9.3.7 =2D----BEGIN PGP SIGNATURE----- iQJPBAEBCgA5FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAl7t+M0bHGJvdWRpY2Nh c0Bza2ltYmxlLnBsdXMuY29tAAoJEDaBgBkK+INbaMMP/27JG5GCC1kpulHzk/zU sSzXRuFQSLTr/Ek+3a0+h0ea0r93ZDhN5Rbp0J9MoGJIcdBta3XScOrDJlfbf2rC OElENchupvTZGpBNQDsMke+MzNvjiIDWPHyAAnb9iuqLQyjaQE1qz4/2QuLlE39x zUmVC/pvXAc9xDxvJLi/RzYa5xGGmy8QIL4+IHXbNeNDhw4MR6s6e9WrtudjWqfE ZGXAsWhKWMmQy80uTQYSps+tSyVOYW7zYWVrQV1z5Bc9tAW6H4VPQ1YQLIBOQL0Z gH6SqP+Evb7ZXI1fsd0PPtM/sCMhonLgC9zFLb9KF0TFXxYIATMr1br39x7wAIPr GGr6QWgJPlmwjBYhuX8QM2ON4raSExaQjB2wFsa7RQ8tdrbWVBO3INMj8FSPXU5z ikkb4i4Ep9Qsee/lGuKO6h+dntw1LPDypIqf28+rQFlxvdy0tWNosTffarO1LAle jC1kJAGHXyVidC1P792rDlsMQnU/ZG5wMYVMOzjeSpLNA2zdiZAJe+jrYYL1Tna5 Dvz40GpHhHqXlD0QBDkinmvl0VjzddSzKCYbpfcytKzeu3hDGtw7JdP2GhRbSvfD eJFxZwhGB53H4SSfkK1cGdMgSJef7d6IRZYaA1EgxuJ461+hDNAtf+ubtBRxH8Dy ufDalfvbU4FtUo2GUYmEZa2n =3DrZcf =2D----END PGP SIGNATURE-----