From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matthias Pfeifer Newsgroups: gmane.emacs.help Subject: call-process writing to the wrong buffer Date: Wed, 2 Nov 2016 12:30:23 +0100 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1478086284 32142 195.159.176.226 (2 Nov 2016 11:31:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 2 Nov 2016 11:31:24 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 02 12:31:20 2016 Return-path: Envelope-to: geh-help-gnu-emacs@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 1c1tkx-0005Uw-Ln for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Nov 2016 12:30:59 +0100 Original-Received: from localhost ([::1]:54336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1tl0-0001lQ-HG for geh-help-gnu-emacs@m.gmane.org; Wed, 02 Nov 2016 07:31:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c1tkT-0001kG-F8 for help-gnu-emacs@gnu.org; Wed, 02 Nov 2016 07:30:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c1tkP-0004m3-MZ for help-gnu-emacs@gnu.org; Wed, 02 Nov 2016 07:30:29 -0400 Original-Received: from mail-ua0-x236.google.com ([2607:f8b0:400c:c08::236]:35365) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c1tkP-0004lN-Hv for help-gnu-emacs@gnu.org; Wed, 02 Nov 2016 07:30:25 -0400 Original-Received: by mail-ua0-x236.google.com with SMTP id 12so9895256uas.2 for ; Wed, 02 Nov 2016 04:30:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=BEcUjf12XfKYSjhAOeeAMLql2/si0uik7KiIaP/52zM=; b=fXuh3n17i419NusqBQotRmc631cLx1CRZ8CGdFc1mj51/BESkGdwaYsUXMQEly3DRW BymYcOkXlb7pgD0pXPYXzikLH6Bcj3cBSIGCLxDoRJBq1uFp02in4Vl8l/FKoLSyrLz4 zOFw8KetGr2JD/2wlO9oT7d6ty6TQDKajLYc8TzwRdxCxgzS5VJBuh7S+TyOWIjQZRDC oix7A+2AAHL0WQvkgP5c9R5/wudTm3i6/sapLJRSKhaiERygxE5b/1K2zN80IU9vi9// YXKgLW60GE/TCqc0gfw3BMsXdXchz7gkJNVqVeuFj1bTin+kxGEa6fKDr4OAziJSoTVI dEJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=BEcUjf12XfKYSjhAOeeAMLql2/si0uik7KiIaP/52zM=; b=H4u8l5cL4qQXI+u98SgBf4gEJPlD+zBECB17dvHSl9EGZuIRmU8/Ny7IhmryKNgDEw aPdcxqqmqiHM206d0ndbzMyT839QAlhNotztX+EtHxAXcawhsfLxHtxcKwdBzsRUOOgo 9z0WmWKKn01A+9pJLeZ3mgBc9B2UCoJdN8mcI6nQgoVmh8PaMgwAQHW2/STOdCvZUiEU 6QBd3X02rfaU3gBt4R4Np7ZG//LD8DOLa7k/cu2kAnvIyyrvjM3qKODa56RBJA+yRlXj CVhZ9jtrXP5UXNBWOOckVQGF915ALdq5UrPp+V+KjbieIOY5eWLbII5Nbbt/s6lrvdQZ Px0Q== X-Gm-Message-State: ABUngvfjzooE+CMgmZQSTfeq68r/pW8QrG0GCn4UK0za2grD5pwfUmENyxCUoUPVeb6QVDi+kfpHAhCSEqHCyw== X-Received: by 10.159.40.231 with SMTP id d94mr1955863uad.122.1478086224415; Wed, 02 Nov 2016 04:30:24 -0700 (PDT) Original-Received: by 10.103.74.217 with HTTP; Wed, 2 Nov 2016 04:30:23 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c08::236 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111650 Archived-At: I frequently have to look into a binary file and want to translate it into text by using an external program. I came up with this snippet from which I had expected that it opens a new buffer, selects that buffer and writes into it the output of this external program: (defun mp/show-x509 () (interactive) (let ((cert-file (buffer-file-name)) (right-window (split-window-right)) (openssl-buffer (generate-new-buffer (generate-new-buffer-name "*openssl*")))) (select-window right-window) (set-window-buffer nil openssl-buffer) (call-process "openssl" nil t (list openssl-buffer t) "x509" "-text" "-noout" "-in" cert-file))) However I must have some misunderstanding here. The output of call-process is in fact inserted into the window on the left (left when assuming there is only one window in the frame when caling mp/show-x509). And I really do not have a clue whats wrong. matthias