Gnus development mailing list
 help / color / mirror / Atom feed
* Not prompting user in gnus-mime-delete-part and gnus-mime-save-part-and-strip
@ 2005-08-26 12:23 Reiner Steib
  2005-08-27 20:57 ` Not prompting user in gnus-mime-delete-part and Dan Christensen
  0 siblings, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-08-26 12:23 UTC (permalink / raw)


Hi,

I'd like to have an option in Gnus to get rid of the prompt "Deleting
parts may malfunction or destroy the article; continue?" when deleting
or stripping attachments.

My first idea [1] was to skip the prompt when `gnus-expert-user' is
non-nil, but it's doc string says:

,----[ C-h v gnus-expert-user RET ]
| gnus-expert-user's value is t
| 
| *Non-nil means that you will never be asked for confirmation about anything.
| That doesn't mean *anything* anything; particularly destructive
| commands will still require prompting.
`----

Deleting parts is destructive of course, but not more destructive than
`gnus-summary-delete-article'.  Should I add a separately variable,
say `gnus-interactive-delete' instead or use `gnus-expert-user'?

,----[ C-h v gnus-interactive-delete RET ]
| gnus-interactive-delete's value is t
| 
| If non-nil, require your confirmation deleting or stripping mime parts
| 
| You can customize this variable.
`----

Bye, Reiner.

[1]
--8<---------------cut here---------------start------------->8---
--- gnus-art.el	26 Aug 2005 00:05:03 -0000	7.111
+++ gnus-art.el	26 Aug 2005 12:14:16 -0000
@@ -4147,8 +4147,9 @@
   (when (mm-complicated-handles gnus-article-mime-handles)
     (error "\
 The current article has a complicated MIME structure, giving up..."))
-  (when (gnus-yes-or-no-p "\
-Deleting parts may malfunction or destroy the article; continue? ")
+  (when (or gnus-expert-user
+	    (gnus-yes-or-no-p "\
+Deleting parts may malfunction or destroy the article; continue? "))
     (let* ((data (get-text-property (point) 'gnus-data))
 	   file param
 	   (handles gnus-article-mime-handles))
@@ -4181,8 +4182,9 @@
   (when (mm-complicated-handles gnus-article-mime-handles)
     (error "\
 The current article has a complicated MIME structure, giving up..."))
-  (when (gnus-yes-or-no-p "\
-Deleting parts may malfunction or destroy the article; continue? ")
+  (when (or gnus-expert-user
+	    (gnus-yes-or-no-p "\
+Deleting parts may malfunction or destroy the article; continue? "))
     (let* ((data (get-text-property (point) 'gnus-data))
 	   (handles gnus-article-mime-handles)
 	   (none "(none)")
--8<---------------cut here---------------end--------------->8---
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




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

* Re: Not prompting user in gnus-mime-delete-part and
  2005-08-26 12:23 Not prompting user in gnus-mime-delete-part and gnus-mime-save-part-and-strip Reiner Steib
@ 2005-08-27 20:57 ` Dan Christensen
  2005-08-28  0:32   ` Katsumi Yamaoka
  2005-08-28 12:40   ` Imroving deleting/stripping MIME parts (was: Not prompting user in gnus-mime-delete-part and) Reiner Steib
  0 siblings, 2 replies; 24+ messages in thread
From: Dan Christensen @ 2005-08-27 20:57 UTC (permalink / raw)


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

> I'd like to have an option in Gnus to get rid of the prompt "Deleting
> parts may malfunction or destroy the article; continue?" when deleting
> or stripping attachments.

I'd suggest just getting rid of that question (which is how this
function used to behave).  The user still needs to specify the
filename, and that prompt could be changed to read

  Delete MIME part and save to:

The user can hit C-g at this point to abort.

While we're discussing this function, it would be nice if point
stayed in the *Article* buffer after this was complete, making
it easier to tab to the next MIME part and strip it.

Dan



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

* Re: Not prompting user in gnus-mime-delete-part and
  2005-08-27 20:57 ` Not prompting user in gnus-mime-delete-part and Dan Christensen
@ 2005-08-28  0:32   ` Katsumi Yamaoka
  2005-08-28 12:49     ` Reiner Steib
  2005-08-28 12:40   ` Imroving deleting/stripping MIME parts (was: Not prompting user in gnus-mime-delete-part and) Reiner Steib
  1 sibling, 1 reply; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-08-28  0:32 UTC (permalink / raw)


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

>> I'd like to have an option in Gnus to get rid of the prompt "Deleting
>> parts may malfunction or destroy the article; continue?" when deleting
>> or stripping attachments.

>>>>> In <87r7cfxfma.fsf@uwo.ca>
>>>>>	Dan Christensen <jdc@uwo.ca> wrote:

