From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?Johan_Bockg=C3=A5rd?= Newsgroups: gmane.emacs.devel Subject: Re: Is emacsclient --eval broken? Date: Mon, 15 Aug 2016 21:08:50 +0200 Message-ID: <87oa4t97el.fsf@gnu.org> References: <2e73e12c-5662-ae84-4fd7-64f585997290@gmail.com> <83vazejjjf.fsf@gnu.org> <87eg62jgek.fsf@gnu.org> <83oa56jg6y.fsf@gnu.org> <83h9axkj8z.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1471288160 31211 195.159.176.226 (15 Aug 2016 19:09:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 15 Aug 2016 19:09:20 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cc: =?utf-8?Q?Cl=C3=A9ment?= Pit--Claudel , emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 15 21:09:16 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bZNG6-0007ow-BD for ged-emacs-devel@m.gmane.org; Mon, 15 Aug 2016 21:09:15 +0200 Original-Received: from localhost ([::1]:38545 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZNG3-0007JK-HH for ged-emacs-devel@m.gmane.org; Mon, 15 Aug 2016 15:09:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39289) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZNFt-0007J7-U3 for emacs-devel@gnu.org; Mon, 15 Aug 2016 15:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZNFs-00040I-01 for emacs-devel@gnu.org; Mon, 15 Aug 2016 15:09:00 -0400 Original-Received: from smtprelay-h21.telenor.se ([195.54.99.196]:54229) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZNFm-000403-70; Mon, 15 Aug 2016 15:08:54 -0400 Original-Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-h21.telenor.se (Postfix) with ESMTP id 0FA4FC74F; Mon, 15 Aug 2016 21:08:52 +0200 (CEST) X-SMTPAUTH-B2: [bocjoh] X-SENDER-IP: [85.228.195.4] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2CEBABSErJXEATD5FVeHAGDKIFDD4J5g3mGO6wXgX2GHQKBUDkUAQEBAQEBAQEBBgEBAQEBAQEBN0CEXwEBAwFWIwULCyElDwEEGAEMChoTiCkMAb4LAQEBBwEBAQEjineEKoVxBZk+nlmQLx6EMjoyhyQBAQE X-IPAS-Result: A2CEBABSErJXEATD5FVeHAGDKIFDD4J5g3mGO6wXgX2GHQKBUDkUAQEBAQEBAQEBBgEBAQEBAQEBN0CEXwEBAwFWIwULCyElDwEEGAEMChoTiCkMAb4LAQEBBwEBAQEjineEKoVxBZk+nlmQLx6EMjoyhyQBAQE X-IronPort-AV: E=Sophos;i="5.28,526,1464645600"; d="scan'208";a="1376337643" Original-Received: from c-04c3e455.04-211-6c6b701.cust.bredbandsbolaget.se (HELO muon.localdomain) ([85.228.195.4]) by ipb3.telenor.se with ESMTP; 15 Aug 2016 21:08:52 +0200 Original-Received: by muon.localdomain (Postfix, from userid 1000) id 2A83A4841F2; Mon, 15 Aug 2016 21:08:51 +0200 (CEST) In-Reply-To: <83h9axkj8z.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 06 Aug 2016 18:30:20 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.54.99.196 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:206605 Archived-At: Eli Zaretskii writes: > There must be something that the client cannot interpret, or maybe we > are not prepared to deal with strings that span more than one packet > returned by recv? The function in server.el that splits the reply has a bug: diff --git a/lisp/server.el b/lisp/server.el index 59fd973..650323d 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -782,7 +782,7 @@ (defun server-reply-print (qtext proc) ;; We have to split the string (setq part (substring qtext 0 (- server-msg-size (length prefix) 1))) ;; Don't split in the middle of a quote sequence - (if (string-match "\\(^\\|[^&]\\)\\(&&\\)+$" part) + (if (string-match "\\(^\\|[^&]\\)&\\(&&\\)*$" part) ;; There is an uneven number of & at the end (setq part (substring part 0 -1))) (setq qtext (substring qtext (length part)))