Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* indicate email has attachment in summary buffer
@ 2006-08-02 18:41 Leon
  2006-08-02 19:13 ` Frank Schmitt
  0 siblings, 1 reply; 20+ messages in thread
From: Leon @ 2006-08-02 18:41 UTC (permalink / raw)


Dear all,

I have just completed a project with 4 people based on emails. I
almost missed an important file attached in an email. That's how I
found an indicator of attachment in gnus summary line will be
practically useful.

It happened like this.
The message, as we always include the original, became very long. And
the attachment in gnus is shown at the end of the article buffer that
I missed it.

So I'm wondering is there any way I can have an indicator in the
summary line for emails that have attachment. For example something
like this will be useful:

O +|31-Jul| Hadron Quark    | 160|@● Always show 20 posts

The '@' at the beginning of the subject indicates attachment.

Thank you!
-- 
Leon

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

* Re: indicate email has attachment in summary buffer
  2006-08-02 18:41 indicate email has attachment in summary buffer Leon
@ 2006-08-02 19:13 ` Frank Schmitt
  2006-08-02 19:58   ` Reiner Steib
  2006-08-03 11:46   ` Leon
  0 siblings, 2 replies; 20+ messages in thread
From: Frank Schmitt @ 2006-08-02 19:13 UTC (permalink / raw)


Leon <sdl.web@gmail.com> writes:

> I have just completed a project with 4 people based on emails. I
> almost missed an important file attached in an email. That's how I
> found an indicator of attachment in gnus summary line will be
> practically useful.
>
> It happened like this.
> The message, as we always include the original, became very long. And
> the attachment in gnus is shown at the end of the article buffer that
> I missed it.
>
> So I'm wondering is there any way I can have an indicator in the
> summary line for emails that have attachment. For example something
> like this will be useful:
>
> O +|31-Jul| Hadron Quark    | 160|@● Always show 20 posts
>
> The '@' at the beginning of the subject indicates attachment.

Yes, this is possible, however it isn't easy, you have to write some
lisp to do it: See the Gnus manual node 

3.1.1 Summary Buffer Lines

there you'll find 

`u'
     User defined specifier.  The next character in the format string
     should be a letter.  Gnus will call the function
     `gnus-user-format-function-X', where X is the letter following
     `%u'.  The function will be passed the current header as argument.
     The function should return a string, which will be inserted into
     the summary just like information from any other summary specifier.

Now you "only" have to write a function which takes the header and
searches for "Content-Type: multipart/mixed". If it is found your
function returns an "@", otherwise it returns a " ". This should be
really easy for someone who knows some lisp. (Rainer? :-))

Greetings,
Frank

-- 
Did you ever realize how much text fits in eighty columns? If you now consider
that a signature usually consists of up to four lines, this gives you enough
space to spread a tremendous amount of information with your messages. So seize
this opportunity and don't waste your signature with bullshit nobody will read.

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

* Re: indicate email has attachment in summary buffer
  2006-08-02 19:13 ` Frank Schmitt
@ 2006-08-02 19:58   ` Reiner Steib
  2006-08-03  7:04     ` Frank Schmitt
                       ` (4 more replies)
  2006-08-03 11:46   ` Leon
  1 sibling, 5 replies; 20+ messages in thread
From: Reiner Steib @ 2006-08-02 19:58 UTC (permalink / raw)


On Wed, Aug 02 2006, Frank Schmitt wrote:

> Leon <sdl.web@gmail.com> writes:
>
>> I have just completed a project with 4 people based on emails. I
>> almost missed an important file attached in an email. That's how I
>> found an indicator of attachment in gnus summary line will be
>> practically useful.
>>
>> It happened like this.
>> The message, as we always include the original, became very long. And
>> the attachment in gnus is shown at the end of the article buffer that
>> I missed it.

The mode line displays something like "(2 parts)".

You also might consider this settings, cf. (info "(gnus)Article
Hiding"):

(setq
 gnus-treat-hide-citation t ; nice w/ non-nil gnus-cited-lines-visible
 gnus-cited-lines-visible '(3 . 6)) ; (top . bottom)

>> So I'm wondering is there any way I can have an indicator in the
>> summary line for emails that have attachment. For example something
>> like this will be useful:
>>
>> O +|31-Jul| Hadron Quark    | 160|@● Always show 20 posts
>>
>> The '@' at the beginning of the subject indicates attachment.
>
> Yes, this is possible, however it isn't easy, you have to write some
> lisp to do it: [...]

Or as often: Find someone who already has written it. ;-)

> Now you "only" have to write a function which takes the header and
> searches for "Content-Type: multipart/mixed". If it is found your
> function returns an "@", otherwise it returns a " ". This should be
> really easy for someone who knows some lisp. (Rainer? :-))

