unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Propagating local variables?
@ 2018-05-15 19:37 John Wiegley
  2018-05-16  3:42 ` Roland Winkler
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: John Wiegley @ 2018-05-15 19:37 UTC (permalink / raw)
  To: emacs-devel; +Cc: Shea Levy

I'd like to create a module, propagate.el, which defines a new class of buffer
local variables: buffer local variables that propagate to any buffers or
processes (in the case of exec-path and process-environment) created on behalf
of the parent.

For example, in certain language modes I have `exec-path' customized to pick
up specific versions of the compiler and debugger. If I run M-x gdb, I'd like
the debugger used to be the one associated with _that_ buffer -- without
making that debugger global to all other buffers (or even available at all).

Right now this idea lies at the heart of Shea Levy's nix-buffer package,
allowing you to have the equivalent of a "nix-shell" within Emacs, so that a
given buffer (and its related child buffers and processes) all see a
consistent set of dependencies as defined by some dir-locals.nix file.

A next step for this project is to abstract out the concept of "propagating
locals" to its own module. However, some of the aspects of implementing it
have proven very hacky, so I'm wondering if we need more low-level support for
this idea. For example, at the moment we do it with advice around
generate-new-buffer. What would be better is to have a general hook for
altering what happens when new buffers and processes are created, something
that could "provide an environment" upon creation of these.

All thoughts welcome,
-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



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

end of thread, other threads:[~2018-05-20 19:09 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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