> I'd suggest just getting rid of that question (which is how this
> function used to behave).

That message is an excuse to the function not being perfect, and
there's not much likelihood that it will be completed.
It will simply not work or really break articles if they have
complex MIME structure, e.g., the case that a part is in a
forwarded forwarded message.

But I also feel that message is noisy, so I agree to get rid of it.
I think another way is required for saying it is imperfect, though.



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

* Imroving deleting/stripping MIME parts (was: Not prompting user in gnus-mime-delete-part and)
  2005-08-27 20:57 ` Not prompting user in gnus-mime-delete-part and Dan Christensen
  2005-08-28  0:32   ` Katsumi Yamaoka
@ 2005-08-28 12:40   ` Reiner Steib
  2005-08-29 14:57     ` Imroving deleting/stripping MIME parts Reiner Steib
  1 sibling, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-08-28 12:40 UTC (permalink / raw)


On Sat, Aug 27 2005, Dan Christensen wrote:

> While we're discussing this function, it would be nice if point
> stayed in the *Article* buffer after this was complete, making
> it easier to tab to the next MIME part and strip it.

I agree that stripping/deleting several parts with Gnus is painful.
I've implemented (but not yet committed) some improvements in this
area:

,----[ C-h v gnus-auto-advance-part RET ]
| gnus-auto-advance-part's value is 1
| 
| Advance to next MIME part when deleting or stripping parts.
| 
| When 0, point will be placed on the same part as before.  When
| positive (negative), move point forward (backwards) this many
| parts.  When nil, redisplay article.
`----

With this value, you can delete several parts by using `d' repeatedly.

Additionally I'd like to add `K O' (gnus-article-save-part-and-strip)
and `K d' (gnus-article-delete-part) making it easier to strip or
delete parts using a prefix argument:

,----[ C-h f gnus-article-save-part-and-strip RET ]
| gnus-article-save-part-and-strip is an interactive Lisp function [...].
| (gnus-article-save-part-and-strip n)
| 
| Save MIME part n and replace it with an external body.
| n is the numerical prefix.
`----

,----[ C-h f gnus-article-delete-part RET ]
| gnus-article-delete-part is an interactive Lisp function [...].
| (gnus-article-delete-part n)
| 
| Delete MIME part n and add some information about the removed part.
| n is the numerical prefix.
`----

A function like `gnus-summary-save-parts' (`X m', `<MIME> <Extract all
parts...>') but with stripping would also be nice.

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




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

* Re: Not prompting user in gnus-mime-delete-part and
  2005-08-28  0:32   ` Katsumi Yamaoka
@ 2005-08-28 12:49     ` Reiner Steib
  2005-08-29  0:19       ` Katsumi Yamaoka
  0 siblings, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-08-28 12:49 UTC (permalink / raw)


On Sun, Aug 28 2005, Katsumi Yamaoka wrote:

>> Reiner Steib <reinersteib+gmane@imap.cc> writes:
>
>>> I'd like to have an option in Gnus to get rid of the prompt "Deleting
>>> parts may malfunction or destroy the article; continue?" when deleting
>>> or stripping attachments.
>
>>>>>> In <87r7cfxfma.fsf@uwo.ca>
>>>>>>	Dan Christensen <jdc@uwo.ca> wrote:
>
>> I'd suggest just getting rid of that question (which is how this
>> function used to behave).
>
> That message is an excuse to the function not being perfect, and
> there's not much likelihood that it will be completed.
> It will simply not work or really break articles if they have
> complex MIME structure, e.g., the case that a part is in a
> forwarded forwarded message.

Does the `mm-complicated-handles'-check cover all those cases?

> But I also feel that message is noisy, so I agree to get rid of it.
> I think another way is required for saying it is imperfect, though.

We could put a warning into the doc strings and the manual.

>> The user still needs to specify the filename, and that prompt could
>> be changed to read
>> 
>>   Delete MIME part and save to:
>> 
>> The user can hit C-g at this point to abort.

But not for `gnus-mime-delete-part'.  Accidentally pressing `d' on a
MIME part instead in the Summary buffer or the rest of the Article
buffer gives quite different results:
`gnus-summary-mark-as-read-forward' vs. `gnus-mime-delete-part'.

How about using the `gnus-expert-user' approach for
`gnus-mime-delete-part' and getting rid of the prompt completely for
`gnus-mime-save-part-and-strip'?

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




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

* Re: Not prompting user in gnus-mime-delete-part and
  2005-08-28 12:49     ` Reiner Steib
