GNU bug report logs -
#21201
25.0.50; (buffer-modified-p) errors inside cl-letf
Previous Next
Reported by: bruce.connor.am <at> gmail.com
Date: Thu, 6 Aug 2015 19:48:01 UTC
Severity: minor
Tags: fixed, patch
Merged with 29371
Found in versions 25.0.50, 26.0.50
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 21201 <at> debbugs.gnu.org (full text, mbox):
2015-08-06 21:07 GMT+01:00 Nicolas Richard <youngfrog <at> members.fsf.org>:
> Artur Malabarba <bruce.connor.am <at> gmail.com> writes:
>
>> From emacs -Q, run the following:
>>
>> (cl-letf (((buffer-modified-p)))
>> (insert "ookok"))
>>
>> You'll get an error from trying to set a nil buffer.
>
> Here is a fix:
> --8<---------------cut here---------------start------------->8---
> modified lisp/emacs-lisp/cl-lib.el
> @@ -634,8 +634,10 @@ If ALIST is non-nil, the new pairs are prepended to it."
> ;; Some more Emacs-related place types.
> (gv-define-simple-setter buffer-file-name set-visited-file-name t)
> (gv-define-setter buffer-modified-p (flag &optional buf)
> - `(with-current-buffer ,buf
> - (set-buffer-modified-p ,flag)))
> + (if buf
> + `(with-current-buffer ,buf
> + (set-buffer-modified-p ,flag))
> + `(set-buffer-modified-p ,flag)))
Don't know if it's possible, but shouldn't it try to ensure that it's
in the same buffer as before?
This bug report was last modified 6 years and 271 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.