emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Propagating local variables?


From: John Shahid
Subject: Re: Propagating local variables?
Date: Sat, 19 May 2018 15:09:17 +0000
User-agent: mu4e 1.1.0; emacs 27.0.50

Richard Stallman <address@hidden> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
>   > The parent is the buffer where you create the variables that will extend 
> to
>   > any children spawned "on behalf" of that buffer. So, not every buffer you
>   > create while currently visiting that buffer, but those which match some 
> kind
>   > of predicate.
>
> That makes sense to me.  But I see two ways to do it:
>
> * choose which buffers are its children
> based on filtering their names.
>
> * specify, when creating a buffer, what parent buffer (if any) it
> should have.

Out of curiosity, if we go down this path, are we willing to change
functions such as `with-temp-buffer' to create a child buffer by default
? I recently had a use case for this feature. I wanted to set
`process-environment' as a buffer-local variable for certain buffers. I
achieved that using a mode-hook. This worked great with `call-process'
but didn't work so well when `process-lines' was used. `process-lines'
will create a new temp buffer and the buffer-local value is lost.

Now that I think about it, may be `with-temp-buffer' can take another
argument for the parent buffer that `process-lines' could use.

Anyway, I just wanted to share my use case, which could benefit from the
second option.

cheers,

js



reply via email to

[Prev in Thread] Current Thread [Next in Thread]