s/ai/ei/ if you thought of me. ;-)

;; rs-gnus-summary.el -- Auxiliary summary mode commands for Gnus
[...]
;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el

See the installation instructions in the file.  Especially the
following functions and variables are for the Content-Type:

,----[ <f1> f rs-gnus-summary-line-content-type RET ]
| rs-gnus-summary-line-content-type is a Lisp function in `rs-gnus-summary.el'.
| (rs-gnus-summary-line-content-type header)
| 
| Display content type of message in summary line.
| 
| This function is intended to be used in `gnus-summary-line-format-alist', with
| (defalias 'gnus-user-format-function-X 'rs-gnus-summary-line-content-type).
| See (info "(gnus)Group Line Specification").
| 
| You need to add `Content-Type' to `nnmail-extra-headers' and
| `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'.
`----

,----[ <f1> v rs-gnus-summary-line-content-type-alist RET ]
| rs-gnus-summary-line-content-type-alist is a variable defined in
| `rs-gnus-summary.el'.
| Its value is shown below.
| 
| Documentation:
| Alist of regular expressions and summary line indicators.
| 
| You can customize this variable.
| 
| Value:
| (("^text/plain" " ")
|  ("^text/html" "h")
|  ("^multipart/mixed" "m")
|  ("^multipart/alternative" "a")
|  ("^multipart/related" "r")
|  ("^multipart/signed" "s")
|  ("^multipart/encrypted" "e")
|  ("^multipart/report" "t"))
`----

(defalias 'gnus-user-format-function-ct 'rs-gnus-summary-line-content-type)

Then add %u&ct; in `gnus-summary-line-format' and regenerate the NOV
files as described in the manual:

,----[ (info "(gnus)To From Newsgroups") ]
|    A related variable is `nnmail-extra-headers', which controls when to
| include extra headers when generating overview (NOV) files.  If you
| have old overview files, you should regenerate them after changing this
| variable, by entering the server buffer using `^', and then `g' on the
| appropriate mail server (e.g. nnml) to cause regeneration.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: indicate email has attachment in summary buffer
  2006-08-02 19:58   ` Reiner Steib
@ 2006-08-03  7:04     ` Frank Schmitt
  2006-08-07 21:40       ` Reiner Steib
  2006-08-03 11:49     ` Leon
                       ` (3 subsequent siblings)
  4 siblings, 1 reply; 20+ messages in thread
From: Frank Schmitt @ 2006-08-03  7:04 UTC (permalink / raw)


Reiner Steib <reinersteib+gmane@imap.cc> writes:

>> This should be
>> really easy for someone who knows some lisp. (Rainer? :-))
>
> s/ai/ei/ if you thought of me. ;-)

Sorry. Call me Schmidt as revenge ;-)

> ;; rs-gnus-summary.el -- Auxiliary summary mode commands for Gnus
> [...]
> ;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el
>
> See the installation instructions in the file.  Especially the
> following functions and variables are for the Content-Type:

This code is extremely useful. I would suggest adding it to No Gnus.

Greetings, 
Frank

-- 
Did you ever realize how much text fits in eighty columns? If you now consider
that a signature usually consists of up to four lines, this gives you enough
space to spread a tremendous amount of information with your messages. So seize
this opportunity and don't waste your signature with bullshit nobody will read.

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

* Re: indicate email has attachment in summary buffer
  2006-08-02 19:13 ` Frank Schmitt
  2006-08-02 19:58   ` Reiner Steib
@ 2006-08-03 11:46   ` Leon
  1 sibling, 0 replies; 20+ messages in thread
From: Leon @ 2006-08-03 11:46 UTC (permalink / raw)


Frank Schmitt <ich@frank-schmitt.net> writes:

> Yes, this is possible, however it isn't easy, you have to write some
> lisp to do it: See the Gnus manual node 
>
> 3.1.1 Summary Buffer Lines
>
> there you'll find 
>
> `u'
>      User defined specifier.  The next character in the format string
>      should be a letter.  Gnus will call the function
>      `gnus-user-format-function-X', where X is the letter following
>      `%u'.  The function will be passed the current header as argument.
>      The function should return a string, which will be inserted into
>      the summary just like information from any other summary specifier.
>
> Now you "only" have to write a function which takes the header and
> searches for "Content-Type: multipart/mixed". If it is found your
> function returns an "@", otherwise it returns a " ". This should be
> really easy for someone who knows some lisp. (Rainer? :-))
>
> Greetings,
> Frank

Thank you for your hint. I have adapted one function from Reiner to
accomplish this.

-- 
Leon

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

* Re: indicate email has attachment in summary buffer
  2006-08-02 19:58   ` Reiner Steib
  2006-08-03  7:04     ` Frank Schmitt
@ 2006-08-03 11:49     ` Leon
  2006-08-03 18:09       ` Reiner Steib
  2006-08-04 12:01       ` Leon
       [not found]     ` <mailman.4799.1154608593.9609.info-gnus-english@gnu.org>
                       ` (2 subsequent siblings)
  4 siblings, 2 replies; 20+ messages in thread
