From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: How to post-process the buffer populated by the async `start-process' Date: Fri, 11 Jan 2019 22:34:53 -0500 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1547264037 28250 195.159.176.226 (12 Jan 2019 03:33:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 12 Jan 2019 03:33:57 +0000 (UTC) To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 12 04:33:53 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1giA3V-0007Gj-1i for geh-help-gnu-emacs@m.gmane.org; Sat, 12 Jan 2019 04:33:53 +0100 Original-Received: from localhost ([127.0.0.1]:55738 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giA5b-00052X-Sc for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jan 2019 22:36:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1giA5A-00052P-7u for help-gnu-emacs@gnu.org; Fri, 11 Jan 2019 22:35:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1giA57-0005Hg-9u for help-gnu-emacs@gnu.org; Fri, 11 Jan 2019 22:35:35 -0500 Original-Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]:35280) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1giA56-0005GY-Vm for help-gnu-emacs@gnu.org; Fri, 11 Jan 2019 22:35:33 -0500 Original-Received: by mail-lf1-x130.google.com with SMTP id e26so12214775lfc.2 for ; Fri, 11 Jan 2019 19:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=SIwRc4YO7i6viROCoc1tvKalAlbuStd8107y0aSturs=; b=GQy00x14d4aYF8Km8Q4t61CfJ0PuXVtNynKT1OMLZFVeNNJ1/T3ef9IhkisFwrmohL 3o/dO9Bd3ZRH7jE20znIisRor2p6WGwLZcjQkwZHj01PkiJ2EDSsxbjjhZrUFSiQvlTU I56apRvKkyiAH1w//5rXElxitd1WUAMnbRqpTplmOAasxatwf/nCqFiSq/lt7K6pucN5 QBCIRch0jh+mrOJk0O2aeeFWsmrmne1ZjjrewrjfIs/3iGIImeSRlK8vIHsYs0tKhyZ/ BPZqlJWkH322GQBCGxbl2E0J9u5p7ozYv4IixUIWWDW8mPgElPz0g1XUNyomg1vzDsQk kNkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=SIwRc4YO7i6viROCoc1tvKalAlbuStd8107y0aSturs=; b=GXrGy2KsE4C621K40ayWY7HY/kZefUaq84YOBuhDJY1npNj/Kr7r7/iz9QZ1vXcYXf lNQOYq7dC9i6Ok9isZwU8C9aG/ihL3k2QMPZOj3/keya+AMFSPFydOx/QHHUMdZqCRoE Bvr41rt5rfqgFKf2UB6y5vqMjOTCnkN76awp4ZWvvw1K6/nr2EYJ1oFdlKhQ8vSM5odw A8N3mI/offnTIX7V+Wd9AnSN1qHXRnEm4wI/O6e8G/xDienIAgwB56ArOQjSclbJYPqV fwiLJkI5PvpIsi/qhX6efBNxjj1lYWomF3dgjZ5Pir8YVlKxceg9F9v95SIb7RUaDY9c nuYg== X-Gm-Message-State: AJcUukcqj1NA934xpkTJm/X9SaK/1LfaC56/K0zfJBHrqXhHZNNH4PVr BpB608FHd1UAKD5okDBN1Feb6HtqqPX78EXwhlyRidvc X-Google-Smtp-Source: ALg8bN6i7xHNhA64jK8Pb39L9e8f5YH+YegYEIdDwRX7ek3N8w4oh9qRc4G9piH/jeCWzHLRaoweIL/GnXYL0kBvI64= X-Received: by 2002:a19:1cb:: with SMTP id 194mr9361955lfb.61.1547264130466; Fri, 11 Jan 2019 19:35:30 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::130 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:119108 Archived-At: Hello, I am using a package which starts a command in a subprocess (async) using `start-process' and the results of the command are dumped in the buffer arg passed to subprocess. But the stdout sent to the buffer has ANSI escape codes. If I manually visit that buffer, and eval (ansi-color-apply-on-region-int (point-min) (point-max)), I can see the ANSI color codes nicely rendered. But I cannot figure out how to do that *when* the start-process initiated command ends *in* the specified stdout buffer. If I do: (apply #'start-process ..) (with-current-buffer buffer (ansi-color-apply-on-region-int (point-min) (point-max)) ) .. it of course doesn't work because the a-c-a-o-r-i is getting called before start-process initiated command ends. So I somehow need to define a hook that can get triggered when that command ends, and then call the a-c-a-o-r-i function. But I don't know how. -- Kaushal Modi