From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6390: Should not regexp-quote quote newline? Date: Thu, 10 Jun 2010 17:34:46 +0200 Message-ID: References: <2312722CD01C4D5BAA9DF0A3DA9377DC@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1276185535 28023 80.91.229.12 (10 Jun 2010 15:58:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Jun 2010 15:58:55 +0000 (UTC) Cc: 6390@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 10 17:58:54 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OMk9d-0000tk-U7 for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jun 2010 17:58:54 +0200 Original-Received: from localhost ([127.0.0.1]:52078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMk9d-0002dy-A9 for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jun 2010 11:58:53 -0400 Original-Received: from [140.186.70.92] (port=55999 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMk9D-0002MN-O5 for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 11:58:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMk9C-0000WG-59 for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 11:58:27 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57100) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMk9C-0000WC-3g for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 11:58:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OMjnW-0004E0-F1; Thu, 10 Jun 2010 11:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Jun 2010 15:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6390 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6390-submit@debbugs.gnu.org id=B6390.127618411416232 (code B ref 6390); Thu, 10 Jun 2010 15:36:02 +0000 Original-Received: (at 6390) by debbugs.gnu.org; 10 Jun 2010 15:35:14 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMjmk-0004Dl-2r for submit@debbugs.gnu.org; Thu, 10 Jun 2010 11:35:14 -0400 Original-Received: from mail-yw0-f196.google.com ([209.85.211.196]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMjmi-0004Dg-7E for 6390@debbugs.gnu.org; Thu, 10 Jun 2010 11:35:12 -0400 Original-Received: by ywh34 with SMTP id 34so82816ywh.30 for <6390@debbugs.gnu.org>; Thu, 10 Jun 2010 08:35:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=8OqU7ue08cd1gX5XhF2LigRGUbE8K3cM1s+ad0gauQU=; b=Q57jhUF0N3Yb7RbDwLnn6UEd39kIhDO9N2IFiBmRQVFuitXiNZCKUCGWvrFw/JvJPp PY1J+XEY7ld2ZvmwiT50KDtmiS28CjXteq65UKzEHgiRTmoCAoOXShJj4IbsIcWihnL9 Mc5VAJ4fl53k6l8XJOOwUxH6YGPZzi2rFO7Us= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=fIUEmLOGSkt/NHZil7VLrpyxd6Rbrme7xLBy+sCI8TehtP+Ry2tc9AWrgKB+VZKDbK PWsxTEFNp2tDe3sGjy1UrExJ3FsSnSm7ECcgAR7eQP4OUttTgnKBfNEYI8EY398VCXhL 9M9d/qwa1pnChLd3Z0QtsHJ/7OjDxaowZzZ2c= Original-Received: by 10.101.133.5 with SMTP id k5mr316375ann.169.1276184107191; Thu, 10 Jun 2010 08:35:07 -0700 (PDT) Original-Received: by 10.100.154.15 with HTTP; Thu, 10 Jun 2010 08:34:46 -0700 (PDT) In-Reply-To: <2312722CD01C4D5BAA9DF0A3DA9377DC@us.oracle.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 10 Jun 2010 11:36:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:37656 Archived-At: On Thu, Jun 10, 2010 at 5:22 PM, Drew Adams wrote: >> (setq x (regexp-quote "a >> b")) >> (message "length x=%d" (length x)) >> >> The length of x will be 3 because the string returned >> by regexp-quote includes a newline. >> Would it not be more practical if the result was "a\nb"? > > I, for one, do not understand you. Yes, I saw that Andreas probably did not get either what I wanted to say. I checked the length because looking at x is a bit frustrating because of the translations between newline <-> \n that might occur. > (setq y "a > b") > (setq x (regexp-quote y)) > (setq z "a\nb") > (equal x y) = (equal x z) = t > (length x) = (length z) = 3 > > What are you trying to say? That the regexp-quoted string includes the new line character instead of the two chararcers \n. The latter is more practical in many situations since this is a regexp. > And what does it mean to "quote newline"? Replacing newline char with \n. You can of course do that yourself, but I really see no reason why regexp-quote should not do it. (Yes, the regexp works just as well with newline in it as the two chars \n in it.) Perhaps people wants it this way, but then I would suggest that the doc strings tells about the current behaviour. Maybe there should be a function `string-quote' that does replacements of newline => \n etc? > Please try to explain clearly what the problem is that you see, or what you are > trying to do that does not succeed as you expect. > >