Gnus development mailing list
 help / color / mirror / Atom feed
* my attach this buffer
@ 2021-05-22 17:22 Uwe Brauer
  2021-05-22 17:51 ` dick.r.chiang
  0 siblings, 1 reply; 20+ messages in thread
From: Uwe Brauer @ 2021-05-22 17:22 UTC (permalink / raw)
  To: ding


Hi


A very long time ago I wrote a function that allowed my attach the
actual buffer, I was working in, using vm.

I no longer use vm but gnus since a long time, but forgot  the function

So I tried 

(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))))
    (my-gnus-summary-post-news)
    (mail-text)
    (mml-attach-buffer src-buffer nil nil nil)
    (message-goto-to)))


It does not work something in the src-buffer is not right but I don't
know what

Anybody has an idea? It is really strange that such a function does not exist



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-22 17:22 my attach this buffer Uwe Brauer
@ 2021-05-22 17:51 ` dick.r.chiang
  2021-05-22 18:01   ` Uwe Brauer
  0 siblings, 1 reply; 20+ messages in thread
From: dick.r.chiang @ 2021-05-22 17:51 UTC (permalink / raw)
  To: Uwe Brauer, ding

You make it hard to help you because my-gnus-summary-post-news is undefined.

Try replacing `src-buffer` with `src-buf`.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-22 17:51 ` dick.r.chiang
@ 2021-05-22 18:01   ` Uwe Brauer
  2021-05-22 19:39     ` Eric Abrahamsen
  2021-08-23 12:06     ` Wayne Harris
  0 siblings, 2 replies; 20+ messages in thread
From: Uwe Brauer @ 2021-05-22 18:01 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

>>> "drc" == dick r chiang <dick.r.chiang@gmail.com> 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.

Thanks again

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-22 18:01   ` Uwe Brauer
@ 2021-05-22 19:39     ` Eric Abrahamsen
  2021-05-23 21:08       ` Uwe Brauer
  2021-08-23 12:06     ` Wayne Harris
  1 sibling, 1 reply; 20+ messages in thread
From: Eric Abrahamsen @ 2021-05-22 19:39 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

>>>> "drc" == dick r chiang <dick.r.chiang@gmail.com> 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.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-22 19:39     ` Eric Abrahamsen
@ 2021-05-23 21:08       ` Uwe Brauer
  2021-05-23 21:24         ` Emanuel Berg
  2021-05-23 22:07         ` Adam Sjøgren
  0 siblings, 2 replies; 20+ messages in thread
From: Uwe Brauer @ 2021-05-23 21:08 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]


> Uwe Brauer <oub@mat.ucm.es> writes:

> 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.



Hm I tried (mailcap-file-name-to-mime-type (buffer-file-name current-buffer))
but that did not work

I mean 

(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))))
    (let ((my-mime (mailcap-file-name-to-mime-type (buffer-file-name current-buffer))))
      (gnus-summary-post-news)
      (mail-text)
      (mml-attach-buffer src-buf my-mime nil nil)
      (message-goto-to))))

But it did not work

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-23 21:08       ` Uwe Brauer
@ 2021-05-23 21:24         ` Emanuel Berg
  2021-05-23 22:13           ` Emanuel Berg
  2021-05-24  6:29           ` Uwe Brauer
  2021-05-23 22:07         ` Adam Sjøgren
  1 sibling, 2 replies; 20+ messages in thread
From: Emanuel Berg @ 2021-05-23 21:24 UTC (permalink / raw)
  To: ding

Uwe Brauer wrote:

>> 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.
>
> Hm I tried (mailcap-file-name-to-mime-type (buffer-file-name
> current-buffer)) but that did not work
>
> I mean 
>
> (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))))
>     (let ((my-mime (mailcap-file-name-to-mime-type (buffer-file-name current-buffer))))
>       (gnus-summary-post-news)
>       (mail-text)
>       (mml-attach-buffer src-buf my-mime nil nil)
>       (message-goto-to))))
>
> But it did not work

Are you kidding? :O

Straight gangsta!

