emacs-devel
[Top][All Lists]
Advanced

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

RE: Two problems with directory-local variables


From: Drew Adams
Subject: RE: Two problems with directory-local variables
Date: Wed, 19 Sep 2018 18:42:42 -0700 (PDT)

> Given that, I don't see what would be a good choice for generalization:
> 
> 1. Since requirements for this feature are too vague, it doesn't seem
>    to fit well into low-level printing functions.
> 
> 2. Reformatting the printed output in pp-buffer to add dots where necessary
>    also doesn't look like an elegant solution.
> 
> 3. Implementing print-alist poses a question how to define at which levels
>    to print alists with dotted syntax.
> 
> 4. Since only add-dir-local-variable knows the semantics of used data
>    structures, the simplest way would be to implement printing of each level
>    explicitly in add-dir-local-variable.

I don't think there's a good design for this. Whatever some designer's intention
beforehand might be, the result will be misleading in at least some contexts.

And the problem is that when it's misleading (showing some dots but not
others it can be even more confusing for users than consistently doing either
what we do now - no dots for a list cdr, at all levels - or adding dots at all 
levels.

I think (so far, but I might change my mind if I see a good argument) that this
is really something that users of Lisp just have to get used to. It can be a
gotcha - like getting used to quoting (when to quote and when not to). Lisp
has a few such gotchas.

We could I suppose have `print-dot-levels', like we have `print-level', to give
code control over the level (top-down). That might be a little better than
`print-dotted' (Boolean). But is it really worth it (needed)? I tend not to
think it's worth it to have just a top-level `print-alist', in any case (and the
alist might not be at top level).

As Stefan said, "only the human coder can know which cons cell should be
printed dotted and which shouldn't." I'd change "cell" to "cells", but
otherwise I pretty much agree.



reply via email to

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