From: Leon @ 2006-08-03 11:49 UTC (permalink / raw)


Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Wed, Aug 02 2006, Frank Schmitt wrote:
>
>> Leon <sdl.web@gmail.com> writes:
>>
>>> I have just completed a project with 4 people based on emails. I
>>> almost missed an important file attached in an email. That's how I
>>> found an indicator of attachment in gnus summary line will be
>>> practically useful.
>>>
>>> It happened like this.
>>> The message, as we always include the original, became very long. And
>>> the attachment in gnus is shown at the end of the article buffer that
>>> I missed it.
>
> The mode line displays something like "(2 parts)".
>
> You also might consider this settings, cf. (info "(gnus)Article
> Hiding"):
>
> (setq
>  gnus-treat-hide-citation t ; nice w/ non-nil gnus-cited-lines-visible
>  gnus-cited-lines-visible '(3 . 6)) ; (top . bottom)

This is useful in general:)

>
>>> So I'm wondering is there any way I can have an indicator in the
>>> summary line for emails that have attachment. For example something
>>> like this will be useful:
>>>
>>> O +|31-Jul| Hadron Quark    | 160|@● Always show 20 posts
>>>
>>> The '@' at the beginning of the subject indicates attachment.
>>
>> Yes, this is possible, however it isn't easy, you have to write some
>> lisp to do it: [...]
>
> Or as often: Find someone who already has written it. ;-)
>
>> Now you "only" have to write a function which takes the header and
>> searches for "Content-Type: multipart/mixed". If it is found your
>> function returns an "@", otherwise it returns a " ". This should be
>> really easy for someone who knows some lisp. (Rainer? :-))
>
> s/ai/ei/ if you thought of me. ;-)
>
> ;; rs-gnus-summary.el -- Auxiliary summary mode commands for Gnus
> [...]
> ;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el
>
> See the installation instructions in the file.  Especially the
> following functions and variables are for the Content-Type:
>
> ,----[ <f1> f rs-gnus-summary-line-content-type RET ]
> | rs-gnus-summary-line-content-type is a Lisp function in `rs-gnus-summary.el'.
> | (rs-gnus-summary-line-content-type header)
> | 
> | Display content type of message in summary line.
> | 
> | This function is intended to be used in `gnus-summary-line-format-alist', with
> | (defalias 'gnus-user-format-function-X 'rs-gnus-summary-line-content-type).
> | See (info "(gnus)Group Line Specification").
> | 
> | You need to add `Content-Type' to `nnmail-extra-headers' and
> | `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'.
> `----
>
> ,----[ <f1> v rs-gnus-summary-line-content-type-alist RET ]
> | rs-gnus-summary-line-content-type-alist is a variable defined in
> | `rs-gnus-summary.el'.
> | Its value is shown below.
> | 
> | Documentation:
> | Alist of regular expressions and summary line indicators.
> | 
> | You can customize this variable.
> | 
> | Value:
> | (("^text/plain" " ")
> |  ("^text/html" "h")
> |  ("^multipart/mixed" "m")
> |  ("^multipart/alternative" "a")
> |  ("^multipart/related" "r")
> |  ("^multipart/signed" "s")
> |  ("^multipart/encrypted" "e")
> |  ("^multipart/report" "t"))
> `----
>
> (defalias 'gnus-user-format-function-ct 'rs-gnus-summary-line-content-type)
>
> Then add %u&ct; in `gnus-summary-line-format' and regenerate the NOV
> files as described in the manual:
>
> ,----[ (info "(gnus)To From Newsgroups") ]
> |    A related variable is `nnmail-extra-headers', which controls when to
> | include extra headers when generating overview (NOV) files.  If you
> | have old overview files, you should regenerate them after changing this
> | variable, by entering the server buffer using `^', and then `g' on the
> | appropriate mail server (e.g. nnml) to cause regeneration.
> `----
>
> Bye, Reiner.

I have adapt one function from rs-gnus-summary.el as:

(defun gnus-user-format-function-@ (header)
  "Display @ for message with attachment in summary line.
  
You need to add `Content-Type' to `nnmail-extra-headers' and
`gnus-extra-headers', see Info node `(gnus)To From Newsgroups'."
  (let ((case-fold-search t)
	(ctype (or (cdr (assq 'Content-Type (mail-header-extra header)))
		   "text/plain"))
	indicator)
    (when (string-match "^multipart/mixed" ctype)
      (setq indicator "@"))
    (if indicator
	indicator
      " ")))

As you can see, I only match "^multipart/mixed" with Content-type. Do
you think this is reliable to match all emails with attachment?

Thank you.
-- 
Leon

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

* Re: indicate email has attachment in summary buffer
  2006-08-03 11:49     ` Leon
@ 2006-08-03 18:09       ` Reiner Steib
  2006-08-03 19:28         ` Leon
  2006-08-04 12:01       ` Leon
  1 sibling, 1 reply; 20+ messages in thread
From: Reiner Steib @ 2006-08-03 18:09 UTC (permalink / raw)


On Thu, Aug 03 2006, Leon wrote:

> I have adapt one function from rs-gnus-summary.el as:
>
> (defun gnus-user-format-function-@ (header)
>   "Display @ for message with attachment in summary line.
[...]
>     (when (string-match "^multipart/mixed" ctype)
>       (setq indicator "@"))
>     (if indicator
> 	indicator
>       " ")))
>
> As you can see, I only match "^multipart/mixed" with Content-type.

