GNU bug report logs -
#26624
26.0.50; Generalized variable `buffer-local-value' does't restore local flag
Previous Next
Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>
Date: Sun, 23 Apr 2017 17:14:02 UTC
Severity: normal
Found in version 26.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Philipp Stephani <p.stephani2 <at> gmail.com> schrieb am So., 23. Apr. 2017 um
19:14 Uhr:
>
> In *scratch*, evaluate:
>
> (defvar foo-test-var nil)
> (with-temp-buffer
> (list (list (buffer-local-value 'foo-test-var (current-buffer))
> (local-variable-p 'foo-test-var)
> (local-variable-if-set-p 'foo-test-var))
> (cl-letf (((buffer-local-value 'foo-test-var (current-buffer))
> 123))
> (list (buffer-local-value 'foo-test-var (current-buffer))
> (local-variable-p 'foo-test-var)
> (local-variable-if-set-p 'foo-test-var)))
> (list (buffer-local-value 'foo-test-var (current-buffer))
> (local-variable-p 'foo-test-var)
> (local-variable-if-set-p 'foo-test-var))))
>
> The result is:
>
> ((nil nil nil) (123 t t) (nil t t))
>
> But expected is:
>
> ((nil nil nil) (123 t t) (nil nil nil))
>
> i.e. the local flag of the variable should be reset.
>
>
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.
[Message part 2 (text/html, inline)]
[0001-Have-cl-letf-restore-buffer-local-status-Bug-26624.txt (text/plain, attachment)]
This bug report was last modified 2 years and 276 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.