all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Roland Winkler <winkler@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: Propagating local variables?
Date: Tue, 15 May 2018 22:42:04 -0500	[thread overview]
Message-ID: <87fu2se06r.fsf@gnu.org> (raw)
In-Reply-To: m236ys7ls5.fsf@newartisans.com

On Tue, May 15 2018, John Wiegley wrote:
> 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.

This is an interesting idea.  I am not sure whether the following is
related to your thoughts.  I'll mention it anyway:

In GNU Elpa is djvu.el for editing djvu documents.  These documents come
with multiple layers for text, annotations, bookmarks, etc. (kind of
similar to pdf documents).  So when you visit such a document with
djvu.el it creates a buffer for each of these layers (plus a few extra
ones for "viewing these layers").  Conventional buffer-local variables
do not work in this case because the buffer-local variables need to be
shared across the buffers that refer to the same document, but buffers
for different documents should peacefully coexist.  Hence to make this
work djvu.el uses a conventional buffer-local variable whose value is a
vector which is the same object for all buffers belonging to one djvu
document (one vector for each djvu document).  The elements of this
vector are then the "document-local" variables where setting such an
element in one buffer is seen in all other buffers for the same
document, while buffers for different djvu documents do not interfere
with each other.  Another advantage is that temp buffers can easily
inherit these document-local variables.

I have always considered this a hack.  But I could not think of a better
solution.  Suggestions are welcome.

Roland




  reply	other threads:[~2018-05-16  3:42 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 [this message]
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

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=87fu2se06r.fsf@gnu.org \
    --to=winkler@gnu.org \
    --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.