Probably this setting should do the same...

(setq rs-gnus-summary-line-content-type-alist
      '((".*" " ")
	("^multipart/mixed" "@")))

> Do you think this is reliable to match all emails with attachment?

It also matches other articles (e.g. various text/plain parts with
different charset), but these articles are quite rare.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: indicate email has attachment in summary buffer
  2006-08-03 18:09       ` Reiner Steib
@ 2006-08-03 19:28         ` Leon
  2006-08-03 22:26           ` Reiner Steib
  0 siblings, 1 reply; 20+ messages in thread
From: Leon @ 2006-08-03 19:28 UTC (permalink / raw)


Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Thu, Aug 03 2006, Leon wrote:
>
>> I have adapt one function from rs-gnus-summary.el as:
>>
>> (defun gnus-user-format-function-@ (header)
>>   "Display @ for message with attachment in summary line.
> [...]
>>     (when (string-match "^multipart/mixed" ctype)
>>       (setq indicator "@"))
>>     (if indicator
>> 	indicator
>>       " ")))
>>
>> As you can see, I only match "^multipart/mixed" with Content-type.
>
> Probably this setting should do the same...
>
> (setq rs-gnus-summary-line-content-type-alist
>       '((".*" " ")
> 	("^multipart/mixed" "@")))

Yes. There are a lot of other nice features in your rs-gnus-summary.el
for example the Thunderbird-like labels.

>
>> Do you think this is reliable to match all emails with attachment?
>
> It also matches other articles (e.g. various text/plain parts with
> different charset), but these articles are quite rare.
>
> Bye, Reiner.

Actually I just met one such email. Gnus didn't show any attachment in
article buffer, but thunderbird did. Is there any standard way of
testing if an email has attachment?

Thanks a lot!

-- 
Leon

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

* Re: indicate email has attachment in summary buffer
  2006-08-03 19:28         ` Leon
@ 2006-08-03 22:26           ` Reiner Steib
  2006-08-03 23:41             ` Leon
  0 siblings, 1 reply; 20+ messages in thread
From: Reiner Steib @ 2006-08-03 22:26 UTC (permalink / raw)


On Thu, Aug 03 2006, Leon wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> On Thu, Aug 03 2006, Leon wrote:
>>> Do you think this is reliable to match all emails with attachment?
>>
>> It also matches other articles (e.g. various text/plain parts with
>> different charset), but these articles are quite rare.
[...]
> Actually I just met one such email. Gnus didn't show any attachment in
> article buffer, but thunderbird did. 

What is the value of the Content-Type header of this mail?  E.g. if
someone sends[1] a PDF or an image without any accompanying text, you
might get application/pdf or image/jpeg.


> Is there any standard way of testing if an email has attachment?

First you need to define the term "attachment" properly.

Bye, Reiner.

Footnotes: 
[1]  E.g.: mutt -s "this is the image" -a foo.jpg < /dev/null