@ 2005-08-29  0:19       ` Katsumi Yamaoka
  2005-08-29 14:53         ` Reiner Steib
  2005-08-30  2:25         ` Dan Christensen
  0 siblings, 2 replies; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-08-29  0:19 UTC (permalink / raw)


>>>>> In <v93bou5ir0.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

> On Sun, Aug 28 2005, Katsumi Yamaoka wrote:

>> That message is an excuse to the function not being perfect, and
>> there's not much likelihood that it will be completed.
>> It will simply not work or really break articles if they have
>> complex MIME structure, e.g., the case that a part is in a
>> forwarded forwarded message.

> Does the `mm-complicated-handles'-check cover all those cases?

Yes, maybe.  (Although my worry is that it may also return `t'
even for some MIME structure which won't cause a problem, it
might be a needless fear since most of MIME composers cannot
make such a complex structure.  Anyway, it is irrelevant to your
proposal.)

>> But I also feel that message is noisy, so I agree to get rid of it.
>> I think another way is required for saying it is imperfect, though.

> We could put a warning into the doc strings and the manual.

I agree.

[...]

> How about using the `gnus-expert-user' approach for
> `gnus-mime-delete-part' and getting rid of the prompt completely for
> `gnus-mime-save-part-and-strip'?

I agree to do so, assuming those who set `gnus-expert-user' know
what they do.



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

* Re: Not prompting user in gnus-mime-delete-part and
  2005-08-29  0:19       ` Katsumi Yamaoka
@ 2005-08-29 14:53         ` Reiner Steib
  2005-08-30  1:36           ` Katsumi Yamaoka
  2005-08-30  2:25         ` Dan Christensen
  1 sibling, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-08-29 14:53 UTC (permalink / raw)


On Mon, Aug 29 2005, Katsumi Yamaoka wrote:

>>>>>> In <v93bou5ir0.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:
>
>> On Sun, Aug 28 2005, Katsumi Yamaoka wrote:
>
>>> That message is an excuse to the function not being perfect, and
>>> there's not much likelihood that it will be completed.
>>> It will simply not work or really break articles if they have
>>> complex MIME structure, e.g., the case that a part is in a
>>> forwarded forwarded message.
>
>> Does the `mm-complicated-handles'-check cover all those cases?
>
> Yes, maybe.  (Although my worry is that it may also return `t'
> even for some MIME structure which won't cause a problem, it
> might be a needless fear since most of MIME composers cannot
> make such a complex structure.

Would it make sense to allow deleting/stripping despite of
"complicated handles" after an additional prompt instead of "giving
up"?

>> We could put a warning into the doc strings and the manual.
>
> I agree.

Would you like to add the warnings?

>> How about using the `gnus-expert-user' approach for
>> `gnus-mime-delete-part' and getting rid of the prompt completely for
>> `gnus-mime-save-part-and-strip'?
>
> I agree to do so, 

I've installed it.

> assuming those who set `gnus-expert-user' know what they do.

,----[ (info "(gnus)Splitting Mail") ]
| Gnus gives you all the opportunity you could possibly want for
| shooting yourself in the foot.
`----

:-)

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




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

* Re: Imroving deleting/stripping MIME parts
  2005-08-28 12:40   ` Imroving deleting/stripping MIME parts (was: Not prompting user in gnus-mime-delete-part and) Reiner Steib
@ 2005-08-29 14:57     ` Reiner Steib
  2005-08-30  2:22       ` Dan Christensen
  0 siblings, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-08-29 14:57 UTC (permalink / raw)


On Sun, Aug 28 2005, Reiner Steib wrote:

> On Sat, Aug 27 2005, Dan Christensen wrote:
>
>> While we're discussing this function, it would be nice if point
>> stayed in the *Article* buffer after this was complete, making
>> it easier to tab to the next MIME part and strip it.
>
> I agree that stripping/deleting several parts with Gnus is painful.
> I've implemented (but not yet committed) some improvements in this
> area:
>
> ,----[ C-h v gnus-auto-advance-part RET ]
> | gnus-auto-advance-part's value is 1
[...]
> With this value, you can delete several parts by using `d' repeatedly.

(... if `gnus-expert-user' is t.)  Added.

Sometimes point didn't move to the next part during my test.  I
couldn't figure out what's wrong.

> Additionally I'd like to add `K O' (gnus-article-save-part-and-strip)
> and `K d' (gnus-article-delete-part) making it easier to strip or
> delete parts using a prefix argument:

Added.

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




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

* Re: Not prompting user in gnus-mime-delete-part and
  2005-08-29 14:53         ` Reiner Steib
@ 2005-08-30  1:36           ` Katsumi Yamaoka
  0 siblings, 0 replies; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-08-30  1:36 UTC (permalink / raw)


>>>>> In <v9fysszteu.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

> On Mon, Aug 29 2005, Katsumi Yamaoka wrote:

>> Yes, maybe.  (Although my worry is that it may also return `t'
>> even for some MIME structure which won't cause a problem, it
>> might be a needless fear since most of MIME composers cannot
>> make such a complex structure.

> Would it make sense to allow deleting/stripping despite of
> "complicated handles" after an additional prompt instead of "giving
> up"?

Well, although I didn't test all the cases, I remember vaguely
that some kind of article had broken.  So, I'm rather negative
to do so.

>>> We could put a warning into the doc strings and the manual.
>>
>> I agree.

> Would you like to add the warnings?

Now I think it is not necessary for the present code.  It might
become a new FAQ item, though.  When I tried to improve it and
failed, I considered we might need to rewrite the MIME display
engine wholly (yuck!).



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

* Re: Imroving deleting/stripping MIME parts
  2005-08-29 14:57     ` Imroving deleting/stripping MIME parts Reiner Steib
@ 2005-08-30  2:22       ` Dan Christensen
  2005-08-30 13:04         ` Reiner Steib
  0 siblings, 1 reply; 24+ messages in thread
From: Dan Christensen @ 2005-08-30  2:22 UTC (permalink / raw)


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

> On Sun, Aug 28 2005, Reiner Steib wrote:
>
>> On Sat, Aug 27 2005, Dan Christensen wrote:
>>
>>> While we're discussing this function, it would be nice if point
>>> stayed in the *Article* buffer after this was complete, making
>>> it easier to tab to the next MIME part and strip it.
>>
>> I agree that stripping/deleting several parts with Gnus is painful.
>> I've implemented (but not yet committed) some improvements in this
>> area:
>>
>> ,----[ C-h v gnus-auto-advance-part RET ]
>> | gnus-auto-advance-part's value is 1
> [...]
>> With this value, you can delete several parts by using `d' repeatedly.
>
> (... if `gnus-expert-user' is t.)  Added.

Thanks for adding this.  For the record, you seem to have named
the variable gnus-auto-select-part.

This works well in my (limited) tests.

>> Additionally I'd like to add `K O' (gnus-article-save-part-and-strip)
>> and `K d' (gnus-article-delete-part) making it easier to strip or
>> delete parts using a prefix argument:
>
> Added.

While in the summary buffer, typing `2 K d' did the right thing.
But `2 K O' gave an error message, 

  gnus-mime-delete-part: No MIME part under point

Dan



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

* Re: Not prompting user in gnus-mime-delete-part and
  2005-08-29  0:19       ` Katsumi Yamaoka
  2005-08-29 14:53         ` Reiner Steib
@ 2005-08-30  2:25         ` Dan Christensen
  2005-08-30  6:07           ` Katsumi Yamaoka
  1 sibling, 1 reply; 24+ messages in thread
From: Dan Christensen @ 2005-08-30  2:25 UTC (permalink / raw)
  Cc: Katsumi Yamaoka

Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>>>>> In <v93bou5ir0.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:
>
>> On Sun, Aug 28 2005, Katsumi Yamaoka wrote:
>
>>> That message is an excuse to the function not being perfect, and
>>> there's not much likelihood that it will be completed.
>>> It will simply not work or really break articles if they have
>>> complex MIME structure, e.g., the case that a part is in a
>>> forwarded forwarded message.
>
>>> But I also feel that message is noisy, so I agree to get rid of it.
>>> I think another way is required for saying it is imperfect, though.

Thanks to whoever got rid of that message.  I use this strip-and-save
method a lot, so this makes things much nicer.

BTW, I think the prompt should change from

  Save MIME part to:

to

  Delete MIME part and save to:

Dan



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

* Re: Not prompting user in gnus-mime-delete-part and
  2005-08-30  2:25         ` Dan Christensen
@ 2005-08-30  6:07           ` Katsumi Yamaoka
  0 siblings, 0 replies; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-08-30  6:07 UTC (permalink / raw)


>>>>> In <878xyk88kw.fsf@uwo.ca> Dan Christensen wrote:

> BTW, I think the prompt should change from

>   Save MIME part to:

> to

>   Delete MIME part and save to:

That's a good idea.  I've realized it.  Thanks.



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

* Re: Imroving deleting/stripping MIME parts
  2005-08-30  2:22       ` Dan Christensen
@ 2005-08-30 13:04         ` Reiner Steib
  2005-08-30 15:25           ` Dan Christensen
  0 siblings, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-08-30 13:04 UTC (permalink / raw)


On Tue, Aug 30 2005, Dan Christensen wrote:

> For the record, you seem to have named the variable
> gnus-auto-select-part.

Yes, I though something with "select" is more common in Gnus and is
more accurate (values <= 0).  Suggestions for more suitable names are
welcome.

> While in the summary buffer, typing `2 K d' did the right thing.
> But `2 K O' gave an error message, 
>
>   gnus-mime-delete-part: No MIME part under point

I think if you try with the same article as the one where you tried `2
K d', `2 K O' should work, too.  (Maybe you have a backup around?
Then you could `B c' the article to a test group and experiment with
it.)

But, as I wrote in my previous message, moving to the right part also
fails for me in some cases...

,----
| Sometimes point didn't move to the next part during my test.  I
| couldn't figure out what's wrong.
`----

I suspect that `gnus-article-goto-part' doesn't work for certain
articles/parts.

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




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

* Re: Imroving deleting/stripping MIME parts
  2005-08-30 13:04         ` Reiner Steib
@ 2005-08-30 15:25           ` Dan Christensen
  2005-08-30 16:44             ` Reiner Steib
  0 siblings, 1 reply; 24+ messages in thread
From: Dan Christensen @ 2005-08-30 15:25 UTC (permalink / raw)


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

> On Tue, Aug 30 2005, Dan Christensen wrote:
>
>> While in the summary buffer, typing `2 K d' did the right thing.
>> But `2 K O' gave an error message, 
>>
>>   gnus-mime-delete-part: No MIME part under point
>
> I think if you try with the same article as the one where you tried `2
> K d', `2 K O' should work, too.  

It was the same article.  I actually tried `2 K O' first, and it
failed.  Then I tried `2 K d' and it worked.

But now I can't reproduce this!  Ahh, maybe I hadn't selected
the article?  It looks like `K O' acts on whatever is in the
*Article* buffer rather than on whatever article point is on
in the *Summary* buffer.  I think most commands act on the
article under point, don't they?  So many this command should
select the article first?

Dan



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

* Re: Imroving deleting/stripping MIME parts
  2005-08-30 15:25           ` Dan Christensen
@ 2005-08-30 16:44             ` Reiner Steib
  2005-08-31  4:18               ` Katsumi Yamaoka
  0 siblings, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-08-30 16:44 UTC (permalink / raw)


On Tue, Aug 30 2005, Dan Christensen wrote:

> Reiner Steib <reinersteib+gmane@imap.cc> writes:
[...]
>> I think if you try with the same article as the one where you tried `2
>> K d', `2 K O' should work, too.  
>
> It was the same article.  I actually tried `2 K O' first, and it
> failed.  Then I tried `2 K d' and it worked.
>
> But now I can't reproduce this!  Ahh, maybe I hadn't selected
> the article?  It looks like `K O' acts on whatever is in the
> *Article* buffer rather than on whatever article point is on
> in the *Summary* buffer.  I think most commands act on the
> article under point, don't they?  So many this command should
> select the article first?

WRT this, `K O' and `K d' behave like the other `K ...' commands
(gnus-article-pipe-part, gnus-article-inline-part).

We could add `gnus-summary-show-article' in
`gnus-article-part-wrapper' to display the right article:

--8<---------------cut here---------------start------------->8---
--- gnus-art.el	30 Aug 2005 14:05:01 +0200	7.117
+++ gnus-art.el	30 Aug 2005 18:31:56 +0200	
@@ -4516,6 +4516,7 @@
 	(funcall (cdr action-pair)))))
 
 (defun gnus-article-part-wrapper (n function &optional no-handle)
+  (gnus-summary-show-article)
   (with-current-buffer gnus-article-buffer
     (when (> n (length gnus-article-mime-handle-alist))
       (error "No such part"))
--8<---------------cut here---------------end--------------->8---

But I'm not sure if the _not_ selecting the article was intended
behavior (i.e. this change might break other usage).  Opinions?

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




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

* Re: Imroving deleting/stripping MIME parts
  2005-08-30 16:44             ` Reiner Steib
@ 2005-08-31  4:18               ` Katsumi Yamaoka
  2005-08-31 10:26                 ` Reiner Steib
  0 siblings, 1 reply; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-08-31  4:18 UTC (permalink / raw)


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

>>>>> In <v964tn7f0f.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

> I suspect that `gnus-article-goto-part' doesn't work for certain
> articles/parts.

I suspect too.  I surely experienced the `No MIME part under
point' problem, but now I cannot reproduce it with the same
article.  Hmm...

>>>>> In <v9k6i3e5np.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

> We could add `gnus-summary-show-article' in
> `gnus-article-part-wrapper' to display the right article:

>  (defun gnus-article-part-wrapper (n function &optional no-handle)
> +  (gnus-summary-show-article)

> But I'm not sure if the _not_ selecting the article was intended
> behavior (i.e. this change might break other usage).  Opinions?

It seems that it should not work when the article is not visible
or it is not the right article.  However, I think redisplaying
of the article is needed for the other reason.

I'd like to propose adding two features.  The following
definition displays all the MIME buttons even if
`gnus-inhibit-mime-unbuttonizing' is nil (which is the default),
and specifies which part the user is going to manipulate.  How
about it?


[-- Attachment #2: Type: application/emacs-lisp, Size: 1415 bytes --]

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

* Re: Imroving deleting/stripping MIME parts
  2005-08-31  4:18               ` Katsumi Yamaoka
@ 2005-08-31 10:26                 ` Reiner Steib
  2005-08-31 11:11                   ` Katsumi Yamaoka
  0 siblings, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-08-31 10:26 UTC (permalink / raw)


On Wed, Aug 31 2005, Katsumi Yamaoka wrote:

> I'd like to propose adding two features.  The following
> definition displays all the MIME buttons even if
> `gnus-inhibit-mime-unbuttonizing' is nil (which is the default),
> and specifies which part the user is going to manipulate.  How
> about it?

> (defun gnus-article-part-wrapper (n function &optional no-handle)
>   (let (window redisplay)
>     ;; Check whether the article is displayed.
>     (unless (and (gnus-buffer-live-p gnus-article-buffer)
> 		 (setq window (get-buffer-window gnus-article-buffer t))
> 		 (frame-visible-p (window-frame window)))
>       (error "No article is displayed"))
>     ;; Check whether the article displays the right contents.
>     (unless (with-current-buffer gnus-article-buffer
> 	      (with-current-buffer gnus-summary-buffer
> 		(eq gnus-current-article (gnus-summary-article-number))))
>       (error "You should select the right article first"))
>     ;; Make sure all the MIME buttons are visible.
>     (unless gnus-inhibit-mime-unbuttonizing
>       (setq redisplay t)
>       (let ((gnus-inhibit-mime-unbuttonizing t))
> 	(gnus-summary-show-article)))
>     (save-window-excursion
>       (select-window window)
>       (when (> n (length gnus-article-mime-handle-alist))
> 	(error "No such part"))
>       (gnus-article-goto-part n)
>       (let ((cursor-in-non-selected-windows t) ;; Display cursor.
> 	    (overlay-arrow-string "=>") ;; Display arrow.
> 	    (overlay-arrow-position (point-marker)))

Could you explain why these variables are useful here?  (I don't see
any arrows.)

> 	(unwind-protect
> 	    (if no-handle
> 		(funcall function)
> 	      (let ((handle (cdr (assq n gnus-article-mime-handle-alist))))
> 		(funcall function handle)))
> 	  (set-marker overlay-arrow-position nil)
> 	  (when redisplay
> 	    (gnus-summary-show-article)))))))

This additional `gnus-summary-show-article' after the funcall breaks
commands like `3 K i'.  See
e.g. <news:v9ll2il854.fsf@marauder.physik.uni-ulm.de> in gmane.test.

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




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

* Re: Imroving deleting/stripping MIME parts
  2005-08-31 10:26                 ` Reiner Steib
@ 2005-08-31 11:11                   ` Katsumi Yamaoka
  2005-09-01  5:29                     ` Katsumi Yamaoka
  0 siblings, 1 reply; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-08-31 11:11 UTC (permalink / raw)


>>>>> In <v9ek8al7vj.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

> On Wed, Aug 31 2005, Katsumi Yamaoka wrote:

>> I'd like to propose adding two features.  The following
>> definition displays all the MIME buttons even if
>> `gnus-inhibit-mime-unbuttonizing' is nil (which is the default),
>> and specifies which part the user is going to manipulate.  How
>> about it?

>>       (let ((cursor-in-non-selected-windows t) ;; Display cursor.
>> 	    (overlay-arrow-string "=>") ;; Display arrow.
>> 	    (overlay-arrow-position (point-marker)))

> Could you explain why these variables are useful here?  (I don't see
> any arrows.)

They are intended to display an arrow pointing to the MIME
button at the left fringe.  It is the same way as
`gnus-summary-set-article-display-arrow' does.  However, I
realized it is useless for some commands like `3 K i'.  I only
tested it with `2 K d' and `2 K O' things.

>> 	(unwind-protect
>> 	    (if no-handle
>> 		(funcall function)
>> 	      (let ((handle (cdr (assq n gnus-article-mime-handle-alist))))
>> 		(funcall function handle)))
>> 	  (set-marker overlay-arrow-position nil)
>> 	  (when redisplay
>> 	    (gnus-summary-show-article)))))))

