Re: [Lynx-dev] Lynx seems to ignore file extensions with temp downloads on gopher protocol I types

2020-04-20 Thread Thomas Dickey
On Mon, Apr 20, 2020 at 10:13:20PM +, Wayne Werner via Lynx-dev wrote:
> I've been playing around with Gopher recently, which is an amazing
> protocol and I love that Lynx supports gopher!
> 
> But I discovered some weirdness. When there's an (I)mage listed and you
> simply hit enter -- over HTTP this would kick off my external image
> viewer -- but with gopher it looks like it always tries to treat
> (I)mages as (g)if. An example, if you go to `lynx
> gopher://rpod.leveck.us/` and hit enter on the PHOTO OF THE SERVERS
> image link, which is a jpg, it names the temp file .gif.

Looking at the source, the explanation seems to be this (for presenting
the image):

a) the gopher protocol doesn't give mime-type information (it just
   identifies that as an image).
   
   Lynx would like to use the mime-type and ignore the actual filename :-)

b) lynx maps any gopher-provided image to image/gif

   gifs were more common a while back :-)

c) that mapping leads to the suggested suffix for the xloadimage (viewer)
   command.

   The viewer looks at the file format anyway, and should ignore the suffix...

On the other hand, the download follows a different path, using just
the server's link filename, which ends in ".png".

> Downloading the image works fine, and it respects the filename.
> 
> My version info:
> 
> Lynx Version 2.8.9dev.16 (11 Jul 2017)
> libwww-FM 2.14, SSL-MM 1.4.1, GNUTLS 3.5.17, ncurses 6.1.20180127(wide)
> Built on linux-gnu.
> 
> Is this expected behavior, or am I running into a bug here?

The former, I think

-- 
Thomas E. Dickey 
https://invisible-island.net
ftp://ftp.invisible-island.net


signature.asc
Description: PGP signature
___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


[Lynx-dev] Lynx seems to ignore file extensions with temp downloads on gopher protocol I types

2020-04-20 Thread Wayne Werner via Lynx-dev
I've been playing around with Gopher recently, which is an amazing
protocol and I love that Lynx supports gopher!

But I discovered some weirdness. When there's an (I)mage listed and you
simply hit enter -- over HTTP this would kick off my external image
viewer -- but with gopher it looks like it always tries to treat
(I)mages as (g)if. An example, if you go to `lynx
gopher://rpod.leveck.us/` and hit enter on the PHOTO OF THE SERVERS
image link, which is a jpg, it names the temp file .gif.

Downloading the image works fine, and it respects the filename.

My version info:

Lynx Version 2.8.9dev.16 (11 Jul 2017)
libwww-FM 2.14, SSL-MM 1.4.1, GNUTLS 3.5.17, ncurses 6.1.20180127(wide)
Built on linux-gnu.

Is this expected behavior, or am I running into a bug here?

Thanks!
-Wayne

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread s18
sorry

On 4/21/20 4:20 AM, s...@stof999.ch wrote:
> On 4/21/20 1:55 AM, Fadi Barbàra wrote:

> i added .lynx$ cat external
> EXTERNAL:http:echo -n %s|xclip -i:TRUE

xclip wasn't installed.
but after installing
there is still nothing in clipboard
???

thanks

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread s18
On 4/21/20 1:55 AM, Fadi Barbàra wrote:
> Hi,
> I do not know what is the use case, but I assume something like:
> - you are in a page P
> - you want to copy the url of the page you are in
> - you want to paste that URL in an external application

exactly!

> 
> For that to work with external you need a file `$HOME/.lynx/external` in your 
> PC _if_ your lynx has been compiled with the option external.

i added .lynx$ cat external
EXTERNAL:http:echo -n %s|xclip -i:TRUE
EXTERNAL:http:wget %s:TRUE
EXTERNAL:http:mpv %s:TRUE
EXTERNAL:http:git clone %s:TRUE
EXTERNAL:http:links -g %s:TRUE
EXTERNAL:http:chrome %s:TRUE

