emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: buffer-substring vs. buffer-substring-no-properties


From: Stefan Monnier
Subject: Re: buffer-substring vs. buffer-substring-no-properties
Date: Thu, 15 Nov 2001 12:48:48 -0500

> >> PS: by the way all of the above works the same in Emacs-20 as in Emacs-21.
> 
> No, it does not.  That is the entire point.  RMS and others are
> telling this was a bug that was fixed in 21.1.  This example is from
> 20.7:
> 
> x
> #("(defun fo" 0 1 nil 1 6 (face font-lock-keyword-face) 6 7 nil 7 9 (face 
> font-lock-function-name-face))
> 
> (format "%s" x)
> "(defun fo"
> 
> (format "%S" x)
> "#(\"(defun fo\" 0 1 nil 1 6 (face font-lock-keyword-face) 6 7 nil 7 9 (face 
> font-lock-function-name-face))"
> 
> I depended on the 20.7 behavior.

But if you pass those results to your backend process (which is what
I was talking about) instead of passing them to the pretty printer,
the results will be the same in Emacs-20.7 as in Emacs-21.1:

- `defun fo'
- `defun fo'
- ` #("(defun fo" 0 1 nil 1 6 (face font-lock-keyword-face) 6 7 nil 7 9 (face 
font-lock-function-name-face))'

So you still haven't told us if you ever use the `%S' argument
to format or if you use prin1 somewhere in your code.  If
you do, that's probably your mistake and you should use something
else instead.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]