GNU bug report logs - #6390
Should not regexp-quote quote newline?

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Thu, 10 Jun 2010 14:43:02 UTC

Severity: wishlist

Tags: wontfix

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 6390 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: 6390 <at> debbugs.gnu.org
Subject: Re: bug#6390: Should not regexp-quote quote newline?
Date: Fri, 11 Jun 2010 02:44:04 +0200
On Fri, Jun 11, 2010 at 1:11 AM, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:
> On Thu, Jun 10, 2010 at 8:07 PM, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>> On Thu, Jun 10, 2010 at 7:03 PM, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
>>> Lennart Borgman <lennart.borgman <at> gmail.com> writes:
>>>
>>>> Thanks, but that does not apply to the situation I am talking about.
>>>
>>> No, it is exactly what you want.
>>
>>
>> Yes, you are right. Something like this seems to do what I want:
>>
>> (defun my-quote-string (str)
>>  "Return string STR quoted like `prin1' do it."
>>  (let ((ret (prin1-to-string str)))
>>    (substring ret 1 -1)))
>
> For the record here is a better version
>
> (defun reb-quote-string (str)
>  "Return string STR quoted like `prin1' do it."
>  (let* ((print-escape-newlines t)
>        (ret (prin1-to-string str)))
>   (substring ret 1 -1)))
>
> Something changed print-escape-newlines somewhere ...

Unfortunately print-escape-newlines does not quote tab, only newline
and form-feed. Which in my opinion is a bug. To fix this just copy 5
lines in print.c at line 1667 and replace form-feed with tab. (I have
just done that in my patched copy, but it is easier to do this by hand
then to use a patch.)

Is there any objections to this change?




This bug report was last modified 13 years and 318 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.