and get with '.' in lynx

   w3m https://cmdt.ch/  │
 │ wget https://cmdt.ch/ │
 │ wget -r https://cmdt.ch/  │
 │ x-www-browser https://cmdt.ch/│
 │ echo -n https://cmdt.ch/|xclip -i │
 │ wget https://cmdt.ch/ │
 │ mpv https://cmdt.ch/  │
 │ git clone https://cmdt.ch/│
 │ links -g https://cmdt.ch/ │
 │ chrome https://cmdt.ch/

choosing
echo -n https://cmdt.ch/|xclip -i

is doing nothing (at least nothing in clipboard).
wget for example is working.
???

and where are the the other entries coming from (w3m, ...)?

but this external things is greath!
thanks a lot

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread s18
On 4/20/20 11:43 PM, Ian Collier wrote:
> On Mon, Apr 20, 2020 at 08:46:42PM +0530, s...@stof999.ch wrote:
>> hi halaasz
>>> Well, one can assign a key to "TO_CLIPBOARD". I assign "S" to it.
>>> See the key-map, at first assigned to "k".
> 
>> i guess "TO_CLIPBOARD" is doing something with selected text?
> 
> No it is not; it is doing exactly what you asked for.

sorry
'^S' is assigned to TO_CLIPBOARD
but pressing ctrl+shift+s and paste it somewhere is filling
"TO_CLIPBOARD" [sic!]
not exactly what i like :)
???

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Thorsten Glaser
Ian Collier dixit:

>> Bad idea, I have a VT420 here which definitely needs this ;)

>But possibly not while you are using Lynx?

Why not?

I use mostly my laptop, but sit in front of one of the SPARCstations
occasionally. Why should I not use lynx then?

bye,
//mirabilos
-- 
[00:02]  gecko: benutzt du emacs ?
[00:03]  nö  [00:03]  nur n normalen mac
[00:04]  argl   [00:04]  ne den editor
-- Vutral und gecko2 in #deutsch (NB: Editor? Betriebssystem.)

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] paste and… Re: copy URL to clipboard shortcut

2020-04-20 Thread Tim Chase
On 2020-04-20 19:42, Thorsten Glaser wrote:
> Dixi quod…
> 
> >export RL_CLCOPY_CMD='xsel -i'  
> # and
> export RL_PASTE_CMD='xsel -o'

this also suggests that, even if you don't run X but you do run
a multiplexer like tmux, you could use something like

   RL_CLCOPY_CMD='tmux loadb -'
   RL_PASTE_CMD='tmux showb'

which might just come in handy (/me files away for future use)

-tim



___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Ian Collier
On Mon, Apr 20, 2020 at 07:57:24PM +, Thorsten Glaser wrote:
> Ian Collier dixit:
> >stty stop undef

> Bad idea, I have a VT420 here which definitely needs this ;)

But possibly not while you are using Lynx?

imc

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Chuck Martin
I'm sorry, I accidentally sent this to the original poster instead of
the list.  My apologies.  I'm resending it to the list, in case others
may find the information useful.

On Mon, Apr 20, 2020 at 09:00:23PM +0530, s...@stof999.ch wrote:
> but since i'm often copy/paste URL for documention reason i need them in
> the citation kontext and therefore bookmark page would be soon overcrowed.
> and using '=', select URL, copy, concat takes about the same time.

What are you using to copy and paste?  If you're using gnu screen, you can
do the concatenation at the same time as the copy.  Just move the cursor
to the beginning of the URL and press "c" (without the quotes) to set the
first column, press "y" to "yank" the whole line, cursor down to hilight
all lines of the URL, then press "J" (shifted "j") to "join lines", then
either space or enter to finish the copy, and the lines will be copied as
one line.

Make sure you only press the "J" once, as it cycles between joining,
joining with blanks, joining with commas, and not joining.  Also, if for
some reason, spaces are hilighted at the end of a line, you may need to
press "C" (shifted "c") at the end of the line to set the last column,
but that doesn't usually happen.

If you're using tmux, you can do something similar, but you have to
concatenate the lines when you paste instead of when you copy.  For
example, you can use the "|" key to paste the paste buffer with all
lines concatenated with the following:

bind-key | paste-buffer -s ""

