From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 16298 invoked from network); 22 May 2021 19:39:37 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 22 May 2021 19:39:37 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lkXTC-005Yr0-OQ for ml@inbox.vuxu.org; Sat, 22 May 2021 14:39:34 -0500 Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.94) (envelope-from ) id 1lkXTC-00Fheu-3X for ml@inbox.vuxu.org; Sat, 22 May 2021 14:39:34 -0500 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lkXTA-00Fhel-0r for ding@lists.math.uh.edu; Sat, 22 May 2021 14:39:32 -0500 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lkXT6-004UgU-Ih for ding@lists.math.uh.edu; Sat, 22 May 2021 14:39:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:Mime-Version:References:Message-ID:Date:Subject: From:To:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=36Ul/NJo8voQojgPsSjTZI9UNck4LrqcQ/uhhzbrYDU=; b=dfk0JN6il0bkmWCOS9ymKN6B7+ OIes4wkNRyt3hsq9daey669qdu+wyWK/GQD/d/4zPU0CcpPE8YAWP3gH/4sfmd8wsaU20gFgbPqno 1n643/HfnyRMmBSDHIk5HsqtMr+FfPrybsZjD9zO7oQza/ry5cQaY7iWGbz/XKn2NNaM=; Received: from ciao.gmane.io ([116.202.254.214]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lkXSz-0007AA-Hi for ding@gnus.org; Sat, 22 May 2021 21:39:23 +0200 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1lkXSy-0008f2-VM for ding@gnus.org; Sat, 22 May 2021 21:39:20 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: ding@gnus.org From: Eric Abrahamsen Subject: Re: my attach this buffer Date: Sat, 22 May 2021 12:39:13 -0700 Message-ID: <87k0nqr21q.fsf@ericabrahamsen.net> References: <87fsyen0oz.fsf@mat.ucm.es> <87lf86ver1.fsf@dick> <87zgwmk5pv.fsf@mat.ucm.es> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cancel-Lock: sha1:Rb7EE/g3EkJ0vBM7bvUkK+Mkb8U= List-ID: Precedence: bulk Uwe Brauer writes: >>>> "drc" == dick r chiang writes: > >> You make it hard to help you because my-gnus-summary-post-news is undefined. > > Ah, my bad, that was just a small modification of the vanilla function, > but you are right this is stupid to use it in that context. > > >> Try replacing `src-buffer` with `src-buf`. > > Thanks! That worked, I played around with too many changes so actually > > this works > > (defun my-attach-this-buffer () > "Send the whole buffer, funny to note that such a function does not exist." > (interactive) > (let ((src-buf (buffer-file-name (current-buffer)))) > (gnus-summary-post-news) > (mail-text) > (mml-attach-buffer src-buf "application/octet-stream" nil nil) > (message-goto-to))) > > I am not sure, whether to use application/octet-stream to be on the save > side or to use "plain/text" since most of my files I send this way will > be text files. You could try `mailcap-file-name-to-mime-type' on the file name, and see if that gets it right often enough to be useful.