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: Kevin Layer
Subject: Re: buffer-substring vs. buffer-substring-no-properties
Date: Thu, 15 Nov 2001 10:40:25 -0800

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

To be clear, I used to take the result of (format "%s" string) and
send it to another process with process-send-string.  Now, I give to
process-send-string the value of string after calling

   (set-text-properties 0 (length string) nil string)

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

%s, not %S.  I mentioned it on gnu.emacs.bug.  I forgot that I hadn't
on this list.

>> 
>> 
>>      Stefan
>> 




reply via email to

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