all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: Propagating local variables?
Date: Thu, 17 May 2018 10:45:50 -0400	[thread overview]
Message-ID: <jwvo9he73q5.fsf-monnier+gmane.emacs.devel@gnu.org> (raw)
In-Reply-To: m2vabnrzh0.fsf@newartisans.com

> SM> I only mentioned it as a mechanism to share a variable among various
> SM> buffers. We could decide that shell.el obeys a `parent-buffer` variable
> SM> (presumably set by some other package) when non-nil by fetching the
> SM> buffer-local `process-environment' of that buffer.
> There are too many other cases where this is needed.  Expecting it to happen
> "by convention" means it won't happen in many cases where it should, simply
> because the idea of referencing a parent buffer was omitted.

Agreed.

Maybe this is remotely related to the idea of major-mode variables.

We could imagine introducing a new notion of "setting", with operations like:

    (setting-set NAME VALUE CONTEXT)
    (setting-get NAME)

where `setting-get` returns the "nearest" setting of NAME.
CONTEXT could be:
- a window
- a frame
- a major-mode
- a buffer
- a directory
- a file
- a terminal
- ...

and the notion of proximity would impose some ordering between these
different CONTEXT values.  Of course, the current-buffer would be
"nearer" than the current frame, but what about the parent of the
current-buffer?
[ This is relevant to your use-case since in some situations we
  currently look at frame-parameters to decide how to build subprocess's
  environment variables (more specifically for the DISPLAY env-var).
  So a process-environment would actually want to be a combination of
  the environment specified from the frame and that specified by your
  parent's buffer.  ]

Of course, like all other proposals it doesn't solve the problem of
making sure this new mechanism is used everywhere.


        Stefan




  reply	other threads:[~2018-05-17 14:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15 19:37 Propagating local variables? John Wiegley
2018-05-16  3:42 ` Roland Winkler
2018-05-16 17:34   ` Stefan Monnier
2018-05-16 18:59     ` John Wiegley
2018-05-16 20:49       ` Stefan Monnier
2018-05-16 22:46         ` John Wiegley
2018-05-17 14:45           ` Stefan Monnier [this message]
2018-05-16 21:02     ` Roland Winkler
2018-05-17  3:00 ` Richard Stallman
2018-05-17  5:16   ` John Wiegley
2018-05-18  2:32     ` Richard Stallman
2018-05-18  4:28       ` John Wiegley
2018-05-18 20:15         ` Shea Levy
2018-05-19  3:19         ` Richard Stallman
2018-05-19 15:09       ` John Shahid
2018-05-20  3:19         ` Richard Stallman
2018-05-17 12:18 ` Shea Levy
2018-05-17 14:27   ` Clément Pit-Claudel
2018-05-18  2:33     ` Richard Stallman
2018-05-18  3:18     ` Stefan Monnier
2018-05-19 12:06     ` Philipp Stephani
2018-05-20 19:09       ` Clément Pit-Claudel
2018-05-19 12:11 ` Philipp Stephani
2018-05-19 19:12   ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=jwvo9he73q5.fsf-monnier+gmane.emacs.devel@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.