-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: indicate email has attachment in summary buffer
  2006-08-03 22:26           ` Reiner Steib
@ 2006-08-03 23:41             ` Leon
  2006-08-05 15:47               ` Reiner Steib
  0 siblings, 1 reply; 20+ messages in thread
From: Leon @ 2006-08-03 23:41 UTC (permalink / raw)


Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Thu, Aug 03 2006, Leon wrote:
>
>> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>>> On Thu, Aug 03 2006, Leon wrote:
>>>> Do you think this is reliable to match all emails with attachment?
>>>
>>> It also matches other articles (e.g. various text/plain parts with
>>> different charset), but these articles are quite rare.
> [...]
>> Actually I just met one such email. Gnus didn't show any attachment in
>> article buffer, but thunderbird did. 
>
> What is the value of the Content-Type header of this mail?  E.g. if
> someone sends[1] a PDF or an image without any accompanying text, you
> might get application/pdf or image/jpeg.
>

Content-Type: multipart/mixed; boundary="===============1171174969=="

I have also tried to send an email with only a pdf file. Thunderbird
failed to show the 'paperclip' icon before reading the email. After I
open the email, the icon is back.

>
>> Is there any standard way of testing if an email has attachment?
>
> First you need to define the term "attachment" properly.
>

A lot of other email clients will show a `paperclip' icon for emails
that have `attachment'. I'm looking for a similar behavior in gnus.

> Bye, Reiner.
>
> Footnotes: 
> [1]  E.g.: mutt -s "this is the image" -a foo.jpg < /dev/null

-- 
Leon

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

* Re: indicate email has attachment in summary buffer
  2006-08-03 11:49     ` Leon
  2006-08-03 18:09       ` Reiner Steib
@ 2006-08-04 12:01       ` Leon
  2006-08-04 14:54         ` Reiner Steib
  1 sibling, 1 reply; 20+ messages in thread
From: Leon @ 2006-08-04 12:01 UTC (permalink / raw)


Leon <sdl.web@gmail.com> writes:

>
> I have adapt one function from rs-gnus-summary.el as:
>
> (defun gnus-user-format-function-@ (header)
>   "Display @ for message with attachment in summary line.
>   
> You need to add `Content-Type' to `nnmail-extra-headers' and
> `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'."
>   (let ((case-fold-search t)
> 	(ctype (or (cdr (assq 'Content-Type (mail-header-extra header)))
                   ^This will always return nil in newsgroup
                    emails. Any ideas?

> 		   "text/plain"))
> 	indicator)
>     (when (string-match "^multipart/mixed" ctype)
>       (setq indicator "@"))
>     (if indicator
> 	indicator
>       " ")))
>
> As you can see, I only match "^multipart/mixed" with Content-type. Do
> you think this is reliable to match all emails with attachment?
>
> Thank you.

-- 
Leon

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

* Re: indicate email has attachment in summary buffer
  2006-08-04 12:01       ` Leon
@ 2006-08-04 14:54         ` Reiner Steib
  2006-08-04 17:08           ` Leon
  0 siblings, 1 reply; 20+ messages in thread
From: Reiner Steib @ 2006-08-04 14:54 UTC (permalink / raw)


On Fri, Aug 04 2006, Leon wrote:

