unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16026: Gnus shouldn't use old connections
@ 2013-12-02 15:03 Stefan Monnier
  2013-12-02 15:53 ` Leo Liu
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2013-12-02 15:03 UTC (permalink / raw)
  To: 16026

Package: Emacs
Version: 24.3.50


Gnus should consider a connection as dead if it has been idle for more
than some timeout value (e.g. 5 minutes).  This bites me every day when
I wake up my computer: if I just hit `g' to refresh the *Group* buffer,
it *always* hangs (I guess it would timeout but only after a long wait,
like 2h).  Instead, I have to go to *Server*, close each server, go back
to *Group* and then hit `g'.


        Stefan




In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.22)
 of 2013-11-22 on pastel
Bzr revision: monnier@iro.umontreal.ca-20131120035930-j06qmpn94lnzk1ty
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux testing (jessie)

Configured using:
 `configure -C --enable-checking --enable-check-lisp-object-type
 'CFLAGS=-Wall -g3 -O0 -Wno-pointer-sign''

Important settings:
  value of $LANG: fr_CH.UTF-8
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Group

Minor modes in effect:
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  gnus-undo-mode: t
  electric-pair-mode: t
  electric-indent-mode: t
  url-handler-mode: t
  global-reveal-mode: t
  reveal-mode: t
  auto-insert-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
