Gnus development mailing list
 help / color / mirror / Atom feed
* alternate button push?
@ 1998-12-16 17:46 Jack Vinson
  1998-12-19 21:53 ` Lars Magne Ingebrigtsen
  1998-12-19 23:45 ` Hrvoje Niksic
  0 siblings, 2 replies; 13+ messages in thread
From: Jack Vinson @ 1998-12-16 17:46 UTC (permalink / raw)


Is there a way to set up code for an "alternate" button press?  Normally,
I want the default button behavior in Gnus.  Sometimes, however, I want to
do something different with the thing under the button.  

For example, the code that Stefan Waldherr just sent:  Standard behavior is
to save the object.  I might want an alternate behavior that simply opens
the object for view in the article buffer (or another buffer).  With an
html link, I might want to fire up my default browser as a normal action
and fire up w3 as an alternate action.  

I was thinking that I could bind C-Return to the alternate, but it appears
there are special text properties associated with buttons and I don't know
if we can set these ourselves.  

-- 
Jack Vinson <jvinson@chevax.ecs.umass.edu>    http://www.cis.upenn.edu/~vinson/
Zippy: ...Get me a GIN and TONIC!!...make it HAIR TONIC!!



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

* Re: alternate button push?
  1998-12-16 17:46 alternate button push? Jack Vinson
@ 1998-12-19 21:53 ` Lars Magne Ingebrigtsen
  1998-12-19 23:45 ` Hrvoje Niksic
  1 sibling, 0 replies; 13+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-12-19 21:53 UTC (permalink / raw)


Jack Vinson <jvinson@chevax.ecs.umass.edu> writes:

> I was thinking that I could bind C-Return to the alternate, but it appears
> there are special text properties associated with buttons and I don't know
> if we can set these ourselves.  

You can bind that key in the article buffer, and then the command
could just check whether it's over a button or not.

