Gnus development mailing list
 help / color / mirror / Atom feed
* Unable to change mailcap entry.
@ 2000-04-24  1:33 Lloyd Zusman
  2000-04-24  5:37 ` Logic error found in mailcap.el (was: Unable to change mailcap entry.) Lloyd Zusman
  0 siblings, 1 reply; 6+ messages in thread
From: Lloyd Zusman @ 2000-04-24  1:33 UTC (permalink / raw)


I'm using the latest (or near-latest) CVS gnus.

For the first time in a couple weeks or so, I tried to view a MIME
image (image/jpeg) that was sent to me ... but now, gnus is trying to
use `ee' as the viewer.  I don't have `ee' and have always used
`display' or `xv' for image viewing in the past.

I'd like to handle this from within `.gnus.el', and so I put the
following into that file:

  (require 'mailcap)

  (mailcap-add-mailcap-entry "image" "jpeg"
			     '((viewer . "xv %s")
			       (type . "image/jpeg")))

... but this has no effect.

The only `mailcap' file on my system is `/etc/mailcap' and it contains
the following entry:

  image/*; /usr/local/bin/display %s

There is no reference to `ee' anywhere on my system except within the
`mailcap.el' gnus source file (it's within an entry in the
`mailcap-mime-data' assoc).

What can I put into `.gnus.el' to force gnus to override `ee' as the
image viewer?

Thanks in advance.

-- 
 Lloyd Zusman
 ljz@asfast.com



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

* Logic error found in mailcap.el (was: Unable to change mailcap entry.)
  2000-04-24  1:33 Unable to change mailcap entry Lloyd Zusman
@ 2000-04-24  5:37 ` Lloyd Zusman
  2000-04-24  6:27   ` Shenghuo ZHU
  0 siblings, 1 reply; 6+ messages in thread
From: Lloyd Zusman @ 2000-04-24  5:37 UTC (permalink / raw)


Lloyd Zusman <ljz@asfast.com> writes:

> I'm using the latest (or near-latest) CVS gnus.
> 
> For the first time in a couple weeks or so, I tried to view a MIME
> image (image/jpeg) that was sent to me ... but now, gnus is trying to
> use `ee' as the viewer.  I don't have `ee' and have always used
> `display' or `xv' for image viewing in the past.
> 
> I'd like to handle this from within `.gnus.el', and so I put the
> following into that file:
> 
>   (require 'mailcap)
> 
>   (mailcap-add-mailcap-entry "image" "jpeg"
> 			     '((viewer . "xv %s")
> 			       (type . "image/jpeg")))
> 
> ... but this has no effect.


I've been fooling around, and now I understand the problem better.  I
have hacked a temporary solution so I can continue to use gnus the way
I like.  However, something needs to be changed, and I have an idea
of what it is.

First of all, this is my temporary hack for `.gnus.el' ...

  (require 'mailcap)

  (remassoc ".*" (assoc "image" mailcap-mime-data))

  (mailcap-add-mailcap-entry "image" ".*"
			     '((viewer . "xv %s")
			       (type . "image/*")))

I'm not surprised that this works, given that it uses a rather healthy
amount of brute force to remove the existing `ee' entry from
`mailcap-mime-data' before adding my new entry ... along with all the
other image-viewing possibilities.


After digging around, I found out what is wrong: if there are multiple
passing matches for a major/minor combination, the *last* valid match
is always used; however, `mailcap-add-mailcap-entry' always puts the
new entries *first*, thereby causing them to be ignored in the 
multiple-passing-matches case.


My guess is that the solution should be either that ...

... one or more of the `(nreverse passed)' calls should be
    removed from within the `mailcap-mime-info' function in
    `mailcap.el'

... or that one or more of the `(car passed)' calls should be
    `(car (last passed))' in this `mailcap-mime-info' function

... or that the final line of the `mailcap-add-mailcap-entry'
    in this same file should be changed to read:

       (setcdr old-major (cons (cdr old-major) (cons minor info)))))))))

... or perhaps something else along these same lines which would cause
    newly added entries to not be skipped


Thoughts?


-- 
 Lloyd Zusman
 ljz@asfast.com



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

* Re: Logic error found in mailcap.el (was: Unable to change mailcap entry.)
  2000-04-24  5:37 ` Logic error found in mailcap.el (was: Unable to change mailcap entry.) Lloyd Zusman
@ 2000-04-24  6:27   ` Shenghuo ZHU
  2000-04-24 14:36     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Shenghuo ZHU @ 2000-04-24  6:27 UTC (permalink / raw)


>>>>> "Lloyd" == Lloyd Zusman <ljz@asfast.com> writes:

Lloyd> My guess is that the solution should be either that ...

Lloyd> ... one or more of the `(nreverse passed)' calls should be
Lloyd>     removed from within the `mailcap-mime-info' function in
Lloyd>     `mailcap.el'

Lloyd> ... or that one or more of the `(car passed)' calls should be
Lloyd>     `(car (last passed))' in this `mailcap-mime-info' function

Lloyd> ... or that the final line of the `mailcap-add-mailcap-entry'
Lloyd>     in this same file should be changed to read:

Lloyd>        (setcdr old-major (cons (cdr old-major) (cons minor info)))))))))

Lloyd> ... or perhaps something else along these same lines which would cause
Lloyd>     newly added entries to not be skipped

Lloyd> Thoughts?

Another problem is that Gnus builtin mailcap overrides ~/.mailcap and
others.  I don't think this is right.

My suggestion is removing the nreverse calls, parsing mailcap file
backwards, and adjusting the file order in mailcap-parse-mailcaps.

BTW, the default mailcap file order for ms-windows is reversed.

-- 
Shenghuo



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

* Re: Logic error found in mailcap.el (was: Unable to change mailcap entry.)
  2000-04-24  6:27   ` Shenghuo ZHU
@ 2000-04-24 14:36     ` Lars Magne Ingebrigtsen
  2000-04-24 19:47       ` Shenghuo ZHU
  0 siblings, 1 reply; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2000-04-24 14:36 UTC (permalink / raw)


Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> Another problem is that Gnus builtin mailcap overrides ~/.mailcap and
> others.  I don't think this is right.
> 
> My suggestion is removing the nreverse calls, parsing mailcap file
> backwards, and adjusting the file order in mailcap-parse-mailcaps.

Hm, yes, that sounds like a good solution...

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



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

* Re: Logic error found in mailcap.el (was: Unable to change mailcap entry.)
  2000-04-24 14:36     ` Lars Magne Ingebrigtsen
@ 2000-04-24 19:47       ` Shenghuo ZHU
  2000-04-24 20:04         ` Lloyd Zusman
  0 siblings, 1 reply; 6+ messages in thread
From: Shenghuo ZHU @ 2000-04-24 19:47 UTC (permalink / raw)


>>>>> "LMI" == Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

LMI> Shenghuo ZHU <zsh@cs.rochester.edu> writes:
>> Another problem is that Gnus builtin mailcap overrides ~/.mailcap and
>> others.  I don't think this is right.
>> 
>> My suggestion is removing the nreverse calls, parsing mailcap file
>> backwards, and adjusting the file order in mailcap-parse-mailcaps.

LMI> Hm, yes, that sounds like a good solution...

Fixed. Please test.

-- 
Shenghuo



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

* Re: Logic error found in mailcap.el (was: Unable to change mailcap entry.)
  2000-04-24 19:47       ` Shenghuo ZHU
@ 2000-04-24 20:04         ` Lloyd Zusman
  0 siblings, 0 replies; 6+ messages in thread
From: Lloyd Zusman @ 2000-04-24 20:04 UTC (permalink / raw)


Shenghuo ZHU <zsh@cs.rochester.edu> writes:

> >>>>> "LMI" == Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> 
> LMI> Shenghuo ZHU <zsh@cs.rochester.edu> writes:
> >> Another problem is that Gnus builtin mailcap overrides ~/.mailcap and
> >> others.  I don't think this is right.
> >> 
> >> My suggestion is removing the nreverse calls, parsing mailcap file
> >> backwards, and adjusting the file order in mailcap-parse-mailcaps.
> 
> LMI> Hm, yes, that sounds like a good solution...
> 
> Fixed. Please test.

Yep ... seems to be fine now: `mailcap-add-mailcap-entry' within
`.gnus.el' actually works, and `/etc/mailcap' entries indeed override
the gnus defaults as well as `mailcap-add-mailcap-entry' calls within
`.gnus.el'.

I believe that this is exactly what it's supposed to do.

Thanks!

-- 
 Lloyd Zusman
 ljz@asfast.com



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

end of thread, other threads:[~2000-04-24 20:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-24  1:33 Unable to change mailcap entry Lloyd Zusman
2000-04-24  5:37 ` Logic error found in mailcap.el (was: Unable to change mailcap entry.) Lloyd Zusman
2000-04-24  6:27   ` Shenghuo ZHU
2000-04-24 14:36     ` Lars Magne Ingebrigtsen
2000-04-24 19:47       ` Shenghuo ZHU
2000-04-24 20:04         ` Lloyd Zusman

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