unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
To: Karoly Lorentey <karoly@lorentey.hu>
Cc: Andreas Schwab <schwab@suse.de>,
	Dan Nicolaescu <dann@ics.uci.edu>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	joakim@verona.se, emacs-devel@gnu.org
Subject: Re: Multi-tty design (Re: Reordering etc/NEWS)
Date: Fri, 18 May 2007 13:48:13 +0200	[thread overview]
Message-ID: <86tzuamjya.fsf@lola.quinscape.zz> (raw)
In-Reply-To: <464D8826.8080504@lorentey.hu> (Karoly Lorentey's message of "Fri\, 18 May 2007 13\:04\:06 +0200")

Karoly Lorentey <karoly@lorentey.hu> writes:

> David Kastrup wrote:
>>>>> But if that's really the case, we can still make `process-environment'
>>>>> have a terminal-local binding (with, I assume, DEFVAR_KBOARD), and have
>>>>> all existing third-party Elisp code continue to work without changes.
>>>> I'm not sure I understand: wouldn't this choice break the mentioned AUCTeX
>>>> code, then?
>>> No, not at all.  The special environment may be set up for a single
>>> client/terminal/whatever only, but I doubt the code switches frames
>>> before it starts whatever subprocess it wants to start in the temporary
>>> environment.
>> 
>> Uh what?  This is code being run when Emacs is started up, namely when
>> custom-set-variables is called.  
>
> I'm sorry; I thought we are talking about a piece of code that let-binds
> process-environment.   Clearly I was wrong.

I was talking elsewhere of that.  The AUCTeX code was an example for
something that goes through the process-environment once and does
changes based on what it finds there.  This was basically an example
for code that would not work predictably with terminal-local values of
TEXINPUT*.  So it was making a case for having a global environment by
default.

> If the code uses setenv to permanently set variables, then it would
> work fine on multi-terminal sessions in my proposed terminal-local
> design.
>
> For single-terminal users, the code will remain working no matter
> what it does.
>
>> It would only work unchanged with terminal-local
>> process-environment if the non-terminal local tail of
>> process-environment was shared.
>
> The actual underlying requirement is that `setenv' should affect all
> existing and future terminals.  Tail-merging is an implementation
> choice.
>
>> And that is a solution which has some appeal because of its
>> cleverness, but which is clearly too clever and fragile to make for
>> something one wants to document and use.
>
> I disagree.  It is actually a very simple and predictable system
> that's easy to explain.

How come that I am arguing against my idea and you are arguing for it?

Ok, my main objection was that it is hard to conceive how to set up a
new terminal, namely where the shared tail starts.

If the shared tail, however, has its own symbol (as I actually did
propose, naming it global-process-environment), this is not hard to
do.

One would still have to do the following:
a) have a list of terminal-local variable names.  When the environment
is first read in, those are picked out from global-process-environment
and put into the terminal-local list instead.  This might have to
include unset variables in some form.  Probably as "DISPLAY=" since
for shells and applications, an empty variable and a deleted variable
are identical.  Just using "DISPLAY" alone might possibly be
misinterpreted by current readers of process-environment.

b) have setenv work also on unset variables, and make sure that it
does not clobber the global-process-environment situation.  This might
be non-trivial if one requests deletion of the first environment
variable from global-process-environment: this deletion would not work
on the shared tails.  So we might want to start
global-process-environment with a dummy entry that never gets removed.

Personally, I would consider this sort of implementation ugly.

However, it has two advantages: process-environment will tell the
whole story of the environment on a given terminal.  Old code will
very likely work.

And both the variants with terminal-local complete environments and
terminal-local partial environments can be implemented with just a few
lines of code.

So people will have a way to test both behaviors.  If at the end of
the testing one clear choice emerges, one might consider implementing
it in a less hackish manner that will leave the other choice out in
the cold.

>> Note that two emacsclient processes (and possibly an emacs -nw)
>> started in the same tty will all share their settings (which I
>> consider reasonable), while starting, say, two emacsclient
>> processes in two different "screen" ttys will each give them their
>> own settings.
>
> So what?  That's not a bug per se.

I was just explaining some consequences of the pure terminal-local (as
opposed to client-local) approach.  I don't consider it a bug, and so
much the better if you don't, either.

>> I really feel we should restrict that to terminal-related variables
>> by default.  That's simple to understand and has no strong
>> drawbacks that I can see.
>
> I say we must support both.  Clearly, people are divided on the
> issue.  Once we have greater experience with these features, we can
> standardize on the right thing.  I doubt we will be able to convince
> each other now.

Well, my "shared tail hack" offers a path to get experience with both
approaches.  Both approaches from you and me would require existing
code to be adapted (and possibly in different ways for each approach),
and the hack will probably spare us from most of that while the jury
is still out.

-- 
David Kastrup

  reply	other threads:[~2007-05-18 11:48 UTC|newest]

Thread overview: 251+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-04 21:17 Reordering etc/NEWS Richard Stallman
2007-05-05 22:42 ` Glenn Morris
2007-05-05 22:49   ` Jason Rumney
2007-05-06 17:57   ` Richard Stallman
2007-05-06 18:18     ` Glenn Morris
2007-05-06 20:28     ` Eli Zaretskii
2007-05-07 16:50       ` Richard Stallman
2007-05-07 17:07         ` David Kastrup
2007-05-08  6:27           ` Jan Djärv
2007-05-07 17:36         ` Glenn Morris
2007-05-07 18:05           ` David Kastrup
2007-05-07 17:53         ` spect. [Was: Reordering etc/NEWS] Alan Mackenzie
2007-05-07 18:16           ` Mathias Dahl
2007-05-07 21:51         ` Reordering etc/NEWS Eli Zaretskii
2007-05-07 22:04           ` David Kastrup
2007-05-08 18:09           ` Richard Stallman
2007-05-08 21:09             ` David Kastrup
2007-05-09  8:57             ` Kim F. Storm
2007-05-09  9:23               ` David Kastrup
2007-05-09 17:54               ` JD Smith
2007-05-09 19:42                 ` Eli Zaretskii
2007-05-09 19:59                   ` JD Smith
2007-05-09 20:29                 ` Stefan Monnier
2007-05-09 20:54                   ` Nick Roberts
2007-05-10 13:05                 ` Richard Stallman
2007-05-09 21:56               ` Karl Fogel
2007-05-09 22:15                 ` David Kastrup
2007-05-09 22:25                   ` Karl Fogel
2007-05-09 22:32                     ` David Kastrup
2007-05-09 22:59                       ` Karl Fogel
2007-05-10  7:24                       ` Jason Rumney
2007-05-10  7:49                         ` David Kastrup
2007-05-10  8:04                           ` joakim
2007-05-10  9:19                             ` Jason Rumney
2007-05-10  9:32                               ` David Kastrup
2007-05-10  9:42                               ` joakim
2007-05-10  9:52                                 ` David Kastrup
2007-05-10 10:10                                   ` David Kastrup
2007-05-11 23:27                                     ` Karoly Lorentey
2007-05-12  7:53                                       ` David Kastrup
2007-05-12 12:09                                         ` Multi-tty design (Re: Reordering etc/NEWS) Károly Lo"rentey
2007-05-12 13:34                                           ` David Kastrup
2007-05-12 17:21                                             ` Karoly Lorentey
2007-05-12 18:03                                               ` David Kastrup
2007-05-13 11:08                                                 ` Károly Lőrentey
2007-05-13 12:50                                                   ` David Kastrup
2007-05-13 16:41                                                     ` David Kastrup
2007-05-13 17:04                                                       ` Andreas Schwab
2007-05-13 17:18                                                         ` David Kastrup
2007-05-13 18:11                                                           ` Andreas Schwab
2007-05-13 18:17                                                             ` David Kastrup
2007-05-13 18:22                                                           ` Dan Nicolaescu
2007-05-13 20:13                                                             ` David Kastrup
2007-05-13 20:41                                                               ` David Kastrup
2007-05-13 21:11                                                                 ` David Kastrup
2007-05-22  0:39                                                                   ` Giorgos Keramidas
2007-05-13 21:18                                                                 ` Dan Nicolaescu
2007-05-14  6:33                                                                   ` David Kastrup
2007-05-13 21:05                                                               ` Dan Nicolaescu
2007-05-14 10:11                                                               ` Karoly Lorentey
2007-05-14 10:37                                                                 ` David Kastrup
2007-05-14 11:35                                                                   ` Andreas Schwab
2007-05-14 12:24                                                                     ` David Kastrup
2007-05-14 12:45                                                                       ` Andreas Schwab
2007-05-14 12:52                                                                         ` David Kastrup
2007-05-14 13:36                                                                           ` Andreas Schwab
2007-05-14 13:41                                                                             ` David Kastrup
2007-05-14 13:42                                                                               ` Andreas Schwab
2007-05-14 16:48                                                                               ` Dan Nicolaescu
2007-05-14 17:29                                                                                 ` David Kastrup
2007-05-14 18:19                                                                                   ` Dan Nicolaescu
2007-05-14 19:07                                                                                     ` David Kastrup
2007-05-14 20:04                                                                                       ` Dan Nicolaescu
2007-05-14 20:24                                                                                         ` David Kastrup
2007-05-14 21:02                                                                                           ` Dan Nicolaescu
2007-05-14 21:20                                                                                             ` Jason Rumney
2007-05-14 21:49                                                                                               ` Dan Nicolaescu
2007-05-14 22:00                                                                                                 ` David Kastrup
2007-05-15 19:38                                                                                               ` Richard Stallman
2007-05-14 21:27                                                                                             ` David Kastrup
2007-05-14 22:13                                                                                               ` Dan Nicolaescu
2007-05-14 22:27                                                                                                 ` David Kastrup
2007-05-14 22:38                                                                                                   ` Thien-Thi Nguyen
2007-05-14 22:44                                                                                                     ` David Kastrup
2007-05-14 23:03                                                                                                       ` Multi-tty design Nick Roberts
2007-05-14 23:29                                                                                                         ` David Kastrup
2007-05-15  7:44                                                                                                       ` Multi-tty design (Re: Reordering etc/NEWS) Dan Nicolaescu
2007-05-15  8:24                                                                                                         ` Jason Rumney
2007-05-16  1:51                                                                                                       ` Karoly Lorentey
2007-05-14 22:59                                                                                                     ` Jason Rumney
2007-05-14 23:22                                                                                                     ` Miles Bader
2007-05-14 22:42                                                                                                   ` joakim
2007-05-14 22:55                                                                                                     ` David Kastrup
2007-05-14 22:50                                                                                                   ` Dan Nicolaescu
2007-05-14 23:05                                                                                                     ` Lennart Borgman (gmail)
2007-05-15  7:41                                                                                                       ` David Kastrup
2007-05-15 16:48                                                                                                         ` Lennart Borgman (gmail)
2007-05-14 22:35                                                                                                 ` Thien-Thi Nguyen
2007-05-15 15:53                                                                                             ` Karoly Lorentey
2007-05-16  1:41                                                                                               ` Karoly Lorentey
2007-05-16 15:41                                                                                                 ` Stefan Monnier
2007-05-17 13:12                                                                                                   ` David Kastrup
2007-05-17 15:31                                                                                                     ` Károly Lo"rentey
2007-05-17 17:00                                                                                                       ` David Kastrup
2007-05-17 20:02                                                                                                         ` Ken Raeburn
2007-05-17 21:17                                                                                                           ` David Kastrup
2007-05-18  3:36                                                                                                           ` Károly Lőrentey
2007-05-17 22:51                                                                                                       ` Stefan Monnier
2007-05-18  2:58                                                                                                         ` Karoly Lorentey
2007-05-18  7:19                                                                                                           ` David Kastrup
2007-05-18 11:04                                                                                                             ` Karoly Lorentey
2007-05-18 11:48                                                                                                               ` David Kastrup [this message]
2007-05-18 11:58                                                                                                                 ` Karoly Lorentey
2007-05-18  2:52                                                                                                       ` Miles Bader
2007-05-17 22:46                                                                                                     ` Stefan Monnier
2007-05-17 14:35                                                                                                   ` Károly Lo"rentey
2007-05-17  9:59                                                                                                 ` Richard Stallman
2007-05-17 14:05                                                                                                   ` Karoly Lorentey
2007-05-17 16:46                                                                                                 ` David Kastrup
2007-05-17 23:11                                                                                                   ` Stefan Monnier
2007-05-18  7:36                                                                                                     ` David Kastrup
2007-05-18 14:24                                                                                                       ` Stefan Monnier
2007-05-18 14:49                                                                                                         ` David Kastrup
2007-05-18 16:27                                                                                                           ` Stefan Monnier
2007-05-20  9:04                                                                                                             ` David Kastrup
2007-05-21 13:15                                                                                                               ` Stefan Monnier
2007-05-21 13:35                                                                                                                 ` David Kastrup
2007-05-22  1:54                                                                                                                   ` Miles Bader
2007-05-22  6:37                                                                                                                     ` David Kastrup
2007-05-22 15:49                                                                                                                       ` Richard Stallman
2007-05-22 21:26                                                                                                                         ` David Kastrup
2007-05-23 18:55                                                                                                                           ` Richard Stallman
2007-05-23 19:24                                                                                                                             ` David Kastrup
2007-05-24 10:55                                                                                                                               ` Richard Stallman
2007-05-24 11:04                                                                                                                                 ` David Kastrup
2007-05-18 15:18                                                                                                       ` Eli Zaretskii
2007-05-18  2:47                                                                                                   ` Karoly Lorentey
2007-05-18  8:14                                                                                                     ` David Kastrup
2007-05-18 11:55                                                                                                       ` Karoly Lorentey
2007-05-18 12:24                                                                                                         ` David Kastrup
2007-05-18 17:40                                                                                                           ` Karoly Lorentey
2007-05-18 18:18                                                                                                             ` David Kastrup
2007-05-18 23:09                                                                                                           ` Richard Stallman
2007-05-20 18:13                                                                                                             ` Károly Lo"rentey
2007-05-14 21:05                                                                                           ` David Kastrup
2007-05-12 21:52                                             ` Richard Stallman
2007-05-12 16:48                                       ` Reordering etc/NEWS Richard Stallman
2007-05-10 10:24                                   ` joakim
2007-05-10 10:24                                 ` Jason Rumney
2007-05-11 22:58                               ` Multi-tty branch status (Re: Reordering etc/NEWS) Karoly Lorentey
2007-05-12  4:20                                 ` Glenn Morris
2007-05-12  6:48                                   ` Kalle Olavi Niemitalo
2007-05-12  7:58                                     ` David Kastrup
2007-05-12 16:48                                       ` Richard Stallman
2007-05-12 10:30                                   ` Károly Lo"rentey
2007-05-12 11:11                                     ` David Kastrup
2007-05-12 21:52                                     ` Richard Stallman
2007-05-12 16:48                                 ` Richard Stallman
2007-05-12 17:25                                   ` Karoly Lorentey
2007-05-10 10:28                         ` Reordering etc/NEWS YAMAMOTO Mitsuharu
2007-05-09 22:58                     ` Nick Roberts
2007-05-10  6:21                       ` David Kastrup
2007-05-10  1:23                     ` Stefan Monnier
2007-05-10  1:43                       ` Karl Fogel
2007-05-11  7:42                   ` Richard Stallman
2007-05-11  8:03                     ` Kenichi Handa
2007-05-11  8:34                       ` Nick Roberts
2007-05-11  8:44                       ` Merging multitty (was: Reordering etc/NEWS) David Kastrup
2007-05-11  9:20                         ` Merging multitty Jason Rumney
2007-05-11 10:00                           ` David Kastrup
2007-05-11 10:25                             ` Jason Rumney
2007-05-11 11:01                               ` David Kastrup
2007-05-11 21:05                               ` Karoly Lorentey
2007-05-12 16:48                                 ` Richard Stallman
2007-05-12 17:58                                   ` David Kastrup
2007-05-14 10:52                                     ` Kenichi Handa
2007-05-12 19:32                                   ` Dan Nicolaescu
2007-05-12 19:42                                     ` David Kastrup
2007-05-12 20:19                                       ` Dan Nicolaescu
2007-05-12 20:27                                         ` David Kastrup
2007-05-12 20:30                                     ` Samium Gromoff
2007-05-11 21:10                               ` Károly Lo"rentey
2007-05-11 12:00                             ` Kenichi Handa
2007-05-11 13:14                               ` David Kastrup
2007-05-11 13:33                                 ` Juanma Barranquero
2007-05-11 13:51                                   ` David Kastrup
2007-05-11 13:57                                     ` David Kastrup
2007-05-11 14:09                                       ` Jason Rumney
2007-05-11 14:17                                     ` Juanma Barranquero
2007-05-11 14:34                                     ` Miles Bader
2007-05-11 21:34                                   ` Karoly Lorentey
2007-05-12  7:43                                     ` Eli Zaretskii
2007-05-11 13:34                               ` merging Unicode branch and availability of Windows binaries Drew Adams
2007-05-14 14:16                                 ` Drew Adams
2007-05-14 14:30                                   ` David Kastrup
2007-05-14 15:05                                     ` Drew Adams
2007-05-14 17:32                                       ` David Kastrup
2007-05-11 21:56                           ` Merging multitty Richard Stallman
2007-05-11  9:45                         ` Miles Bader
2007-05-11 10:02                           ` David Kastrup
2007-05-11 21:56                           ` Richard Stallman
2007-05-13  1:33                             ` Miles Bader
2007-05-13  3:11                               ` Nick Roberts
2007-05-13  3:27                                 ` Miles Bader
2007-05-13  4:00                                   ` Nick Roberts
2007-05-13  4:21                                     ` Miles Bader
2007-05-13 12:43                                       ` Karoly Lorentey
2007-05-14  8:08                                   ` Richard Stallman
2007-05-14 10:19                                     ` Miles Bader
2007-05-14 11:02                                     ` Karoly Lorentey
2007-05-14 14:46                                       ` Kim F. Storm
2007-05-15  9:46                                       ` Richard Stallman
2007-05-15 20:49                                         ` Eli Zaretskii
     [not found]                                         ` <4649F799.3050108@lorentey.hu>
2007-05-16  1:39                                           ` Richard Stallman
2007-05-10 13:06               ` Reordering etc/NEWS Richard Stallman
2007-05-10 14:14                 ` Juanma Barranquero
2007-05-10 14:25                   ` David Kastrup
2007-05-10 14:49                     ` Juanma Barranquero
2007-05-10 17:15                       ` David Kastrup
2007-05-10 17:21                         ` Juanma Barranquero
2007-05-10 15:53                 ` Karl Fogel
2007-05-10 17:39                   ` Ken Manheimer
2007-05-10 17:44                     ` Juanma Barranquero
2007-05-11  8:50                   ` Eli Zaretskii
2007-05-11 11:23                     ` Juanma Barranquero
2007-05-11 15:46                       ` Eli Zaretskii
2007-05-11 16:09                         ` Juanma Barranquero
2007-05-11 17:43                           ` Eli Zaretskii
2007-05-11 17:49                     ` Karl Fogel
2007-05-11 18:26                       ` Eli Zaretskii
2007-05-11 18:37                         ` Karl Fogel
2007-05-12  7:22                           ` Eli Zaretskii
2007-05-12  7:59                             ` David Kastrup
2007-05-12 13:24                               ` Eli Zaretskii
2007-05-12 16:47                           ` Richard Stallman
2007-05-11 18:48                   ` Richard Stallman
2007-05-11 21:46                     ` Karl Fogel
2007-05-10 17:13                 ` David Kastrup
2007-05-11 18:48                   ` Richard Stallman
2007-05-07 16:50       ` Richard Stallman
2007-05-07 21:37         ` Eli Zaretskii
2007-05-07 21:56           ` David Kastrup
2007-05-07 10:05     ` Alan Mackenzie
2007-05-07 10:12       ` David Kastrup
2007-05-07 13:39         ` Jay Belanger
2007-05-07 13:45           ` David Kastrup
2007-05-07 13:54             ` Thomas Hühn
2007-05-07 14:03               ` David Kastrup
2007-05-07 14:57       ` Chong Yidong
2007-05-07 23:28         ` Richard Stallman
2007-05-07 23:28       ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86tzuamjya.fsf@lola.quinscape.zz \
    --to=dak@gnu.org \
    --cc=dann@ics.uci.edu \
    --cc=emacs-devel@gnu.org \
    --cc=joakim@verona.se \
    --cc=karoly@lorentey.hu \
    --cc=monnier@iro.umontreal.ca \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).