You'll need to do a "rectangle toggle" when you copy the URL to get
the same effect as the "c" and "C" keys in gnu screen.  The default
keys for this are "v" in vi mode, and "R" in emacs mode.

HTH.

Chuck

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Fadi Barbàra
Hi,
I do not know what is the use case, but I assume something like:
- you are in a page P
- you want to copy the url of the page you are in
- you want to paste that URL in an external application

For that to work with external you need a file `$HOME/.lynx/external` in your 
PC _if_ your lynx has been compiled with the option external.

I post here my externals file for example:

```
EXTERNAL:http:echo -n %s|xclip -i:TRUE
EXTERNAL:http:wget %s:TRUE
EXTERNAL:http:mpv %s:TRUE
EXTERNAL:http:git clone %s:TRUE
EXTERNAL:http:links -g %s:TRUE
EXTERNAL:http:chrome %s:TRUE

EXTERNAL:gopher:lynx -dump %s|urlview:TRUE
EXTERNAL:gopher:echo -n %s|xclip -i:TRUE
EXTERNAL:gopher:wget %s:TRUE

EXTERNAL:ftp:wget %s:TRUE
```

When you are in page P, you press ',' (default keybinding) and a pop up menu 
will appear with all the possible externals given the protocol. E.g. if you are 
in a http/https page you would see the options of the first group, i.e. from 
`echo` to `chrome`. if you select the `echo -n ...` option, it will copy the 
url of P into clipboard, no other actions needed. To paste it you have to use 
the shortcut of your terminal or application you want to paste that link into.

Note that you can use those externals also on the highlighted/selected link in 
a page, by pressing '.' instead of ',' .

Best,
Fadi

On Mon, Apr 20, 2020 at 08:43:33PM +0530, s...@stof999.ch wrote:
> hi fadi
> On 4/20/20 4:08 PM, Fadi Barbàra wrote:
> > Hi
> > On Mon, Apr 20, 2020 at 12:11:11PM +0530, s...@stof999.ch wrote:
> >> hi
> >> it would be greath to have a shortcut for copying the URL of the file
> >> currently viewing INTO clipboard.
> > Have you tried using externals? 
> > 
> > If you compiled enabling them (I think the debian version has it compiled 
> > that way by default) you can use a command like `echo %s|xclip -i 
> > -selection clipboard` as an external. 
> > 
> > External can be accessed via '.' and ',' by default.
> 
> do i understand it correct: the external command is doing something with
> selected text? select URL then '.'?
> if so, the problem isn't solved with long URL. when using 'G' the URL is
> truncated and can't be selected in whole.
> 
> or do i miss something?
> thanks
> 
> ___
> Lynx-dev mailing list
> Lynx-dev@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/lynx-dev

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Thorsten Glaser
Ian Collier dixit:

>stty stop undef

Bad idea, I have a VT420 here which definitely needs this ;)

Perhaps this could fix ^W though. *tries* No :-(
(If it had, I’d have asked for lynx to unspecial all keys it
binds, like mksh does.)

bye,
//mirabilos
-- 
18:47⎜ well channels… you see, I see everything in the
same window anyway  18:48⎜ i know, you have some kind of
telnet with automatic pong 18:48⎜ haha, yes :D
18:49⎜ though that's more tinyirc – sirc is more comfy

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


[Lynx-dev] paste and… Re: copy URL to clipboard shortcut

2020-04-20 Thread Thorsten Glaser
Dixi quod…

>export RL_CLCOPY_CMD='xsel -i'
# and
export RL_PASTE_CMD='xsel -o'

>… for the PRIMARY selection (“middle click”), and…
>
>export RL_CLCOPY_CMD='xsel -ib'
# and
export RL_PASTE_CMD='xsel -ob'

>… for the CLIPBOARD (“Ctrl-V” or “Shift-Insert”).

>>>On 4/20/20 7:35 PM, Halaasz Saandor via Lynx-dev wrote:
>
Well, one can assign a key to "TO_CLIPBOARD". I assign "S" to it.

>For the archives, you’ll need to add…
>
>KEYMAP:S:TO_CLIPBOARD
>
>… to your /etc/lynx.cfg for this.

There’s also a PASTE_URL, which acts like ‘g’ + paste + Enter,
from what I can gather quickly scanning the source.

Not very useful.

There should be PASTE (editmap) bound to ^W, but that doesn’t work
either. (Incidentally, ^W also doesn’t do what it normally does in
Emacs editing mode.) Did anyone get THAT to work (because THAT ac‐
tually would be useful) and if so, how?

bye,
//mirabilos
-- 
Yay for having to rewrite other people's Bash scripts because bash
suddenly stopped supporting the bash extensions they make use of
-- Tonnerre Lombard in #nosec

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] paste and… Re: copy URL to clipboard shortcut

