From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
Philipp = Stephani <p.s= tephani2@gmail.com> writes:
> It's possible to fix this (see attached patch), but at the expense= of
> breaking other valid use cases such as (cl-incf (buffer-local-value
> ...)). Not sure whether the bug can be fixed at all without breaking > other stuff.
I have no solution, but some thoughts.
The more I think about it, the more I come to the conclusion that
`buffer-local-value' does not have a well defined according place.
The function `buffer-local-value' is not injective: it maps different states to the same value because it can't express whether the VARIABLE&= #39;s
binding is buffer-local or not.=C2=A0 But we need this information because = we
need to undo creating a buffer local binding in the setter when closing
the `letf'.
And the setter, accepting only a value for the binding, isn't
surjective, because the argument doesn't hold any information of
buffer-localness.=C2=A0 Moreover, we want the setter to always create a
buffer-local binding in one situation (setf), but this isn't true for the setter we need to use for `cl-letf'.
We could widen the semantics of `cl-letf' to do what we want in this
case, but I'm not sure if it's worth the trouble.=C2=A0 Not if ther= e are more
cases like this.