n C-a <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> <right> <right> 
<right> <right> <right> <right> <right> d C-e , SPC 
o r SPC <M-backspace> <backspace> <backspace> ? <return> 
<return> <return> M-i S t e f a n C-c C-c <switch-frame> 
<switch-frame> <select-window> <select-window> n k 
k q s <return> <return> SPC n n l l n <return> <return> 
<return> <return> <return> <return> <return> <return> 
<return> <return> <return> <return> <return> <return> 
<return> <return> <return> <return> <return> n <select-window> 
<select-window> <help-echo> SPC k q s <return> k q 
s <return> <select-window> <switch-frame> <down-mouse-1> 
<mouse-movement> <mouse-1> C-SPC C-e M-w <switch-frame> 
<help-echo> <select-window> <select-window> <switch-frame> 
<down-mouse-1> <mouse-movement> <mouse-1> SPC w i t 
h SPC m i n o r SPC t w e k a s <backspace> <backspace> 
<backspace> a k s SPC <backspace> , <backspace> SPC 
( m o s t SPC i m p o r t a <M-backspace> v i s i b 
l y , SPC u s i n g SPC " v " SPC r a t h e r SPC t 
h s n SPC <backspace> <backspace> <backspace> a n SPC 
" t C-e . C-c C-c M-> q s <down> <down> <down> <down> 
<down> <down> <down> <return> <return> <select-window> 
<select-window> <help-echo> SPC n n q s n n n n n n 
n n <return> <return> q s <return> <return> <help-echo> 
<select-window> <help-echo> <help-echo> <down-mouse-2> 
<mouse-1> <help-echo> <help-echo> <select-window> <help-echo> 
n <help-echo> <select-window> <select-window> <help-echo> 
n k <help-echo> <select-window> <help-echo> <down-mouse-2> 
<mouse-1> <help-echo> <help-echo> <select-window> <select-window> 
<help-echo> q s <help-echo> <select-window> <help-echo> 
<select-window> <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <up> <up> <up> <up> M-x g n - e 
m - b u g <tab> <return> C-g M-x r e - e m - b u <tab> 
<return>

Recent messages:
Saving /home/monnier/var/newsrc.eld...done
Opening nntp server on gwene...done
Saving /home/monnier/var/newsrc.eld...
Saving file /home/monnier/var/newsrc.eld...
Wrote /home/monnier/var/newsrc.eld
Saving /home/monnier/var/newsrc.eld...done
Saving /home/monnier/var/newsrc.eld...
Saving file /home/monnier/var/newsrc.eld...
Wrote /home/monnier/var/newsrc.eld
Saving /home/monnier/var/newsrc.eld...done
Quit [2 times]

Load-path shadows:
/home/monnier/src/emacs/elpa/packages/company/.dir-locals hides /home/monnier/src/emacs/elpa/packages/js2-mode/.dir-locals
/home/monnier/src/emacs/elpa/packages/company/.dir-locals hides /home/monnier/src/emacs/work/lisp/gnus/.dir-locals

Features:
(shadow emacsbug smerge-mode iso-transl vc-sccs vc-svn vc-cvs vc-rcs vc
vc-dispatcher vc-bzr rect nndoc shell pcomplete comint ring url-http
url-gw url-auth url-queue woman tutorial man info-look help-macro
help-at-pt ehelp apropos canlock pp debug footnote cus-edit cus-start
cus-load dabbrev diff-mode jka-compr gnus-fun supercite regi nnir
shr-color color shr gnus-dup misearch multi-isearch nnagent nnml
executable copyright flow-fill mm-archive gnus-html browse-url xml
url-cache mm-url url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util mule-util sort smiley
ansi-color gnus-cite mail-extr gnus-bcklg gnus-async qp gnus-ml nnfolder
utf-7 nndraft nnmh rfc2104 gnutls network-stream starttls nnimap
parse-time tls utf7 netrc nnnil gnus-agent gnus-srvr gnus-score
score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 epg-config mm-view
mml-smime smime dig mailcap nntp gnus-cache gnus-sum nnoo gnus-group
gnus-undo nnmail mail-source server gnus-start gnus-spec gnus-int
gnus-range message sendmail format-spec rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev gmm-utils mailheader gnus-win gnus gnus-ems nnheader
mail-utils wid-edit noutline outline easy-mmode flyspell ispell eldoc
checkdoc thingatpt help-mode advice help-fns electric url-handlers
url-parse auth-source eieio byte-opt bytecomp byte-compile cconv
eieio-core gnus-util mm-util mail-prsvr password-cache url-vars reveal
autoinsert proof-site proof-autoloads cl-macs gv cl pg-vars uniquify
time-date savehist minibuf-eldef disp-table finder-inf edmacro kmacro
cl-loaddefs cl-lib info easymenu package bbdb-autoloads agda2
vm-autoloads tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win
x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)





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

* bug#16026: Gnus shouldn't use old connections
       [not found] ` <mailman.7856.1385996719.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
@ 2013-12-02 15:19   ` Sebastien Vauban
  2013-12-02 16:12     ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: Sebastien Vauban @ 2013-12-02 15:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 16026-ubl+/3LiMTaZdePnXv/OxA

Stefan Monnier wrote:
> Package: Emacs
> Version: 24.3.50
>
> Gnus should consider a connection as dead if it has been idle for more
> than some timeout value (e.g. 5 minutes).  This bites me every day when
> I wake up my computer: if I just hit `g' to refresh the *Group* buffer,
> it *always* hangs (I guess it would timeout but only after a long wait,
> like 2h).  Instead, I have to go to *Server*, close each server, go back
> to *Group* and then hit `g'.

Weird. I do the same as you, or almost [1], and don't have that problem.

Best regards,
  Seb

[1] When I'm closing the lid, the computer is put to "sleep" (not "hibernate").
And, every night, I switch the mains off for the computer room.

-- 
Sebastien Vauban





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

* bug#16026: Gnus shouldn't use old connections
  2013-12-02 15:03 bug#16026: Gnus shouldn't use old connections Stefan Monnier
@ 2013-12-02 15:53 ` Leo Liu
  0 siblings, 0 replies; 18+ messages in thread
From: Leo Liu @ 2013-12-02 15:53 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 16026

On 2013-12-02 23:03 +0800, Stefan Monnier wrote:
> Gnus should consider a connection as dead if it has been idle for more
> than some timeout value (e.g. 5 minutes).  This bites me every day when
> I wake up my computer: if I just hit `g' to refresh the *Group* buffer,
> it *always* hangs (I guess it would timeout but only after a long wait,
> like 2h).  Instead, I have to go to *Server*, close each server, go back
> to *Group* and then hit `g'.

This also bugs me everyday (I am mostly using Emacs 24.3).

Leo





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

* bug#16026: Gnus shouldn't use old connections
  2013-12-02 15:19   ` bug#16026: Gnus shouldn't use old connections Sebastien Vauban
@ 2013-12-02 16:12     ` Stefan Monnier
  2013-12-04 16:04       ` Ted Zlatanov
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2013-12-02 16:12 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: 16026

>> Gnus should consider a connection as dead if it has been idle for more
>> than some timeout value (e.g. 5 minutes).  This bites me every day when
>> I wake up my computer: if I just hit `g' to refresh the *Group* buffer,
>> it *always* hangs (I guess it would timeout but only after a long wait,
>> like 2h).  Instead, I have to go to *Server*, close each server, go back
>> to *Group* and then hit `g'.
> Weird. I do the same as you, or almost [1], and don't have that problem.

Of course, the occurrence of my particular problem depends on various
factors, such as whether you get the same IP address when you wake up,
whether you're in the same network when you wake up, whether you're
behind a NAT, how long the NAT router remembers connections, whether the
NAT router's own IP has changed, ...


        Stefan





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

* bug#16026: Gnus shouldn't use old connections
  2013-12-02 16:12     ` Stefan Monnier
@ 2013-12-04 16:04       ` Ted Zlatanov
  2017-01-25 16:55         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Ted Zlatanov @ 2013-12-04 16:04 UTC (permalink / raw)
  To: Stefan Monnier, Lars Magne Ingebrigtsen; +Cc: Sebastien Vauban, 16026

On Mon, 02 Dec 2013 11:12:20 -0500 Stefan Monnier <monnier@iro.umontreal.ca> wrote: 

>>> Gnus should consider a connection as dead if it has been idle for more
>>> than some timeout value (e.g. 5 minutes).  This bites me every day when
>>> I wake up my computer: if I just hit `g' to refresh the *Group* buffer,
>>> it *always* hangs (I guess it would timeout but only after a long wait,
>>> like 2h).  Instead, I have to go to *Server*, close each server, go back
>>> to *Group* and then hit `g'.
>> Weird. I do the same as you, or almost [1], and don't have that problem.

SM> Of course, the occurrence of my particular problem depends on various
SM> factors, such as whether you get the same IP address when you wake up,
SM> whether you're in the same network when you wake up, whether you're
SM> behind a NAT, how long the NAT router remembers connections, whether the
SM> NAT router's own IP has changed, ...

In the Gnus mailing list we discussed an easy solution (just close all
server connections before `g') but providing that as a user-level
defcustom feels like giving up.  See http://thread.gmane.org/gmane.emacs.gnus.general/80262/focus=83843

I suggested waiting for Lars' opinion.

Ted





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

* bug#16026: Gnus shouldn't use old connections
  2013-12-04 16:04       ` Ted Zlatanov
@ 2017-01-25 16:55         ` Lars Ingebrigtsen
  2017-01-25 18:26           ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: Lars Ingebrigtsen @ 2017-01-25 16:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Sebastien Vauban, 16026

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Mon, 02 Dec 2013 11:12:20 -0500 Stefan Monnier <monnier@iro.umontreal.ca> wrote: 
>
>>>> Gnus should consider a connection as dead if it has been idle for more
>>>> than some timeout value (e.g. 5 minutes).  This bites me every day when
>>>> I wake up my computer: if I just hit `g' to refresh the *Group* buffer,
>>>> it *always* hangs (I guess it would timeout but only after a long wait,
>>>> like 2h).  Instead, I have to go to *Server*, close each server, go back
>>>> to *Group* and then hit `g'.

[...]

> In the Gnus mailing list we discussed an easy solution (just close all
> server connections before `g') but providing that as a user-level
> defcustom feels like giving up.  See http://thread.gmane.org/gmane.emacs.gnus.general/80262/focus=83843
>
> I suggested waiting for Lars' opinion.

There is `nntp-connection-timeout', and nnimap could have something
similar, I guess.

The difficulty is in determining what a good timeout should be.  If you
send an EXPUNGE to an IMAP server, it may legitimately take many
seconds, and you get no output from the server while it's doing this.
If you kill the connection and reissue the commands, you then get error
messages, I think?

But issuing EXPUNGE as the first thing after you haven't used a
connection in a while is unusual.  What usually happens is that you
enter an IMAP group, read a few messages, then your ISP decides that you
should change your IP number, and then you hit `q' which will normally
issue a marks updating command.  That should normally give a response
within a reasonable time.

If a command like that takes more than a few seconds, then we should
probably reconnect...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#16026: Gnus shouldn't use old connections
  2017-01-25 16:55         ` Lars Ingebrigtsen
@ 2017-01-25 18:26           ` Stefan Monnier
  2017-01-30 20:12             ` Ted Zlatanov
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2017-01-25 18:26 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Sebastien Vauban, 16026

> There is `nntp-connection-timeout', and nnimap could have something
> similar, I guess.

> The difficulty is in determining what a good timeout should be.  If you
> send an EXPUNGE to an IMAP server, it may legitimately take many
> seconds, and you get no output from the server while it's doing this.
> If you kill the connection and reissue the commands, you then get error
> messages, I think?

I think in my case a timeout of 30min would cover the main cases already
(i.e. the machine was suspended for more than 30min).


        Stefan





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

* bug#16026: Gnus shouldn't use old connections
  2017-01-25 18:26           ` Stefan Monnier
@ 2017-01-30 20:12             ` Ted Zlatanov
  2017-01-30 22:38               ` Stefan Monnier
  0 siblings, 1 reply; 18+ messages in thread
From: Ted Zlatanov @ 2017-01-30 20:12 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Sebastien Vauban, Lars Ingebrigtsen, 16026

On Wed, 25 Jan 2017 13:26:04 -0500 Stefan Monnier <monnier@IRO.UMontreal.CA> wrote: 

>> There is `nntp-connection-timeout', and nnimap could have something
>> similar, I guess.

>> The difficulty is in determining what a good timeout should be.  If you
>> send an EXPUNGE to an IMAP server, it may legitimately take many
>> seconds, and you get no output from the server while it's doing this.
>> If you kill the connection and reissue the commands, you then get error
>> messages, I think?

SM> I think in my case a timeout of 30min would cover the main cases already
SM> (i.e. the machine was suspended for more than 30min).

I would make it a per-connection setting using the scheme that Michael
Albinus has implemented. Then it can be set per host etc.

Ted





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

* bug#16026: Gnus shouldn't use old connections
  2017-01-30 20:12             ` Ted Zlatanov
@ 2017-01-30 22:38               ` Stefan Monnier
  2017-01-31 14:37                 ` Ted Zlatanov
  0 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2017-01-30 22:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Sebastien Vauban, 16026

> I would make it a per-connection setting using the scheme that Michael
> Albinus has implemented. Then it can be set per host etc.

Not sure if it's worth the trouble, but as long as I can easily set it
globally, that's fine by me.


        Stefan


PS: For me, the need is global because it is mostly caused by NAT
translation, which hence affects the connections to basically all hosts,
except for the very few which are on the same side of the firewall as
I am.





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

* bug#16026: Gnus shouldn't use old connections
  2017-01-30 22:38               ` Stefan Monnier
@ 2017-01-31 14:37                 ` Ted Zlatanov
  2017-01-31 16:26                   ` Michael Albinus
  0 siblings, 1 reply; 18+ messages in thread
From: Ted Zlatanov @ 2017-01-31 14:37 UTC (permalink / raw)
  To: Stefan Monnier, Michael Albinus; +Cc: Lars Ingebrigtsen, 16026

On Mon, 30 Jan 2017 17:38:22 -0500 Stefan Monnier <monnier@IRO.UMontreal.CA> wrote: 

>> I would make it a per-connection setting using the scheme that Michael
>> Albinus has implemented. Then it can be set per host etc.

SM> Not sure if it's worth the trouble, but as long as I can easily set it
SM> globally, that's fine by me.

SM> PS: For me, the need is global because it is mostly caused by NAT
SM> translation, which hence affects the connections to basically all hosts,
SM> except for the very few which are on the same side of the firewall as
SM> I am.

Yes, that's a common situation. Another is home vs. work connections with
different profiles.

It's easy to create an ad-hoc system just for network timeout
parameters, like I did with many GnuTLS parameters early on, but the
systematic approach Michael gave us is much better. The only reason I
haven't implemented it is lack of time.

Ted





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

* bug#16026: Gnus shouldn't use old connections
  2017-01-31 14:37                 ` Ted Zlatanov
@ 2017-01-31 16:26                   ` Michael Albinus
  2017-02-02  3:43                     ` bug#16026: Connection specific settings and proxies Lars Ingebrigtsen
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Albinus @ 2017-01-31 16:26 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: Lars Ingebrigtsen, 16026, Stefan Monnier

Ted Zlatanov <tzz@lifelogs.com> writes:

Hi Ted,

> It's easy to create an ad-hoc system just for network timeout
> parameters, like I did with many GnuTLS parameters early on, but the
> systematic approach Michael gave us is much better. The only reason I
> haven't implemented it is lack of time.

If I could help, just ping me. Not that I have too much free time, but
I'm interested in this.

> Ted

Best regards, Michael.





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

* bug#16026: Connection specific settings and proxies
  2017-01-31 16:26                   ` Michael Albinus
@ 2017-02-02  3:43                     ` Lars Ingebrigtsen
  2017-02-02 14:46                       ` Ted Zlatanov
                                         ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Lars Ingebrigtsen @ 2017-02-02  3:43 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Ted Zlatanov, 16026, Stefan Monnier, Emacs developers

Michael Albinus <michael.albinus@gmx.de> writes:

>> It's easy to create an ad-hoc system just for network timeout
>> parameters, like I did with many GnuTLS parameters early on, but the
>> systematic approach Michael gave us is much better. The only reason I
>> haven't implemented it is lack of time.
>
> If I could help, just ping me. Not that I have too much free time, but
> I'm interested in this.

I was just pondering something that's perhaps related: HTTP proxying in
the with-url branch.

url.el uses an alist on the form ((("http" . "foo.bar:port")
"proxy:port")) or something to determine what connections should be
proxied.  It doesn't support HTTPS proxies (i.e., "CONNECT"), so it's
rather underspecified, if I read the code correctly.

I'm also not sure what level to put the proxies on: Should they be
passed in from the application (i.e., eww, Gnus, etc) or should it be a
global Emacs setting?

If the latter, you could see having a call like

(set-proxy :match-domain ".*\\.foo\\.bar\\'"
           :target-port 443
           :proxy-server "localhost"
           :proxy-port 80
           :method 'connect)

to set up the proxy.  (Well, really, you'd have a mode that would allow
you to tweak the global proxy setup.)

Now, this all kinda ties in with what Ted was talking about: A
per-connection setting thing.  So you could envision doing just the same
with, say, IMAP, if you need to have that be proxied or something, and
then it turns out that the right layer for this stuff is probably in
`open-network-stream': Almost all networking already goes through that
function, so by implementing it there, all clients get automatic proxy
support.

The same mechanism for determining things like lifecycle settings (i.e.,
network timeout parameters) could somehow be squeezed in here.

But I've read the doc for connection-local-set-class-variables, and I
don't quite see how to match up these needs with that mechanism...

And, like I said, I don't know whether it's the right design choice to
have these settings be global, or whether they should be passed in
explicitly from each application.  Would users want to use one set of
proxies while reading HTML news from Gnus and another when reading from
eww?  Perhaps?  Perhaps not?

So many options...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#16026: Connection specific settings and proxies
  2017-02-02  3:43                     ` bug#16026: Connection specific settings and proxies Lars Ingebrigtsen
@ 2017-02-02 14:46                       ` Ted Zlatanov
  2017-02-02 23:58                       ` Daniel McClanahan
       [not found]                       ` <87o9ykr6os.fsf@flea>
  2 siblings, 0 replies; 18+ messages in thread
From: Ted Zlatanov @ 2017-02-02 14:46 UTC (permalink / raw)
  To: Lars Ingebrigtsen
  Cc: Michael Albinus, 16026, Stefan Monnier, Emacs developers

On Thu, 02 Feb 2017 04:43:10 +0100 Lars Ingebrigtsen <larsi@gnus.org> wrote: 

LI> I'm also not sure what level to put the proxies on: Should they be
LI> passed in from the application (i.e., eww, Gnus, etc) or should it be a
LI> global Emacs setting?

LI> If the latter, you could see having a call like

LI> (set-proxy :match-domain ".*\\.foo\\.bar\\'"
LI>            :target-port 443
LI>            :proxy-server "localhost"
LI>            :proxy-port 80
LI>            :method 'connect)

LI> to set up the proxy.  (Well, really, you'd have a mode that would allow
LI> you to tweak the global proxy setup.)

The way Michael set it up, you have connection profiles ("classes") that
can be associated with any variables. (For passers-by, see
`connection-local-set-class-variables', `connection-local-set-classes',
and `with-connection-local-classes'). Profiles can be overlaid to
augment each other.

(Michael: maybe it's not too late to change "class" to "profile"
because the former is so overloaded in our field?)

LI> And, like I said, I don't know whether it's the right design choice to
LI> have these settings be global, or whether they should be passed in
LI> explicitly from each application.  Would users want to use one set of
LI> proxies while reading HTML news from Gnus and another when reading from
LI> eww?  Perhaps?  Perhaps not?

I see. I think the classes should be associated with applications and
protocols and login names, not just connections. Michael, what do you
think? That would require changing the identification parameter to
`connection-local-get-classes' to be an alist or a plist like
:user U :application X :protocol Y :machine Z

I can imagine more criteria in the future, so the identification should
be flexible. This has a pretty big semantic overlap with how auth-source
selects credentials and NSM applies security polity, so I think it makes
sense to absorb those things into the same hierarchy. So IMO this is a
chance to consolidate a lot of disparate code and improve the user
experience.

Then you could have:

"class C1(contains the proxy P1) for IMAP to machines A B C"
"class C2(contains the proxy P2) for everything"
"class C3(contains the proxy P3) for machines B C D"

So IMAP to machine B would get C1/P1, but HTTP to machine B would get
C3/P3 (all the matching classes should be applied in specificity order
so the most specific one wins).

Not all parameters apply everywhere, so we're looking to extract the
truly global ones first: network timeout, proxies, NSM policy, GnuTLS
parameters, auth-source entries.

Ted





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

* bug#16026: Connection specific settings and proxies
  2017-02-02  3:43                     ` bug#16026: Connection specific settings and proxies Lars Ingebrigtsen
  2017-02-02 14:46                       ` Ted Zlatanov
@ 2017-02-02 23:58                       ` Daniel McClanahan
       [not found]                       ` <87o9ykr6os.fsf@flea>
  2 siblings, 0 replies; 18+ messages in thread
From: Daniel McClanahan @ 2017-02-02 23:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen
  Cc: Michael Albinus, Ted Zlatanov, 16026, Stefan Monnier,
	Emacs developers

On Wed, Feb 1, 2017 at 9:43 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> And, like I said, I don't know whether it's the right design choice to have
> these settings be global, or whether they should be passed in explicitly from
> each application.  Would users want to use one set of proxies while reading
> HTML news from Gnus and another when reading from eww?  Perhaps?  Perhaps not?

I'm no expert, but I've often been frustrated by configuration options that
aren't exposed as defcustoms. I think a defcustom of an alist mapping the match
domain to a list/plist of proxy settings would work. If `open-network-stream'
only accepts proxy settings as an argument and Gnus/eww/etc wants to allow
user-specified proxies, it seems each would have to implement its own defcustom
(or some other method) to handle that anyway; configuring these for each package
seems annoying. Callers can use a let binding if they want to override it, which
is about as easy as an argument.

A single global value would make it difficult to have different settings for
different callers. One potential solution is to have an optional "tag" symbol as
part of the proxy settings, which would only use the proxy if the caller
specified the same tag, maybe as a buffer-local variable. So Gnus could set the
tag to 'gnus or something in its mode, and a user could add a proxy entry with
the 'gnus tag. This might be confusing, though.

I don't use proxies too extensively, but something like that would have removed
the need for some hacky defadvice I used to configure my ssh connections on a
corporate network last summer. Just a thought.





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

* bug#16026: Connection specific settings and proxies
       [not found]                       ` <87o9ykr6os.fsf@flea>
@ 2017-02-03 15:37                         ` Michael Albinus
  2017-02-06 15:22                           ` Ted Zlatanov
       [not found]                           ` <87k293ny36.fsf@flea>
  0 siblings, 2 replies; 18+ messages in thread
From: Michael Albinus @ 2017-02-03 15:37 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 16026, Stefan Monnier, Emacs developers

Ted Zlatanov <tzz@lifelogs.com> writes:

Hi Ted,

> The way Michael set it up, you have connection profiles ("classes") that
> can be associated with any variables. (For passers-by, see
> `connection-local-set-class-variables', `connection-local-set-classes',
> and `with-connection-local-classes'). Profiles can be overlaid to
> augment each other.
>
> (Michael: maybe it's not too late to change "class" to "profile"
> because the former is so overloaded in our field?)

Well, I've stolen the "class" name from directory-local variables. The
concept of connection-local variables is closed to that of directory-local.

No problem to rename it, if it helps. And sometimes I'm even not sure
whether we need the class/profile concept; it might be even sufficient
to bind variables to connections directly, like variables can be bound
directly to buffers.

> LI> And, like I said, I don't know whether it's the right design choice to
> LI> have these settings be global, or whether they should be passed in
> LI> explicitly from each application.  Would users want to use one set of
> LI> proxies while reading HTML news from Gnus and another when reading from
> LI> eww?  Perhaps?  Perhaps not?
>
> I see. I think the classes should be associated with applications and
> protocols and login names, not just connections. Michael, what do you
> think? That would require changing the identification parameter to
> `connection-local-get-classes' to be an alist or a plist like
> :user U :application X :protocol Y :machine Z

Well, currently a class is bound to a connection via a regexp, which is
used for checking the result of `file-remote-p'. This is good for Tramp,
but it is less good for url-* functionality unless `url-handler-mode' is
enabled, and it does not work for other applications like imap-based
connections.

Your proposal looks OK to me. U, Y and Z shall be regexps, X a symbol
(or also a regexp?). All of them shall be optional.

> Ted

Best regards, Michael.





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

* bug#16026: Connection specific settings and proxies
  2017-02-03 15:37                         ` Michael Albinus
@ 2017-02-06 15:22                           ` Ted Zlatanov
       [not found]                           ` <87k293ny36.fsf@flea>
  1 sibling, 0 replies; 18+ messages in thread
From: Ted Zlatanov @ 2017-02-06 15:22 UTC (permalink / raw)
  To: Michael Albinus
  Cc: Lars Ingebrigtsen, 16026, Stefan Monnier, Emacs developers

On Fri, 03 Feb 2017 16:37:52 +0100 Michael Albinus <michael.albinus@gmx.de> wrote: 

MA> Ted Zlatanov <tzz@lifelogs.com> writes:
MA> Hi Ted,

>> The way Michael set it up, you have connection profiles ("classes") that
>> can be associated with any variables. (For passers-by, see
>> `connection-local-set-class-variables', `connection-local-set-classes',
>> and `with-connection-local-classes'). Profiles can be overlaid to
>> augment each other.
>> 
>> (Michael: maybe it's not too late to change "class" to "profile"
>> because the former is so overloaded in our field?)

MA> Well, I've stolen the "class" name from directory-local variables. The
MA> concept of connection-local variables is closed to that of directory-local.

MA> No problem to rename it, if it helps. And sometimes I'm even not sure
MA> whether we need the class/profile concept; it might be even sufficient
MA> to bind variables to connections directly, like variables can be bound
MA> directly to buffers.

I think from the user's side, it's necessary. We have to associate the
data with a profile, which is then exposed as a configurable entity.

Let's call them "connection profiles" to be very clear, since just
"profile" can be ambiguous as well.

>> I see. I think the classes should be associated with applications and
>> protocols and login names, not just connections. Michael, what do you
>> think? That would require changing the identification parameter to
>> `connection-local-get-classes' to be an alist or a plist like
>> :user U :application X :protocol Y :machine Z

MA> Well, currently a class is bound to a connection via a regexp, which is
MA> used for checking the result of `file-remote-p'. This is good for Tramp,
MA> but it is less good for url-* functionality unless `url-handler-mode' is
MA> enabled, and it does not work for other applications like imap-based
MA> connections.

MA> Your proposal looks OK to me. U, Y and Z shall be regexps, X a symbol
MA> (or also a regexp?). All of them shall be optional.

Wonderful. I propose that the application should be a defgroup symbol,
and every connection profile should be required to have a defgroup.

That would give us an implicit connection profile hierarchy and a place
to hook connection profile customizations at the UI level.

So defining connection profiles would be something like this:

(add-connection-profiles :user U :defgroup X :protocol Y :machine Z
                         :profile 'UXYZ :vars '(...))

(add-connection-profiles :profile 'general :vars '(...))

And then the application Gnus would do (note it's required that the
defgroup 'gnus exists):

(connection-profile-get-local-variables :defgroup 'gnus ...other criteria...)

From the user's side, they would say

M-x customize-connection-profile UXYZ ; change criteria or settings
M-x customize-connection-profile general ; change criteria or settings
M-x create-connection-profile atwork ; specify desired settings
M-x connection-profiles ; some kind of table/list UI

Let me know what you think.

Thanks
Ted





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

* bug#16026: Connection specific settings and proxies
       [not found]                           ` <87k293ny36.fsf@flea>
@ 2017-02-12 17:42                             ` Michael Albinus
       [not found]                             ` <87d1enz4p2.fsf@gmx.de>
  1 sibling, 0 replies; 18+ messages in thread
From: Michael Albinus @ 2017-02-12 17:42 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 16026, Stefan Monnier, Emacs developers

Ted Zlatanov <tzz@lifelogs.com> writes:

Hi Ted,

> MA> Well, I've stolen the "class" name from directory-local variables. The
> MA> concept of connection-local variables is closed to that of directory-local.
>
> MA> No problem to rename it, if it helps. And sometimes I'm even not sure
> MA> whether we need the class/profile concept; it might be even sufficient
> MA> to bind variables to connections directly, like variables can be bound
> MA> directly to buffers.
>
> I think from the user's side, it's necessary. We have to associate the
> data with a profile, which is then exposed as a configurable entity.
>
> Let's call them "connection profiles" to be very clear, since just
> "profile" can be ambiguous as well.

OK, I'll change next time I'll touch the code.

> MA> Well, currently a class is bound to a connection via a regexp, which is
> MA> used for checking the result of `file-remote-p'. This is good for Tramp,
> MA> but it is less good for url-* functionality unless `url-handler-mode' is
> MA> enabled, and it does not work for other applications like imap-based
> MA> connections.
>
> MA> Your proposal looks OK to me. U, Y and Z shall be regexps, X a symbol
> MA> (or also a regexp?). All of them shall be optional.
>
> Wonderful. I propose that the application should be a defgroup symbol,
> and every connection profile should be required to have a defgroup.
>
> That would give us an implicit connection profile hierarchy and a place
> to hook connection profile customizations at the UI level.
>
> So defining connection profiles would be something like this:
>
> (add-connection-profiles :user U :defgroup X :protocol Y :machine Z
>                          :profile 'UXYZ :vars '(...))
>
> (add-connection-profiles :profile 'general :vars '(...))

Well, I'm a little bit lost. What does the defgroup here? I understand
that replaces what you have called initially an application, but I don't
see what defcustoms shall be placed now under the defgroup
hierarchy. Could you pls give an example?

I also know that there are users reluctant to the customization
machinery. Wouldn't we loose them?

> Thanks
> Ted

Best regards, Michael.





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

* bug#16026: Connection specific settings and proxies
       [not found]                             ` <87d1enz4p2.fsf@gmx.de>
@ 2017-02-20 16:01                               ` Lars Ingebrigtsen
  0 siblings, 0 replies; 18+ messages in thread
From: Lars Ingebrigtsen @ 2017-02-20 16:01 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 16026, Stefan Monnier, Emacs developers

Michael Albinus <michael.albinus@gmx.de> writes:

>> So defining connection profiles would be something like this:
>>
>> (add-connection-profiles :user U :defgroup X :protocol Y :machine Z
>>                          :profile 'UXYZ :vars '(...))
>>
>> (add-connection-profiles :profile 'general :vars '(...))
>
> Well, I'm a little bit lost. What does the defgroup here? I understand
> that replaces what you have called initially an application, but I don't
> see what defcustoms shall be placed now under the defgroup
> hierarchy. Could you pls give an example?
>
> I also know that there are users reluctant to the customization
> machinery. Wouldn't we loose them?

Yeah, I think a special mode to tweak connection specific variables
would be better, perhaps...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2017-02-20 16:01 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.7856.1385996719.10748.bug-gnu-emacs@gnu.org>
     [not found] ` <mailman.7856.1385996719.10748.bug-gnu-emacs-mXXj517/zsQ@public.gmane.org>
2013-12-02 15:19   ` bug#16026: Gnus shouldn't use old connections Sebastien Vauban
2013-12-02 16:12     ` Stefan Monnier
2013-12-04 16:04       ` Ted Zlatanov
2017-01-25 16:55         ` Lars Ingebrigtsen
2017-01-25 18:26           ` Stefan Monnier
2017-01-30 20:12             ` Ted Zlatanov
2017-01-30 22:38               ` Stefan Monnier
2017-01-31 14:37                 ` Ted Zlatanov
2017-01-31 16:26                   ` Michael Albinus
2017-02-02  3:43                     ` bug#16026: Connection specific settings and proxies Lars Ingebrigtsen
2017-02-02 14:46                       ` Ted Zlatanov
2017-02-02 23:58                       ` Daniel McClanahan
     [not found]                       ` <87o9ykr6os.fsf@flea>
2017-02-03 15:37                         ` Michael Albinus
2017-02-06 15:22                           ` Ted Zlatanov
     [not found]                           ` <87k293ny36.fsf@flea>
2017-02-12 17:42                             ` Michael Albinus
     [not found]                             ` <87d1enz4p2.fsf@gmx.de>
2017-02-20 16:01                               ` Lars Ingebrigtsen
2013-12-02 15:03 bug#16026: Gnus shouldn't use old connections Stefan Monnier
2013-12-02 15:53 ` Leo Liu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).