unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#12293: setf behavior difference
@ 2012-08-28 13:47 Dan Nicolaescu
  2012-08-28 19:36 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2012-08-28 13:47 UTC (permalink / raw)
  To: 12293


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...





^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#12293: setf behavior difference
  2012-08-28 13:47 bug#12293: setf behavior difference Dan Nicolaescu
@ 2012-08-28 19:36 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2012-08-28 19:36 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: 12293-done

>     (setf (buffer-string) (buffer-string))

Oops, indeed.  Should be fixed now, thanks for catching it,


        Stefan





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-28 19:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-28 13:47 bug#12293: setf behavior difference Dan Nicolaescu
2012-08-28 19:36 ` Stefan Monnier

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).