From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: server-eval-and-print only returns non-nil values Date: Sun, 3 Jul 2011 15:38:09 +0200 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1309700478 19301 80.91.229.12 (3 Jul 2011 13:41:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 3 Jul 2011 13:41:18 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 03 15:41:15 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QdMvA-0006J4-0c for ged-emacs-devel@m.gmane.org; Sun, 03 Jul 2011 15:41:12 +0200 Original-Received: from localhost ([::1]:48222 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdMv8-0007VC-Fn for ged-emacs-devel@m.gmane.org; Sun, 03 Jul 2011 09:41:10 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:59335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdMsv-00077z-6J for emacs-devel@gnu.org; Sun, 03 Jul 2011 09:38:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QdMst-0008F1-NR for emacs-devel@gnu.org; Sun, 03 Jul 2011 09:38:53 -0400 Original-Received: from mail-pz0-f41.google.com ([209.85.210.41]:54598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QdMst-0008Em-6a for emacs-devel@gnu.org; Sun, 03 Jul 2011 09:38:51 -0400 Original-Received: by pzk4 with SMTP id 4so794201pzk.0 for ; Sun, 03 Jul 2011 06:38:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=URj9sOxtnagDuIXy0nenzIFQLP9b+fz139E99uAD+5Y=; b=YnAh4d1E7zA/vr63QQlrtnMJIY5Nom5bMWqRUTBAx+oZhlJn+BcLv7zHp/0tf+3jQF JoO89NMV8qYsFUK+OEKEcOXiDZEkVmEvOU025TpeBcxVp9ymlO95p4HOl23ybrAfWVzH zqwa726qTTxhKmMJTelA81pdHd+6SbElffkKw= Original-Received: by 10.142.144.11 with SMTP id r11mr2459474wfd.335.1309700329334; Sun, 03 Jul 2011 06:38:49 -0700 (PDT) Original-Received: by 10.142.50.7 with HTTP; Sun, 3 Jul 2011 06:38:09 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.41 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141492 Archived-At: Is there any reason why server-eval-and-print only returns non-nil values? C:\> emacsclient -e "(file-exists-p \"C:/\")" t C:> emacsclient -e "(file-exists-p \"Z:/\")" C:> If not, I'd like to fix it with the trivial patch below. =C2=A0 =C2=A0 Juanma 2011-07-03 Juanma Barranquero * server.el (server-eval-and-print): Return any result, even nil. =3D=3D=3D modified file 'lisp/server.el' --- lisp/server.el 2011-06-25 18:05:48 +0000 +++ lisp/server.el 2011-07-03 13:33:25 +0000 @@ -679,7 +679,7 @@ (defun server-eval-and-print (expr proc) "Eval EXPR and send the result back to client PROC." (let ((v (eval (car (read-from-string expr))))) - (when (and v proc) + (when proc (with-temp-buffer (let ((standard-output (current-buffer))) (pp v)