> This additional `gnus-summary-show-article' after the funcall breaks
> commands like `3 K i'.  See
> e.g. <news:v9ll2il854.fsf@marauder.physik.uni-ulm.de> in gmane.test.

I see.  Thanks for pointing it out.



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

* Re: Imroving deleting/stripping MIME parts
  2005-08-31 11:11                   ` Katsumi Yamaoka
@ 2005-09-01  5:29                     ` Katsumi Yamaoka
  2005-09-01 18:41                       ` Reiner Steib
  0 siblings, 1 reply; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-09-01  5:29 UTC (permalink / raw)


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

>>>>> In <b4mu0h6l5s1.fsf@jpl.org> Katsumi Yamaoka wrote:

>>> I'd like to propose adding two features.  The following
>>> definition displays all the MIME buttons even if
>>> `gnus-inhibit-mime-unbuttonizing' is nil (which is the default),
>>> and specifies which part the user is going to manipulate.

I revised the function I posted last.  This does:

issue the error if the article is not visible or the article
doesn't display the right contents or there's no specified part.

point the cursor and the arrow at the MIME button when the
handler function (e.g., `2 K d', `2 K O', `2 K |', etc.) prompts
the user for something.

redisplay the article so that all the MIME buttons might be
visible if the part which doesn't have the MIME button is
selected.