(require 'gnus-msg)
(require 'mailcap)
(require 'message)
(require 'mml)
(require 'sndmail)

(defun mail-attach-buffer ()
  (interactive)
  (let*((buf  (buffer-file-name (current-buffer)))
        (mime (mailcap-file-name-to-mime-type buf)) )
    (gnus-summary-post-news)
    (mail-text)
    (mml-attach-buffer buf mime)
    (message-goto-to) ))

-- 
underground experts united
https://dataswamp.org/~incal



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-23 21:08       ` Uwe Brauer
  2021-05-23 21:24         ` Emanuel Berg
@ 2021-05-23 22:07         ` Adam Sjøgren
  1 sibling, 0 replies; 20+ messages in thread
From: Adam Sjøgren @ 2021-05-23 22:07 UTC (permalink / raw)
  To: ding

Uwe writes:

> I mean 

[...]

>   (let  ((src-buf (buffer-file-name (current-buffer))))

Here you are calling the function current-buffer, but here:

>     (let ((my-mime (mailcap-file-name-to-mime-type (buffer-file-name current-buffer))))

You are using the variable current-buffer? (A set of parenthesis seem to
be missing.)


  Best regards,

    Adam

-- 
 "Ours is wicked cool."                                     Adam Sjøgren
                                                       asjo@koldfront.dk



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-23 21:24         ` Emanuel Berg
@ 2021-05-23 22:13           ` Emanuel Berg
  2021-05-24  6:29           ` Uwe Brauer
  1 sibling, 0 replies; 20+ messages in thread
From: Emanuel Berg @ 2021-05-23 22:13 UTC (permalink / raw)
  To: ding

Emanuel Berg wrote:

>> But it did not work
>
> Are you kidding? :O
>
> Straight gangsta!
>
> (require 'gnus-msg)
> (require 'mailcap)
> (require 'message)
> (require 'mml)
> (require 'sndmail)
>
> (defun mail-attach-buffer ()
>   (interactive)
>   (let*((buf  (buffer-file-name (current-buffer)))
>         (mime (mailcap-file-name-to-mime-type buf)) )
>     (gnus-summary-post-news)
>     (mail-text)
>     (mml-attach-buffer buf mime)
>     (message-goto-to) ))

Typo, that should be "sendmail", so

(require 'gnus-msg)
(require 'mailcap)
(require 'message)
(require 'mml)
(require 'sendmail)

(defun mail-attach-buffer ()
  (interactive)
  (let*((buf  (buffer-file-name (current-buffer)))
        (mime (mailcap-file-name-to-mime-type buf)) )
    (gnus-summary-post-news)
    (mail-text)
    (mml-attach-buffer buf mime)
    (message-goto-to) ))

https://dataswamp.org/~incal/emacs-init/gnus/mail.el

-- 
underground experts united
https://dataswamp.org/~incal



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-23 21:24         ` Emanuel Berg
  2021-05-23 22:13           ` Emanuel Berg
@ 2021-05-24  6:29           ` Uwe Brauer
  2021-05-24  7:03             ` Emanuel Berg
  1 sibling, 1 reply; 20+ messages in thread
From: Uwe Brauer @ 2021-05-24  6:29 UTC (permalink / raw)
  To: ding

>>> "EB" == Emanuel Berg <moasenwood@zoho.eu> writes:

> Uwe Brauer wrote:
>>> 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.
>> 
>> Hm I tried (mailcap-file-name-to-mime-type (buffer-file-name
>> current-buffer)) but that did not work
>> 
>> I mean 
>> 
>> (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))))
>> (let ((my-mime (mailcap-file-name-to-mime-type (buffer-file-name current-buffer))))
>> (gnus-summary-post-news)
>> (mail-text)
>> (mml-attach-buffer src-buf my-mime nil nil)
>> (message-goto-to))))
>> 
>> But it did not work

> Are you kidding? :O

> Straight gangsta!

> (require 'gnus-msg)
> (require 'mailcap)
> (require 'message)
> (require 'mml)
> (require 'sndmail)

> (defun mail-attach-buffer ()
>   (interactive)
>   (let*((buf  (buffer-file-name (current-buffer)))
>         (mime (mailcap-file-name-to-mime-type buf)) )
>     (gnus-summary-post-news)
>     (mail-text)
>     (mml-attach-buffer buf mime)
>     (message-goto-to) ))

Thanks, misplaced brackets and let instead of let*, I copied that code
from another one badly.

Strangely enough if I fire that function in a matlab file
I obtain

#part buffer="/home/oub/Annu-Matlab2021/file.m"
#/part

So mail-cap-file-name-to-mime-type does not work, even though
"text/x-matlab"

Seems a recognised type. Maybe that is a bug



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-24  6:29           ` Uwe Brauer
@ 2021-05-24  7:03             ` Emanuel Berg
  2021-05-24 10:47               ` Uwe Brauer
  0 siblings, 1 reply; 20+ messages in thread
From: Emanuel Berg @ 2021-05-24  7:03 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]

Uwe Brauer wrote:

>>>> "EB" == Emanuel Berg <moasenwood@zoho.eu> writes:
>
>> Uwe Brauer wrote:
>>>> 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.
>>> 
>>> Hm I tried (mailcap-file-name-to-mime-type (buffer-file-name
>>> current-buffer)) but that did not work
>>> 
>>> I mean 
>>> 
>>> (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))))
>>> (let ((my-mime (mailcap-file-name-to-mime-type
>>> (buffer-file-name current-buffer))))
>>> (gnus-summary-post-news)
>>> (mail-text)
>>> (mml-attach-buffer src-buf my-mime nil nil)
>>> (message-goto-to))))
>>> 
>>> But it did not work
>
>> Are you kidding? :O
>
>> Straight gangsta!
>
>> (require 'gnus-msg)
>> (require 'mailcap)
>> (require 'message)
>> (require 'mml)
>> (require 'sendmail)
>
>> (defun mail-attach-buffer ()
>>   (interactive)
>>   (let*((buf  (buffer-file-name (current-buffer)))
>>         (mime (mailcap-file-name-to-mime-type buf)) )
>>     (gnus-summary-post-news)
>>     (mail-text)
>>     (mml-attach-buffer buf mime)
>>     (message-goto-to) ))
>
> Thanks, misplaced brackets and let instead of let*, I copied that code
> from another one badly.
>
> Strangely enough if I fire that function in a matlab file
> I obtain
>
> #part buffer="/home/oub/Annu-Matlab2021/file.m"
> #/part
>
> So mail-cap-file-name-to-mime-type does not work, even though
> "text/x-matlab"
>
> Seems a recognised type. Maybe that is a bug

It works here what I can see, e.g. in/from mail.el you get

< #part type="application/emacs-lisp" buffer="/home/incal/.emacs.d/emacs-init/gnus/mail.el">

[-- Attachment #2: Type: text/plain, Size: 63 bytes --]

>

-- 
underground experts united
https://dataswamp.org/~incal

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-24  7:03             ` Emanuel Berg
@ 2021-05-24 10:47               ` Uwe Brauer
  2021-05-24 18:29                 ` Eric Abrahamsen
  0 siblings, 1 reply; 20+ messages in thread
From: Uwe Brauer @ 2021-05-24 10:47 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 375 bytes --]


> Uwe Brauer wrote:

> It works here what I can see, e.g. in/from mail.el you get

> < #part type="application/emacs-lisp" buffer="/home/incal/.emacs.d/emacs-init/gnus/mail.el">


This works, what I am saying is: you take a matlab file, extension.m 
and apply the function mail-attach-buffer

This particular type is not recognised for me (using emacs28 master)

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-24 10:47               ` Uwe Brauer
@ 2021-05-24 18:29                 ` Eric Abrahamsen
  2021-05-24 19:53                   ` Uwe Brauer
  0 siblings, 1 reply; 20+ messages in thread
From: Eric Abrahamsen @ 2021-05-24 18:29 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

>> Uwe Brauer wrote:
>
>> It works here what I can see, e.g. in/from mail.el you get
>
>> < #part type="application/emacs-lisp"
>> buffer="/home/incal/.emacs.d/emacs-init/gnus/mail.el">
>
>
> This works, what I am saying is: you take a matlab file, extension.m 
> and apply the function mail-attach-buffer
>
> This particular type is not recognised for me (using emacs28 master)

The heuristics are stored in `mailcap-mime-extensions', which currently
doesn't have anything for matlab (and thinks "*.m" is
"application/vnd.wolfram.mathematica.package". You can manipulate that
variable as needed.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-24 18:29                 ` Eric Abrahamsen
@ 2021-05-24 19:53                   ` Uwe Brauer
  2021-05-24 20:01                     ` Eric Abrahamsen
  0 siblings, 1 reply; 20+ messages in thread
From: Uwe Brauer @ 2021-05-24 19:53 UTC (permalink / raw)
  To: ding


[-- Attachment #1.1: Type: text/plain, Size: 952 bytes --]

>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
>>> Uwe Brauer wrote:
>> 
>>> It works here what I can see, e.g. in/from mail.el you get
>> 
>>> < #part type="application/emacs-lisp"
>>> buffer="/home/incal/.emacs.d/emacs-init/gnus/mail.el">
>> 
>> 
>> This works, what I am saying is: you take a matlab file, extension.m 
>> and apply the function mail-attach-buffer
>> 
>> This particular type is not recognised for me (using emacs28 master)

> The heuristics are stored in `mailcap-mime-extensions', which currently
> doesn't have anything for matlab (and thinks "*.m" is
> "application/vnd.wolfram.mathematica.package". You can manipulate that
> variable as needed.


Hm 

    1. I use gnus-summary-post-news

    2. I call mml-attach-file

    3. I select a matlab file and then I am asked for the file type

    4. And I can select text/x-matlab

Like this 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: test.m --]
[-- Type: text/x-matlab, Size: 66 bytes --]

syms x(t)
Dx = diff(x);
dsolve(diff(Dx) == exp(-x^2), Dx(0) == 1)

[-- Attachment #1.3: Type: text/plain, Size: 84 bytes --]



That is however not done automatically and I presume that is what you
mean.







[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-24 19:53                   ` Uwe Brauer
@ 2021-05-24 20:01                     ` Eric Abrahamsen
  2021-05-25  8:09                       ` Uwe Brauer
  0 siblings, 1 reply; 20+ messages in thread
From: Eric Abrahamsen @ 2021-05-24 20:01 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

>>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Uwe Brauer <oub@mat.ucm.es> writes:
>>>> Uwe Brauer wrote:
>>> 
>>>> It works here what I can see, e.g. in/from mail.el you get
>>> 
>>>> < #part type="application/emacs-lisp"
>>>> buffer="/home/incal/.emacs.d/emacs-init/gnus/mail.el">
>>> 
>>> 
>>> This works, what I am saying is: you take a matlab file, extension.m 
>>> and apply the function mail-attach-buffer
>>> 
>>> This particular type is not recognised for me (using emacs28 master)
>
>> The heuristics are stored in `mailcap-mime-extensions', which currently
>> doesn't have anything for matlab (and thinks "*.m" is
>> "application/vnd.wolfram.mathematica.package". You can manipulate that
>> variable as needed.
>
>
> Hm 
>
>     1. I use gnus-summary-post-news
>
>     2. I call mml-attach-file
>
>     3. I select a matlab file and then I am asked for the file type
>
>     4. And I can select text/x-matlab
>
> Like this 
>
> syms x(t)
> Dx = diff(x);
> dsolve(diff(Dx) == exp(-x^2), Dx(0) == 1)
>
>
>
> That is however not done automatically and I presume that is what you
> mean.

Yes. If you want it to guess correctly you'll have to override the ".m"
entry in `mailcap-mime-extensions'.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-24 20:01                     ` Eric Abrahamsen
@ 2021-05-25  8:09                       ` Uwe Brauer
  2021-05-25 16:37                         ` Eric Abrahamsen
  0 siblings, 1 reply; 20+ messages in thread
From: Uwe Brauer @ 2021-05-25  8:09 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]


> Uwe Brauer <oub@mat.ucm.es> writes:

> Yes. If you want it to guess correctly you'll have to override the ".m"
> entry in `mailcap-mime-extensions'.

There is no ".m" entry!
I just checked this variable is set by good old defvar and not
defcustom, sigh

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-25  8:09                       ` Uwe Brauer
@ 2021-05-25 16:37                         ` Eric Abrahamsen
  2021-05-26  6:40                           ` Uwe Brauer
  0 siblings, 1 reply; 20+ messages in thread
From: Eric Abrahamsen @ 2021-05-25 16:37 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

>> Uwe Brauer <oub@mat.ucm.es> writes:
>
>> Yes. If you want it to guess correctly you'll have to override the ".m"
>> entry in `mailcap-mime-extensions'.
>
> There is no ".m" entry!
> I just checked this variable is set by good old defvar and not
> defcustom, sigh

You're right! That must be getting picked up from my system somewhere.
You should feel free to push your own cons onto this variable, or use a
~/.mime.types file if you want to set this association for more than
just Emacs. The contents of that file will get merged with
`mailcap-mime-extensions'. I believe the file format is one line per
association, looking like:

.m text/x-foo

See the docstring and code comments of the `mailcap-parse-mimetypes'
function for a bunch of different ways to specify your mimetype
associations.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-25 16:37                         ` Eric Abrahamsen
@ 2021-05-26  6:40                           ` Uwe Brauer
  2021-05-26 15:57                             ` Eric Abrahamsen
  0 siblings, 1 reply; 20+ messages in thread
From: Uwe Brauer @ 2021-05-26  6:40 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]

>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Uwe Brauer <oub@mat.ucm.es> writes:
>>> Uwe Brauer <oub@mat.ucm.es> writes:
>> 
>>> Yes. If you want it to guess correctly you'll have to override the ".m"
>>> entry in `mailcap-mime-extensions'.
>> 
>> There is no ".m" entry!
>> I just checked this variable is set by good old defvar and not
>> defcustom, sigh

> You're right! That must be getting picked up from my system somewhere.
> You should feel free to push your own cons onto this variable, or use a
> ~/.mime.types file if you want to set this association for more than
> just Emacs. The contents of that file will get merged with
> `mailcap-mime-extensions'. I believe the file format is one line per
> association, looking like:

> .m text/x-foo

That did not work


> See the docstring and code comments of the `mailcap-parse-mimetypes'
> function for a bunch of different ways to specify your mimetype
> associations.

I finally did the following 

(add-to-list 'mailcap-mime-extensions  '(".m" . "text/x-matlab"))

And everything is good.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-26  6:40                           ` Uwe Brauer
@ 2021-05-26 15:57                             ` Eric Abrahamsen
  0 siblings, 0 replies; 20+ messages in thread
From: Eric Abrahamsen @ 2021-05-26 15:57 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

>>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Uwe Brauer <oub@mat.ucm.es> writes:
>>>> Uwe Brauer <oub@mat.ucm.es> writes:
>>> 
>>>> Yes. If you want it to guess correctly you'll have to override the ".m"
>>>> entry in `mailcap-mime-extensions'.
>>> 
>>> There is no ".m" entry!
>>> I just checked this variable is set by good old defvar and not
>>> defcustom, sigh
>
>> You're right! That must be getting picked up from my system somewhere.
>> You should feel free to push your own cons onto this variable, or use a
>> ~/.mime.types file if you want to set this association for more than
>> just Emacs. The contents of that file will get merged with
>> `mailcap-mime-extensions'. I believe the file format is one line per
>> association, looking like:
>
>> .m text/x-foo
>
> That did not work

Oh, maybe it's something else. I just squinted at the parsing code for a
moment.

>> See the docstring and code comments of the `mailcap-parse-mimetypes'
>> function for a bunch of different ways to specify your mimetype
>> associations.
>
> I finally did the following 
>
> (add-to-list 'mailcap-mime-extensions  '(".m" . "text/x-matlab"))
>
> And everything is good.

Great!



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-05-22 18:01   ` Uwe Brauer
  2021-05-22 19:39     ` Eric Abrahamsen
@ 2021-08-23 12:06     ` Wayne Harris
  2021-08-23 18:23       ` Emanuel Berg
  1 sibling, 1 reply; 20+ messages in thread
From: Wayne Harris @ 2021-08-23 12:06 UTC (permalink / raw)
  To: ding

Uwe Brauer <oub@mat.ucm.es> writes:

[...]

> (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)))

What version of Gnus are you using?  I don't have mail-text on my Gnus
v5.13 running on GNU Emacs 27.1 (build 1, x86_64-w64-mingw32) of
2020-08-21.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: my attach this buffer
  2021-08-23 12:06     ` Wayne Harris
@ 2021-08-23 18:23       ` Emanuel Berg
  0 siblings, 0 replies; 20+ messages in thread
From: Emanuel Berg @ 2021-08-23 18:23 UTC (permalink / raw)
  To: ding

Wayne Harris wrote:

> Uwe Brauer <oub@mat.ucm.es> writes:
>
> [...]
>
>> (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)))
>
> What version of Gnus are you using? I don't have mail-text
> on my Gnus v5.13 running on GNU Emacs 27.1 (build 1,
> x86_64-w64-mingw32) of 2020-08-21.

It isn't in Gnus but in lisp/mail/sendmail.el.gz

  mail-text is an interactive compiled Lisp function in
  ‘sendmail.el’.

  (mail-text)

  Move point to beginning of text field.

GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, cairo version
1.16.0) of 2021-08-02

Gnus v5.13

-- 
underground experts united
https://dataswamp.org/~incal



^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2021-08-23 18:23 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-22 17:22 my attach this buffer Uwe Brauer
2021-05-22 17:51 ` dick.r.chiang
2021-05-22 18:01   ` Uwe Brauer
2021-05-22 19:39     ` Eric Abrahamsen
2021-05-23 21:08       ` Uwe Brauer
2021-05-23 21:24         ` Emanuel Berg
2021-05-23 22:13           ` Emanuel Berg
2021-05-24  6:29           ` Uwe Brauer
2021-05-24  7:03             ` Emanuel Berg
2021-05-24 10:47               ` Uwe Brauer
2021-05-24 18:29                 ` Eric Abrahamsen
2021-05-24 19:53                   ` Uwe Brauer
2021-05-24 20:01                     ` Eric Abrahamsen
2021-05-25  8:09                       ` Uwe Brauer
2021-05-25 16:37                         ` Eric Abrahamsen
2021-05-26  6:40                           ` Uwe Brauer
2021-05-26 15:57                             ` Eric Abrahamsen
2021-05-23 22:07         ` Adam Sjøgren
2021-08-23 12:06     ` Wayne Harris
2021-08-23 18:23       ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).