2020-04-20 Thread Thorsten Glaser
Dixi quod…

>There should be PASTE (editmap) bound to ^W, but that doesn’t work
>either. (Incidentally, ^W also doesn’t do what it normally does in
>Emacs editing mode.) Did anyone get THAT to work (because THAT ac‐
>tually would be useful) and if so, how?

For that matter, pressing ^X^W in the textarea in edit_help.html
seems to delete the entire line, while ^W causes a core dump
(double free) in 2.9.0dev.5-1 (Debian sid/amd64)…

*Now* colour me curious.

bye,
//mirabilos
-- 
 you introduced a merge commit│ % g rebase -i HEAD^^
 sorry, no idea and rebasing just fscked │ Segmentation
 should have cloned into a clean repo  │  fault (core dumped)
 if I rebase that now, it's really ugh │ wuahh

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Ian Collier
On Mon, Apr 20, 2020 at 07:26:18PM +, Thorsten Glaser wrote:
> Where did you find that? TO_CLIPBOARD isn't documented anywhere
> and we had a ton of people asking for this on IRC.

I grepped for 'clipboard' in all the docs (in /usr/share/doc/lynx)
and found it in the INSTALLATION file.

It is - ahem - under-documented, certainly.

> >executing Lynx.  If you are using an X11 system and have 'xclip'

> I guess xsel would also work, which is perhaps more common/known.

Meh - I hadn't heard of that, and it's not installed by default on
Fedora.  When I asked dnf what it was, it said:

XSel is a command line or script utility, similar to xclip, that can copy [etc]

> Whose bright idea was to use ^S for it anyway? 

Yes, that's an issue.

stty stop undef

imc

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Thorsten Glaser
Ian Collier dixit:

>Specifically, when you press the TO_CLIPBOARD key, it first asks
>you whether you want to save the URL of the current document or of
>the current link.  It then runs the command $RL_CLCOPY_CMD with the

Where did you find that? TO_CLIPBOARD isn’t documented anywhere
and we had a ton of people asking for this on IRC.

>executing Lynx.  If you are using an X11 system and have 'xclip'

I guess xsel would also work, which is perhaps more common/known.

You’d use…

export RL_CLCOPY_CMD='xsel -i'

… for the PRIMARY selection (“middle click”), and…

export RL_CLCOPY_CMD='xsel -i -p'

… for the CLIPBOARD (“Ctrl-V” or “Shift-Insert”).


>>On 4/20/20 7:35 PM, Halaasz Saandor via Lynx-dev wrote:

>>>Well, one can assign a key to "TO_CLIPBOARD". I assign "S" to it.

Whose bright idea was to use ^S for it anyway? Hm I guess the
clipboard would be builtin on Windows which wouldn’t use XOFF
either… probably there.

For the archives, you’ll need to add…

KEYMAP:S:TO_CLIPBOARD

… to your /etc/lynx.cfg for this.

bye,
//mirabilos
-- 
15:39⎜«mika:#grml» mira|AO: "mit XFree86® wär’ das nicht passiert" - muhaha
15:48⎜ also warum machen die xorg Jungs eigentlich alles
kaputt? :)15:49⎜ thkoehler: weil sie als Kinder nie den
gebauten Turm selber umschmeissen durften?  -- ~/.Xmodmap wonders…

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Ian Collier
On Mon, Apr 20, 2020 at 08:46:42PM +0530, s...@stof999.ch wrote:
> hi halaasz
> > Well, one can assign a key to "TO_CLIPBOARD". I assign "S" to it.
> > See the key-map, at first assigned to "k".