Could you test it?  I added an article for testing in the
gmane.test group as <b4mbr3dxsxj.fsf@jpl.org>.


[-- Attachment #2: Type: application/emacs-lisp, Size: 1788 bytes --]

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

* Re: Imroving deleting/stripping MIME parts
  2005-09-01  5:29                     ` Katsumi Yamaoka
@ 2005-09-01 18:41                       ` Reiner Steib
  2005-09-02  7:07                         ` Katsumi Yamaoka
  0 siblings, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-09-01 18:41 UTC (permalink / raw)


On Thu, Sep 01 2005, Katsumi Yamaoka wrote:

> I revised the function I posted last.  This does:
>
> issue the error if the article is not visible or the article
> doesn't display the right contents or there's no specified part.
>
> point the cursor and the arrow at the MIME button when the
> handler function (e.g., `2 K d', `2 K O', `2 K |', etc.) prompts
> the user for something.
>
> redisplay the article so that all the MIME buttons might be
> visible if the part which doesn't have the MIME button is
> selected.
>
> Could you test it?

I worked for my test cases.  Please install.

There is still the problem (probably with `gnus-article-goto-part';
unrelated to your code), that using `d' repeatedly in a message with
several attachments sometimes fails to advance to the next part (with
`gnus-auto-select-part' set to 1).

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




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