> Leon <sdl.web@gmail.com> writes:
>> (defun gnus-user-format-function-@ (header)
>>   "Display @ for message with attachment in summary line.
>>   
>> You need to add `Content-Type' to `nnmail-extra-headers' and
>> `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'."
>>   (let ((case-fold-search t)
>> 	(ctype (or (cdr (assq 'Content-Type (mail-header-extra header)))
>                    ^This will always return nil in newsgroup
>                     emails. Any ideas?

,----[ (info "(gnus)To From Newsgroups") ]
|    A note for news server administrators, or for users who wish to try
| to convince their news server administrator to provide some additional
| support:
| 
|    The above is mostly useful for mail groups, where you have control
| over the NOV files that are created.  However, if you can persuade your
| nntp admin to add (in the usual implementation, notably INN):
| 
|      Newsgroups:full
| 
|    to the end of her `overview.fmt' file, then you can use that just as
| you would the extra headers from the mail groups.
`----

HTH

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: indicate email has attachment in summary buffer
  2006-08-04 14:54         ` Reiner Steib
@ 2006-08-04 17:08           ` Leon
  2006-08-05 15:34             ` Reiner Steib
  0 siblings, 1 reply; 20+ messages in thread
From: Leon @ 2006-08-04 17:08 UTC (permalink / raw)


Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Fri, Aug 04 2006, Leon wrote:
>
>> Leon <sdl.web@gmail.com> writes:
>>> (defun gnus-user-format-function-@ (header)
>>>   "Display @ for message with attachment in summary line.
>>>   
>>> You need to add `Content-Type' to `nnmail-extra-headers' and
>>> `gnus-extra-headers', see Info node `(gnus)To From Newsgroups'."
>>>   (let ((case-fold-search t)
>>> 	(ctype (or (cdr (assq 'Content-Type (mail-header-extra header)))
>>                    ^This will always return nil in newsgroup
>>                     emails. Any ideas?
>
> ,----[ (info "(gnus)To From Newsgroups") ]
> |    A note for news server administrators, or for users who wish to try
> | to convince their news server administrator to provide some additional
> | support:
> | 
> |    The above is mostly useful for mail groups, where you have control
> | over the NOV files that are created.  However, if you can persuade your
> | nntp admin to add (in the usual implementation, notably INN):
> | 
> |      Newsgroups:full
> | 
> |    to the end of her `overview.fmt' file, then you can use that just as
> | you would the extra headers from the mail groups.
> `----
>
> HTH
>
> Bye, Reiner.

Thanks Reiner.

Where is the header passed to gnus-user-format-function-X stored?
Because when I look at the raw message of news emails I can see the
Content-Type?

-- 
Leon

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

* Re: indicate email has attachment in summary buffer
       [not found]     ` <mailman.4799.1154608593.9609.info-gnus-english@gnu.org>
@ 2006-08-05  4:10       ` John Sullivan
  0 siblings, 0 replies; 20+ messages in thread
From: John Sullivan @ 2006-08-05  4:10 UTC (permalink / raw)


Frank Schmitt <ich@frank-schmitt.net> writes:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>
>>> This should be
>>> really easy for someone who knows some lisp. (Rainer? :-))
>>
>> s/ai/ei/ if you thought of me. ;-)
>
> Sorry. Call me Schmidt as revenge ;-)
>
>> ;; rs-gnus-summary.el -- Auxiliary summary mode commands for Gnus
>> [...]
>> ;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el
>>
>> See the installation instructions in the file.  Especially the
>> following functions and variables are for the Content-Type:
>
> This code is extremely useful. I would suggest adding it to No Gnus.

I would also really like to see something like this standard in Gnus. 

I guess my current summary line shows the size of the message, and that usually
tips me off as to whether there is an attachment there. But I think there is a
reasonable expectation that something should show in the summary line when
there is an attachment.

-- 
-John Sullivan1
-http://www.wjsullivan.net
-GPG Key: AE8600B6

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

* Re: indicate email has attachment in summary buffer
  2006-08-04 17:08           ` Leon
@ 2006-08-05 15:34             ` Reiner Steib
  0 siblings, 0 replies; 20+ messages in thread
From: Reiner Steib @ 2006-08-05 15:34 UTC (permalink / raw)


On Fri, Aug 04 2006, Leon wrote:

> Where is the header passed to gnus-user-format-function-X stored?

The `header' is the overview (NOV) line of the article.
E.g. group/.overview for nnml.  (mail-header-extra header) extracts
the "extra headers", cf. (info "(gnus)To From Newsgroups").

> Because when I look at the raw message of news emails I can see the
> Content-Type?

That's irrelevant here.  At the stage of creating the summary buffer,
only the overview data are available, not all headers of each article.
My function doesn't show the indicator unless the corresponding
overview line contains "Content-Type: ...".

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: indicate email has attachment in summary buffer
  2006-08-03 23:41             ` Leon
@ 2006-08-05 15:47               ` Reiner Steib
  2006-08-05 19:00                 ` Leon
  0 siblings, 1 reply; 20+ messages in thread
From: Reiner Steib @ 2006-08-05 15:47 UTC (permalink / raw)


On Fri, Aug 04 2006, Leon wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>> On Thu, Aug 03 2006, Leon wrote:
>>> Actually I just met one such email. Gnus didn't show any attachment in
>>> article buffer, but thunderbird did. 
>>
>> What is the value of the Content-Type header of this mail?  E.g. if
>> someone sends[1] a PDF or an image without any accompanying text, you
>> might get application/pdf or image/jpeg.
>>
>
> Content-Type: multipart/mixed; boundary="===============1171174969=="

Then Gnus should show the indicator.  See my other reply WRT overview
vs. mail header: <news:v9wt9nb3ia.fsf@marauder.physik.uni-ulm.de>.

> I have also tried to send an email with only a pdf file. Thunderbird
> failed to show the 'paperclip' icon before reading the email. After I
> open the email, the icon is back.

Is it still available the next time (after restarting Thunderbird)
_before_ you open the mail?

>>> Is there any standard way of testing if an email has attachment?
>>
>> First you need to define the term "attachment" properly.
>>
> A lot of other email clients will show a `paperclip' icon for emails
> that have `attachment'. I'm looking for a similar behavior in gnus.

Yes, but I don't have the time to investigate what these other email
client do and how they define "attachment".

>> Footnotes: 
>> [1]  E.g.: mutt -s "this is the image" -a foo.jpg < /dev/null

mutt -s "this is the image" -a foo.jpg someone@invalid.invalid < /dev/null

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: indicate email has attachment in summary buffer
  2006-08-05 15:47               ` Reiner Steib
@ 2006-08-05 19:00                 ` Leon
  0 siblings, 0 replies; 20+ messages in thread
From: Leon @ 2006-08-05 19:00 UTC (permalink / raw)


Reiner Steib <reinersteib+gmane@imap.cc> writes:

> On Fri, Aug 04 2006, Leon wrote:
>
>> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>>> On Thu, Aug 03 2006, Leon wrote:
>>>> Actually I just met one such email. Gnus didn't show any attachment in
>>>> article buffer, but thunderbird did. 
>>>
>>> What is the value of the Content-Type header of this mail?  E.g. if
>>> someone sends[1] a PDF or an image without any accompanying text, you
>>> might get application/pdf or image/jpeg.
>>>
>>
>> Content-Type: multipart/mixed; boundary="===============1171174969=="
>
> Then Gnus should show the indicator.  See my other reply WRT overview
> vs. mail header: <news:v9wt9nb3ia.fsf@marauder.physik.uni-ulm.de>.
>
>> I have also tried to send an email with only a pdf file. Thunderbird
>> failed to show the 'paperclip' icon before reading the email. After I
>> open the email, the icon is back.
>
> Is it still available the next time (after restarting Thunderbird)
> _before_ you open the mail?

Yes.

>
>>>> Is there any standard way of testing if an email has attachment?
>>>
>>> First you need to define the term "attachment" properly.
>>>
>> A lot of other email clients will show a `paperclip' icon for emails
>> that have `attachment'. I'm looking for a similar behavior in gnus.
>
> Yes, but I don't have the time to investigate what these other email
> client do and how they define "attachment".
>

Thanks, Reiner. I can live with it.

>>> Footnotes: 
>>> [1]  E.g.: mutt -s "this is the image" -a foo.jpg < /dev/null
>
> mutt -s "this is the image" -a foo.jpg someone@invalid.invalid < /dev/null
>
> Bye, Reiner.

-- 
Leon

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

* Re: indicate email has attachment in summary buffer
  2006-08-03  7:04     ` Frank Schmitt
@ 2006-08-07 21:40       ` Reiner Steib
  0 siblings, 0 replies; 20+ messages in thread
From: Reiner Steib @ 2006-08-07 21:40 UTC (permalink / raw)


On Thu, Aug 03 2006, Frank Schmidt wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>
>>> This should be really easy for someone who knows some
>>> lisp. (Rainer? :-))
>>
>> s/ai/ei/ if you thought of me. ;-)
>
> Sorry. Call me Schmidt as revenge ;-)

;-)

>> ;; rs-gnus-summary.el -- Auxiliary summary mode commands for Gnus
>> [...]
>> ;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el
[...]
> This code is extremely useful. I would suggest adding it to No Gnus.

If someone (who has papers on file or is willing to sign papers)
volunteers to write the documentation, I could install some more stuff
from `rs-gnus-summary.el' in No Gnus.

I still have a backlog missing documentation of already committed
stuff in v5-10 and trunk.  Especially the following stuff should be
documented in the manual(s) before Emacs 22 will enter pretest:

,----[ v5-10 lisp/ChangeLog ]
| 2006-04-17  Reiner Steib  <Reiner.Steib@gmx.de>
| 
| 	[ Merge from Gnus trunk. ]
| 
| 	* mm-util.el (mm-charset-synonym-alist): Improve doc string.
| 	(mm-charset-override-alist): New variable.
| 	(mm-charset-to-coding-system): Use it.
| 	(mm-codepage-setup): New helper function.
| 	(mm-charset-eval-alist): New variable.
| 	(mm-charset-to-coding-system): Use mm-charset-eval-alist.  Warn
| 	about unknown charsets.  Add allow-override.  Use
| 	`mm-charset-override-alist' only when decoding.
| 	(mm-detect-mime-charset-region): Use :mime-charset.
| 
| 	* mm-bodies.el (mm-decode-body, mm-decode-string): Call
| 	`mm-charset-to-coding-system' with allow-override argument.
| 
| 	* message.el (message-tool-bar-zap-list, message-tool-bar)
| 	(message-tool-bar-gnome, message-tool-bar-retro): New variables.
| 	(message-tool-bar-local-item-from-menu): Remove.
| 	(message-tool-bar-map): Replace by `message-make-tool-bar'.
| 	(message-make-tool-bar): New function.
| 	(message-mode): Use `message-make-tool-bar'.
| 
| 	* gnus-sum.el (gnus-summary-tool-bar)
| 	(gnus-summary-tool-bar-gnome, gnus-summary-tool-bar-retro)
| 	(gnus-summary-tool-bar-zap-list): New variables.
| 	(gnus-summary-make-tool-bar): Complete rewrite using
| 	`gmm-tool-bar-from-list'.
| 
| 	* gnus-group.el (gnus-group-tool-bar, gnus-group-tool-bar-gnome)
| 	(gnus-group-tool-bar-retro, gnus-group-tool-bar-zap-list): New
| 	variables.
| 	(gnus-group-make-tool-bar): Complete rewrite using
| 	`gmm-tool-bar-from-list'.
| 	(gnus-group-tool-bar-update): New function.
| 
| 	* gmm-utils.el: New file.
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: indicate email has attachment in summary buffer
  2006-08-02 19:58   ` Reiner Steib
                       ` (2 preceding siblings ...)
       [not found]     ` <mailman.4799.1154608593.9609.info-gnus-english@gnu.org>
@ 2006-08-16  8:03     ` Svend Tollak Munkejord
  2008-10-15  5:03     ` Sebastian P. Luque
  4 siblings, 0 replies; 20+ messages in thread
From: Svend Tollak Munkejord @ 2006-08-16  8:03 UTC (permalink / raw)


On 2006-08-02, Reiner Steib <reinersteib+gmane@imap.cc> wrote:

> ;; rs-gnus-summary.el -- Auxiliary summary mode commands for Gnus
> [...]
> ;; X-URL: http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el

Thank you very much for this, it's very nice!

I have one small problem though: The arrows remain black, even if the
rest of the summary line has another color, e.g., it turns red for
ticked messages, blue for old ones, etc.

This is what I did:

(require 'rs-gnus-summary)
(rs-gnus-summary-line-initialize)
(rs-gnus-summary-tree-arrows-latin)

and I use the 1 May edition of ngnus.

Is there another switch that I should have turned on?

Regards,
-- 
Svend Tollak Munkejord 

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

* Re: indicate email has attachment in summary buffer
  2006-08-02 19:58   ` Reiner Steib
                       ` (3 preceding siblings ...)
  2006-08-16  8:03     ` Svend Tollak Munkejord
@ 2008-10-15  5:03     ` Sebastian P. Luque
  4 siblings, 0 replies; 20+ messages in thread
From: Sebastian P. Luque @ 2008-10-15  5:03 UTC (permalink / raw)
  To: info-gnus-english


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

On Wed, 02 Aug 2006 21:58:44 +0200,
Reiner Steib <reinersteib+gmane@imap.cc> wrote:

[...]

> ;; rs-gnus-summary.el -- Auxiliary summary mode commands for Gnus
> [...]  ;; X-URL:
> http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/rs-gnus-summary.el

[...]

Is there an alternative to this approach to showing the content type of
the message in the summary line specification?  Rainer's library seems
relevant, but only would like to use the ability to have a format
specification in the summary line for the content type.  Thanks.


Cheers,

-- 
Seb

[-- Attachment #1.2: Type: application/pgp-signature, Size: 196 bytes --]

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

_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
http://lists.gnu.org/mailman/listinfo/info-gnus-english

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

end of thread, other threads:[~2008-10-15  5:03 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-02 18:41 indicate email has attachment in summary buffer Leon
2006-08-02 19:13 ` Frank Schmitt
2006-08-02 19:58   ` Reiner Steib
2006-08-03  7:04     ` Frank Schmitt
2006-08-07 21:40       ` Reiner Steib
2006-08-03 11:49     ` Leon
2006-08-03 18:09       ` Reiner Steib
2006-08-03 19:28         ` Leon
2006-08-03 22:26           ` Reiner Steib
2006-08-03 23:41             ` Leon
2006-08-05 15:47               ` Reiner Steib
2006-08-05 19:00                 ` Leon
2006-08-04 12:01       ` Leon
2006-08-04 14:54         ` Reiner Steib
2006-08-04 17:08           ` Leon
2006-08-05 15:34             ` Reiner Steib
     [not found]     ` <mailman.4799.1154608593.9609.info-gnus-english@gnu.org>
2006-08-05  4:10       ` John Sullivan
2006-08-16  8:03     ` Svend Tollak Munkejord
2008-10-15  5:03     ` Sebastian P. Luque
2006-08-03 11:46   ` Leon

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