> i guess "TO_CLIPBOARD" is doing something with selected text?

No it is not; it is doing exactly what you asked for.

Specifically, when you press the TO_CLIPBOARD key, it first asks
you whether you want to save the URL of the current document or of
the current link.  It then runs the command $RL_CLCOPY_CMD with the
approrpiate URL on standard input.  This command is supposed to copy
the text to your clipboard, although it could do anything you want.

RL_CLCOPY_CMD is an environment variable that you can set before
executing Lynx.  If you are using an X11 system and have 'xclip'
installed on your system then

export RL_CLCOPY_CMD='xclip -i'

would be an appropriate setting to let Lynx copy URLs to the clipboard.

imc

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread s18
hi russel
On 4/20/20 5:02 PM, russellb...@gmail.com wrote:
> 
>   I save links to my bookmark page, copy them from it.  It's
> also my start page.

it's an idea.
but since i'm often copy/paste URL for documention reason i need them in
the citation kontext and therefore bookmark page would be soon overcrowed.
and using '=', select URL, copy, concat takes about the same time.

so e.g. press 'S' and having the URL of the file
CURRENTLY VIEWING in the clipboard would be very easy :)

thanks

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread s18
hi halaasz
On 4/20/20 7:35 PM, Halaasz Saandor via Lynx-dev wrote:
> 2020/04/20 02:41 ... s...@stof999.ch:
>> it would be greath to have a shortcut for copying the URL of the file
>> currently viewing INTO clipboard.
> 
> Well, one can assign a key to "TO_CLIPBOARD". I assign "S" to it.
> See the key-map, at first assigned to "k".

i guess "TO_CLIPBOARD" is doing something with selected text?
if so, the problem isn't solved with long URL. when using 'G' the URL is
truncated and can't be selected in whole.

or do i miss something?
thanks

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread s18
hi fadi
On 4/20/20 4:08 PM, Fadi Barbàra wrote:
> Hi
> On Mon, Apr 20, 2020 at 12:11:11PM +0530, s...@stof999.ch wrote:
>> hi
>> it would be greath to have a shortcut for copying the URL of the file
>> currently viewing INTO clipboard.
> Have you tried using externals? 
> 
> If you compiled enabling them (I think the debian version has it compiled 
> that way by default) you can use a command like `echo %s|xclip -i -selection 
> clipboard` as an external. 
> 
> External can be accessed via '.' and ',' by default.

do i understand it correct: the external command is doing something with
selected text? select URL then '.'?
if so, the problem isn't solved with long URL. when using 'G' the URL is
truncated and can't be selected in whole.

or do i miss something?
thanks

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Halaasz Saandor via Lynx-dev

2020/04/20 02:41 ... s...@stof999.ch:

it would be greath to have a shortcut for copying the URL of the file
currently viewing INTO clipboard.


Well, one can assign a key to "TO_CLIPBOARD". I assign "S" to it.
See the key-map, at first assigned to "k".

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


[Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread russellbell

I save links to my bookmark page, copy them from it.  It's
also my start page.

russell bell

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


Re: [Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread Fadi Barbàra
Hi
On Mon, Apr 20, 2020 at 12:11:11PM +0530, s...@stof999.ch wrote:
> hi
> it would be greath to have a shortcut for copying the URL of the file
> currently viewing INTO clipboard.
Have you tried using externals? 

If you compiled enabling them (I think the debian version has it compiled that 
way by default) you can use a command like `echo %s|xclip -i -selection 
clipboard` as an external. 

External can be accessed via '.' and ',' by default.

Hope that helps!

Best,
disnocen

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev


[Lynx-dev] copy URL to clipboard shortcut

2020-04-20 Thread s18
hi
it would be greath to have a shortcut for copying the URL of the file
currently viewing INTO clipboard.

there are some solutions in the web which not work (debian, lxde,
lxterminal)
or could be improved when having long URLs:
- 'g' the whole URL can't be selected
- '=' (information about current document) shows URL. select and copy
works, but the url must be concated when to long.

and btw:
i'm more and more browsing just with lynx. fast AND NO PIC!
thanks a lot.

___
Lynx-dev mailing list
Lynx-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/lynx-dev