(get-text-property (point) 'gnus-data)

returns the MIME handle.

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


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

* Re: alternate button push?
  1998-12-16 17:46 alternate button push? Jack Vinson
  1998-12-19 21:53 ` Lars Magne Ingebrigtsen
@ 1998-12-19 23:45 ` Hrvoje Niksic
  1998-12-21 22:43   ` Jack Vinson
  1 sibling, 1 reply; 13+ messages in thread
From: Hrvoje Niksic @ 1998-12-19 23:45 UTC (permalink / raw)


Jack Vinson <jvinson@chevax.ecs.umass.edu> writes:

> Is there a way to set up code for an "alternate" button press?
> Normally, I want the default button behavior in Gnus.  Sometimes,
> however, I want to do something different with the thing under the
> button.

Modify `gnus-mime-button-map'.  For instance:

(define-key gnus-mime-button-map [(control return)] <your-command>)

Let me know if that doesn't work.


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

* Re: alternate button push?
  1998-12-19 23:45 ` Hrvoje Niksic
@ 1998-12-21 22:43   ` Jack Vinson
  1998-12-21 22:49     ` Hrvoje Niksic
  1998-12-21 23:13     ` Kai.Grossjohann
  0 siblings, 2 replies; 13+ messages in thread
From: Jack Vinson @ 1998-12-21 22:43 UTC (permalink / raw)


>>>>> "Hrvoje" == Hrvoje Niksic <hniksic@srce.hr> writes:

Hrvoje> Jack Vinson <jvinson@chevax.ecs.umass.edu> writes:
>> Is there a way to set up code for an "alternate" button press?
>> Normally, I want the default button behavior in Gnus.  Sometimes,
>> however, I want to do something different with the thing under the
>> button.

Hrvoje> Modify `gnus-mime-button-map'.  For instance:

Hrvoje> (define-key gnus-mime-button-map [(control return)] <your-command>)

I had to simply define-key for [C-return] in the gnus-article-mode-map.  I
have created a function which does _something_ different with a URL, but it
isn't very elegant.  Is there a good place to look for pointers on how to
deal with the text properties that have been set for buttons?  Lars
suggested gnus-data, but I don't know what to do with it once I have it.

-- 
Jack Vinson <jvinson@chevax.ecs.umass.edu>    http://www.cis.upenn.edu/~vinson/
Zippy: FUN is never having to say you're SUSHI!!



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

* Re: alternate button push?
  1998-12-21 22:43   ` Jack Vinson
@ 1998-12-21 22:49     ` Hrvoje Niksic
  1998-12-22 16:36       ` Jack Vinson
  1998-12-21 23:13     ` Kai.Grossjohann
  1 sibling, 1 reply; 13+ messages in thread
From: Hrvoje Niksic @ 1998-12-21 22:49 UTC (permalink / raw)


Jack Vinson <jvinson@chevax.ecs.umass.edu> writes:

> I had to simply define-key for [C-return] in the
> gnus-article-mode-map.  I have created a function which does
> _something_ different with a URL, but it isn't very elegant.  Is
> there a good place to look for pointers on how to deal with the text
> properties that have been set for buttons?

Try setting gnus-widget-button-keymap to something you can use.  For
instance:

(setq gnus-widget-button-keymap (make-sparse-keymap))
(define-key gnus-widget-button-keymap [mouse-2] 'your-function)
(define-key gnus-widget-button-keymap [return] 'your-function)

(defun your-function (event)
  (interactive "e")
  ...)



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

* Re: alternate button push?
  1998-12-21 22:43   ` Jack Vinson
  1998-12-21 22:49     ` Hrvoje Niksic
@ 1998-12-21 23:13     ` Kai.Grossjohann
  1998-12-22 19:10       ` Dave Love
  1 sibling, 1 reply; 13+ messages in thread
From: Kai.Grossjohann @ 1998-12-21 23:13 UTC (permalink / raw)


WIBNI if down-mouse-3 over a button would pop up a menu for doing
useful stuff with the thing represented by the button?

On a URL, this could be `View using {w3,netscape,lynx}', on a MIME
part button, this could be `Display inline', `View', `Print', `Save',
and stuff.

kai
-- 
This gubblick contains many nonsklarkish English flutzpahs,
but the overall pluggandisp can be glorked from context. -- David Moser


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

* Re: alternate button push?
  1998-12-21 22:49     ` Hrvoje Niksic
@ 1998-12-22 16:36       ` Jack Vinson
  1998-12-23 14:25         ` Hrvoje Niksic
  0 siblings, 1 reply; 13+ messages in thread
From: Jack Vinson @ 1998-12-22 16:36 UTC (permalink / raw)


>>>>> "Hrvoje" == Hrvoje Niksic <hniksic@srce.hr> writes:

Hrvoje> Try setting gnus-widget-button-keymap to something you can use.  For
Hrvoje> instance: 
[snip]

This doesn't do anything for me.  Gnus doesn't think [C-return] on the
gnus-widget-button-keymap is terribly interesting.  In fact 
'C-h k C-return' tells me there is nothing bound to it in the *Article*
buffer.  I set this key to gnus-article-mode-map and it works just fine.

The next question involves writing this function.  I have a rather messy
looking thing that looks at both the gnus-data text property (for MIME) and
the gnus-button-entry (for other buttons, like URL's).  Is this going to
change as Lars updates the button handling routines?

Is there an easier way to test for the kind of button that was pressed?  I
could imagine things like button-url-p, button-signature-p,
button-citation-p, button-mime-p, and so forth.

-- 
Jack Vinson <jvinson@chevax.ecs.umass.edu>    http://www.cis.upenn.edu/~vinson/
Zippy: I'm totally DESPONDENT over the LIBYAN situation and the price of CHICKEN..



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

* Re: alternate button push?
  1998-12-21 23:13     ` Kai.Grossjohann
@ 1998-12-22 19:10       ` Dave Love
  1998-12-22 23:16         ` Kai.Grossjohann
  1998-12-23 14:24         ` Hrvoje Niksic
  0 siblings, 2 replies; 13+ messages in thread
From: Dave Love @ 1998-12-22 19:10 UTC (permalink / raw)


>>>>> "Kai" == Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

 Kai> WIBNI if down-mouse-3 over a button would pop up a menu for
 Kai> doing useful stuff with the thing represented by the button?

I'm not sure whether mouse-3 is the right binding, but the idea's
probably good.

 Kai> On a URL, this could be `View using {w3,netscape,lynx}', 

Do you really need something more for URLs than allowed for by
`browse-url-browser-function' (which could even pop up a menu of
choices)?  On the occasions I need to invoke a non-default browser, I
just invoke browse-url-mumble directly, but input welcome.  (I do have
it mind at some stage browse-url functions for other things such as
wgetting tarballs.)

 Kai> on a MIME part button, this could be `Display inline', `View',
 Kai> `Print', `Save', and stuff.

Definitely for that one.  I might even vote for that on button-2.



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

* Re: alternate button push?
  1998-12-22 19:10       ` Dave Love
@ 1998-12-22 23:16         ` Kai.Grossjohann
  1998-12-23 14:24         ` Hrvoje Niksic
  1 sibling, 0 replies; 13+ messages in thread
From: Kai.Grossjohann @ 1998-12-22 23:16 UTC (permalink / raw)


Dave Love <d.love@dl.ac.uk> writes:

  > >>>>> "Kai" == Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:
  > 
  >  Kai> WIBNI if down-mouse-3 over a button would pop up a menu for
  >  Kai> doing useful stuff with the thing represented by the button?
  > 
  >  Kai> On a URL, this could be `View using {w3,netscape,lynx}', 
  > 
  > Do you really need something more for URLs than allowed for by
  > `browse-url-browser-function' (which could even pop up a menu of
  > choices)?

[M-x customize-variable RET browse-url-browser-function RET...]
Well, there are lots of choices for browse-url-browser-function, this
is probably more than sufficient.  Only additional wish would be a way
to retrieve the data and store it on the local disk, in whatever
fashion.  (Using w3 or wget or whatever to retrieve it.)

kai
-- 
This gubblick contains many nonsklarkish English flutzpahs,
but the overall pluggandisp can be glorked from context. -- David Moser


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

* Re: alternate button push?
  1998-12-22 19:10       ` Dave Love
  1998-12-22 23:16         ` Kai.Grossjohann
@ 1998-12-23 14:24         ` Hrvoje Niksic
  1998-12-28 12:53           ` Robert Bihlmeyer
  1 sibling, 1 reply; 13+ messages in thread
From: Hrvoje Niksic @ 1998-12-23 14:24 UTC (permalink / raw)


Dave Love <d.love@dl.ac.uk> writes:

>  Kai> On a URL, this could be `View using {w3,netscape,lynx}', 
> 
> Do you really need something more for URLs than allowed for by
> `browse-url-browser-function' (which could even pop up a menu of
> choices)?

Yes.  I want the equivalent of Netscape's "copy URL location to
clipboard".  This is especially useful when one wants to use Wget for
downloading.  I might also want to implement a "retrieve URL using
Wget" function and put it on that menu.

button3 would be a good binding for XEmacs.  I don't know about FSF
Emacs, but I think MIME buttons are on mouse-3 there, so we have a
precedent.

>  Kai> on a MIME part button, this could be `Display inline', `View',
>  Kai> `Print', `Save', and stuff.
> 
> Definitely for that one.  I might even vote for that on button-2.

We already have that on button3 in XEmacs.  Doesn't it work on FSF?


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

* Re: alternate button push?
  1998-12-22 16:36       ` Jack Vinson
@ 1998-12-23 14:25         ` Hrvoje Niksic
  0 siblings, 0 replies; 13+ messages in thread
From: Hrvoje Niksic @ 1998-12-23 14:25 UTC (permalink / raw)


Jack Vinson <jvinson@chevax.ecs.umass.edu> writes:

> >>>>> "Hrvoje" == Hrvoje Niksic <hniksic@srce.hr> writes:
> 
> Hrvoje> Try setting gnus-widget-button-keymap to something you can use.  For
> Hrvoje> instance: 
> [snip]
> 
> This doesn't do anything for me.  Gnus doesn't think [C-return] on
> the gnus-widget-button-keymap is terribly interesting.

That's strange.  Perhaps GNU Emacs doesn't support `:button-keymap'
for widget buttons?


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

* Re: alternate button push?
  1998-12-23 14:24         ` Hrvoje Niksic
@ 1998-12-28 12:53           ` Robert Bihlmeyer
  1998-12-28 15:02             ` Hrvoje Niksic
  0 siblings, 1 reply; 13+ messages in thread
From: Robert Bihlmeyer @ 1998-12-28 12:53 UTC (permalink / raw)


Hi,

>>>>> On 23 Dec 1998 15:24:47 +0100
>>>>> Hrvoje Niksic <hniksic@srce.hr> said:

 Hrvoje> Yes. I want the equivalent of Netscape's "copy URL location
 Hrvoje> to clipboard". This is especially useful when one wants to
 Hrvoje> use Wget for downloading.

Not much easier than marking the URL, is it?

 Hrvoje> I might also want to implement a "retrieve URL using Wget"
 Hrvoje> function and put it on that menu.

That's a must. What I use at home is a function that adds the URL to a 
buffer (file). This file is later piped into wget when I'm online
again.

	Robbe

-- 
Robert Bihlmeyer	reads: Deutsch, English, MIME, Latin-1, NO SPAM!
<robbe@orcus.priv.at>	<http://stud2.tuwien.ac.at/~e9426626/sig.html>


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

* Re: alternate button push?
  1998-12-28 12:53           ` Robert Bihlmeyer
@ 1998-12-28 15:02             ` Hrvoje Niksic
  0 siblings, 0 replies; 13+ messages in thread
From: Hrvoje Niksic @ 1998-12-28 15:02 UTC (permalink / raw)


Robert Bihlmeyer <e9426626@stud2.tuwien.ac.at> writes:

> >>>>> On 23 Dec 1998 15:24:47 +0100
> >>>>> Hrvoje Niksic <hniksic@srce.hr> said:
> 
>  Hrvoje> Yes. I want the equivalent of Netscape's "copy URL location
>  Hrvoje> to clipboard". This is especially useful when one wants to
>  Hrvoje> use Wget for downloading.
> 
> Not much easier than marking the URL, is it?

It is much easier, at least for me.  I am irked with having to go to
the *Article* buffer intentionally, or dragging the mouse explicitly.


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

end of thread, other threads:[~1998-12-28 15:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-16 17:46 alternate button push? Jack Vinson
1998-12-19 21:53 ` Lars Magne Ingebrigtsen
1998-12-19 23:45 ` Hrvoje Niksic
1998-12-21 22:43   ` Jack Vinson
1998-12-21 22:49     ` Hrvoje Niksic
1998-12-22 16:36       ` Jack Vinson
1998-12-23 14:25         ` Hrvoje Niksic
1998-12-21 23:13     ` Kai.Grossjohann
1998-12-22 19:10       ` Dave Love
1998-12-22 23:16         ` Kai.Grossjohann
1998-12-23 14:24         ` Hrvoje Niksic
1998-12-28 12:53           ` Robert Bihlmeyer
1998-12-28 15:02             ` Hrvoje Niksic

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