* Re: Imroving deleting/stripping MIME parts
  2005-09-01 18:41                       ` Reiner Steib
@ 2005-09-02  7:07                         ` Katsumi Yamaoka
  2005-09-02 16:17                           ` Reiner Steib
  0 siblings, 1 reply; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-09-02  7:07 UTC (permalink / raw)


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

>>>>> In <v9ll2gy6jw.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

> I worked for my test cases.  Please install.

Done.

> There is still the problem (probably with `gnus-article-goto-part';
> unrelated to your code), that using `d' repeatedly in a message with
> several attachments sometimes fails to advance to the next part (with
> `gnus-auto-select-part' set to 1).

If you're talking about the case where there are not only
buttonized parts but also unbuttonized parts in the article,
does the following patch solve it?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 622 bytes --]

--- gnus-art.el~	2005-09-01 22:14:44 +0000
+++ gnus-art.el	2005-09-02 07:06:35 +0000
@@ -4122,7 +4122,16 @@
 			    n parts)
 	      parts)))
     (gnus-message 9 "Jumping to part %s." n)
-    (gnus-article-goto-part n)))
+    (cond ((>= gnus-auto-select-part 1)
+	   (while (and (<= n parts)
+		       (not (gnus-article-goto-part n)))
+	     (setq n (1+ n))))
+	  ((< gnus-auto-select-part 0)
+	   (while (and (>= n 1)
+		       (not (gnus-article-goto-part n)))
+	     (setq n (1- n))))
+	  (t
+	   (gnus-article-goto-part n)))))
 
 (eval-when-compile
   (defsubst gnus-article-edit-part (handles &optional current-id)

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

* Re: Imroving deleting/stripping MIME parts
  2005-09-02  7:07                         ` Katsumi Yamaoka
@ 2005-09-02 16:17                           ` Reiner Steib
  2005-09-05  5:39                             ` Katsumi Yamaoka
  0 siblings, 1 reply; 24+ messages in thread
From: Reiner Steib @ 2005-09-02 16:17 UTC (permalink / raw)


On Fri, Sep 02 2005, Katsumi Yamaoka wrote:

>>>>>> In <v9ll2gy6jw.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:
>
>> I worked for my test cases.  Please install.
>
> Done.
>
>> There is still the problem (probably with `gnus-article-goto-part';
>> unrelated to your code), that using `d' repeatedly in a message with
>> several attachments sometimes fails to advance to the next part (with
>> `gnus-auto-select-part' set to 1).
>
> If you're talking about the case where there are not only
> buttonized parts but also unbuttonized parts in the article,

My test articles typically had an inline text part first an several
attached parts.  Now I could find out when it fails:

Assume the I delete part number M.  If the button for part number M+1
is below the *initially visible* part (i.e. after pressing `g') of the
article buffer, point doesn't advance to part M+1.

This is another test file with a longer first part (inline) and many
attachments:
http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/text-parts-02.nnml.gz

> does the following patch solve it?

Unfortunately it doesn't.

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




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

* Re: Imroving deleting/stripping MIME parts
  2005-09-02 16:17                           ` Reiner Steib
@ 2005-09-05  5:39                             ` Katsumi Yamaoka
  2005-09-05 13:15                               ` Reiner Steib
  0 siblings, 1 reply; 24+ messages in thread
From: Katsumi Yamaoka @ 2005-09-05  5:39 UTC (permalink / raw)


>>>>> In <v9irxj1m1f.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:

>>> There is still the problem (probably with `gnus-article-goto-part';
>>> unrelated to your code), that using `d' repeatedly in a message with
>>> several attachments sometimes fails to advance to the next part (with
>>> `gnus-auto-select-part' set to 1).

> Assume the I delete part number M.  If the button for part number M+1
> is below the *initially visible* part (i.e. after pressing `g') of the
> article buffer, point doesn't advance to part M+1.

> This is another test file with a longer first part (inline) and many
> attachments:
> http://theotp1.physik.uni-ulm.de/~ste/comp/emacs/gnus/text-parts-02.nnml.gz

I see, but that is a mystery.  It seems as if there's a timer
process which redisplays the article last (no such process is
observed in the Lisp level actually, though).  I only found that
to run `(sit-for 0)' at a certain period does the trick.  Could
you try the latest CVS?

>> does the following patch solve it?

> Unfortunately it doesn't.

I also installed it (making `gnus-article-jump-to-part' skip
unbuttonized parts).  It it causes any trouble, please let me
know.

Furthermore, I improved `gnus-article-part-wrapper' so as not to
return to the summary window if `gnus-auto-select-part' is
non-nil, assuming the part commands might be invoked from the
summary buffer.



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

* Re: Imroving deleting/stripping MIME parts
  2005-09-05  5:39                             ` Katsumi Yamaoka
@ 2005-09-05 13:15                               ` Reiner Steib
  0 siblings, 0 replies; 24+ messages in thread
From: Reiner Steib @ 2005-09-05 13:15 UTC (permalink / raw)


On Mon, Sep 05 2005, Katsumi Yamaoka wrote:

>>>>>> In <v9irxj1m1f.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:
[...]
>> Assume the I delete part number M.  If the button for part number M+1
>> is below the *initially visible* part (i.e. after pressing `g') of the
>> article buffer, point doesn't advance to part M+1.
[...]
> I see, but that is a mystery.  It seems as if there's a timer
> process which redisplays the article last (no such process is
> observed in the Lisp level actually, though).  I only found that
> to run `(sit-for 0)' at a certain period does the trick.  Could
> you try the latest CVS?

It works correctly, AFAICS.  Thanks.

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




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

end of thread, other threads:[~2005-09-05 13:15 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-26 12:23 Not prompting user in gnus-mime-delete-part and gnus-mime-save-part-and-strip Reiner Steib
2005-08-27 20:57 ` Not prompting user in gnus-mime-delete-part and Dan Christensen
2005-08-28  0:32   ` Katsumi Yamaoka
2005-08-28 12:49     ` Reiner Steib
2005-08-29  0:19       ` Katsumi Yamaoka
2005-08-29 14:53         ` Reiner Steib
2005-08-30  1:36           ` Katsumi Yamaoka
2005-08-30  2:25         ` Dan Christensen
2005-08-30  6:07           ` Katsumi Yamaoka
2005-08-28 12:40   ` Imroving deleting/stripping MIME parts (was: Not prompting user in gnus-mime-delete-part and) Reiner Steib
2005-08-29 14:57     ` Imroving deleting/stripping MIME parts Reiner Steib
2005-08-30  2:22       ` Dan Christensen
2005-08-30 13:04         ` Reiner Steib
2005-08-30 15:25           ` Dan Christensen
2005-08-30 16:44             ` Reiner Steib
2005-08-31  4:18               ` Katsumi Yamaoka
2005-08-31 10:26                 ` Reiner Steib
2005-08-31 11:11                   ` Katsumi Yamaoka
2005-09-01  5:29                     ` Katsumi Yamaoka
2005-09-01 18:41                       ` Reiner Steib
2005-09-02  7:07                         ` Katsumi Yamaoka
2005-09-02 16:17                           ` Reiner Steib
2005-09-05  5:39                             ` Katsumi Yamaoka
2005-09-05 13:15                               ` Reiner Steib

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