unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dan Nicolaescu <dann@gnu.org>
To: 12293@debbugs.gnu.org
Subject: bug#12293: setf behavior difference
Date: Tue, 28 Aug 2012 09:47:11 -0400	[thread overview]
Message-ID: <yxq7gsj2ko0.fsf@fencepost.gnu.org> (raw)


setf behaves differently in 24.1 vs current trunk.

Save this in test.el:

(require 'cl)

(defvar my-string "
TEST
TEST")

(defun my-test ()
  (with-temp-buffer
    (insert my-string)
    (goto-char (point-min))
    (while (re-search-forward "\r\n" nil t)
      (replace-match "\n" nil nil nil 1))
    (setf (buffer-string) (buffer-string))
    (princ (buffer-string))))

(my-test)


$ /usr/bin/emacs-24.1  --batch -l test.el

TEST
TEST

$ ./emacs --batch -l test.el
$

that is emacs from trunk prints nothing.

The code sequence is derived from bbdb-vcard.el at http://github.com/trebb/bbdb-vcard
and the effect is that the package stopped working. 

Searching the web for "(setf (buffer-string)" there are hits in a few
other packages.
It's a rather odd thing to do, but it looks like people are doing it...





             reply	other threads:[~2012-08-28 13:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28 13:47 Dan Nicolaescu [this message]
2012-08-28 19:36 ` bug#12293: setf behavior difference Stefan Monnier

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=yxq7gsj2ko0.fsf@fencepost.gnu.org \
    --to=dann@gnu.org \
    --cc=12293@debbugs.gnu.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).