unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: Nicolas Richard <youngfrog@members.fsf.org>
Cc: 21201@debbugs.gnu.org
Subject: bug#21201: 25.0.50; (buffer-modified-p) errors inside cl-letf
Date: Thu, 6 Aug 2015 22:44:52 +0100	[thread overview]
Message-ID: <CAAdUY-LTzUGeC_6QKaiCf7YCCHPPTCCespeZ85JMYoWmSB3cig@mail.gmail.com> (raw)
In-Reply-To: <87lhdo41vy.fsf@members.fsf.org>

2015-08-06 21:07 GMT+01:00 Nicolas Richard <youngfrog@members.fsf.org>:
> Artur Malabarba <bruce.connor.am@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?





  reply	other threads:[~2015-08-06 21:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 19:47 bug#21201: 25.0.50; (buffer-modified-p) errors inside cl-letf Artur Malabarba
2015-08-06 20:07 ` Nicolas Richard
2015-08-06 21:44   ` Artur Malabarba [this message]
2015-08-06 22:50     ` Nicolas Richard
2018-07-17 12:16       ` Noam Postavsky
2018-08-28  0:01         ` Noam Postavsky

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAdUY-LTzUGeC_6QKaiCf7YCCHPPTCCespeZ85JMYoWmSB3cig@mail.gmail.com \
    --to=bruce.connor.am@gmail.com \
    --cc=21201@debbugs.gnu.org \
    --cc=youngfrog@members.fsf.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).