From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#41788: 28.0.50; emacsclient -t doesn't work with vipe from moreutils Date: Mon, 06 Jun 2022 16:49:38 +0200 Message-ID: <87leu9sv7h.fsf@gnus.org> References: <288bd9d3-1c7c-e3fa-fd02-e1287f8329ec@gmail.com> <87wndtuc1k.fsf@gnus.org> <87r141hmww.fsf@igel.home> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21299"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Platon Pronko , 41788@debbugs.gnu.org To: Andreas Schwab Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 06 17:04:09 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nyEH2-0005HZ-Uk for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jun 2022 17:04:08 +0200 Original-Received: from localhost ([::1]:50062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nyEH2-0006VU-2I for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 06 Jun 2022 11:04:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyE3O-0002RR-SI for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2022 10:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyE3O-0002fT-Hx for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2022 10:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nyE3O-00030l-Cd for bug-gnu-emacs@gnu.org; Mon, 06 Jun 2022 10:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 06 Jun 2022 14:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41788 X-GNU-PR-Package: emacs Original-Received: via spool by 41788-submit@debbugs.gnu.org id=B41788.165452698911538 (code B ref 41788); Mon, 06 Jun 2022 14:50:02 +0000 Original-Received: (at 41788) by debbugs.gnu.org; 6 Jun 2022 14:49:49 +0000 Original-Received: from localhost ([127.0.0.1]:36467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyE3B-000302-1l for submit@debbugs.gnu.org; Mon, 06 Jun 2022 10:49:49 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:41260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nyE39-0002zn-QE for 41788@debbugs.gnu.org; Mon, 06 Jun 2022 10:49:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mq+38UgdhUTAs3h7T+9eyUUFUtwgfdo+TDU0g0k5Cq0=; b=C/Yzb2zmpX50nY/rKxsHzsFvO0 YJUR/fCUB/6WuDCzIKRpzwxDB+izvd3wg11c8hRnsoFTKbjKAcuATUBlJd2KpvUwxJnS4uCjamlJH 3782GR/WuZeypKvf13u6gXFPIHZkQd6IP8ct3+4w3Us8uKmWW2/LYAybuUynsAi/hUH4=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nyE30-0004H7-Sn; Mon, 06 Jun 2022 16:49:41 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEWFclhVQTIdEAv/ //8rGVcNAAAAAWJLR0QDEQxM8gAAAAd0SU1FB+YGBg4NCvkHQhoAAAE5SURBVCjPTZIxbsMwDEXp Idk7tIOPkFN0cYdONWASiHYHsE7TRRo8xwbIU/aTEop4sPTMT0r8NA3Z/NkTXnSxBt8OY4M0QUHr KzzMPOsekBps7DlsxeEIWC+cEdPJQZmuus0EiZHpzJvxzyWgSEGRMiaHp2hSZmEBmBRR2e1wyHVn O3fLp0cqzlBc1RRgmrHzh3C8amxDZi46I2I71r3LUKB/d6ix1gZnz26yrmnQIvkFLOHgfxDUAKj3 Y/MR8PvhRwqsAPCG6+Qi4UEzeBmj7Vu5JyQOAdncwOcU7uSCXHtGgWIOyp8OM0DceQdoK5xalwTA HGt2QGRLrTddb5hPTBsmvo9Gb70f+0pKQ4OHVUBvqAIOgqWeVu2UQhh3iq4PYaKpu6MrwP+EsLAs 5EkxhcwOVx+Q9zr8AQi4PeGz57eYAAAAEGVYSWZJSSoACAAAAAAAAAAAAAAAnDy5KAAAACV0RVh0 ZGF0ZTpjcmVhdGUAMjAyMi0wNi0wNlQxNDoxMzoxMCswMDowMFckIjgAAAAldEVYdGRhdGU6bW9k aWZ5ADIwMjItMDYtMDZUMTQ6MTM6MTArMDA6MDAmeZqEAAAAAElFTkSuQmCC X-Now-Playing: Cabaret Of Complexity's _Tuxedomooning: A Tribute_: "Blind (full version)" In-Reply-To: <87r141hmww.fsf@igel.home> (Andreas Schwab's message of "Mon, 06 Jun 2022 16:44:15 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:233796 Archived-At: Andreas Schwab writes: > It's not emacsclient that is complaining, it just displays the error > raised by emacs. But it is hard to guess what's going on without > knowing the exact command line. /usr/bin/vipe is just a Perl script, so it's easy to hack. Let's see... it just calls: emacsclient -t /tmp/KtLHpMIm4T I've included the entire vipe script below. #!/usr/bin/perl use warnings; use strict; use File::Temp q{tempfile}; use Getopt::Long; $/=undef; my $suffix = ""; if (! GetOptions("suffix=s" => \$suffix)) { die "Usage: $0 [--suffix=extension]\n"; } $suffix = ".$suffix" if $suffix =~ m/^[^.]/; my ($fh, $tmp)=tempfile(UNLINK => 1, SUFFIX => $suffix); die "cannot create tempfile" unless $fh; if (! -t STDIN) { print ($fh ) || die "write temp: $!"; } close $fh; close STDIN; open(STDIN, "&STDOUT") || die "save stdout: $!"; close STDOUT; open(STDOUT, ">/dev/tty") || die "reopen stdout: $!"; my @editor="vi"; if (-x "/usr/bin/editor") { @editor="/usr/bin/editor"; } if (exists $ENV{EDITOR}) { @editor=split(' ', $ENV{EDITOR}); } if (exists $ENV{VISUAL}) { @editor=split(' ', $ENV{VISUAL}); } my $ret=system(@editor, $tmp); if ($ret != 0) { die "@editor exited nonzero, aborting\n"; } open (IN, $tmp) || die "$0: cannot read $tmp: $!\n"; print (OUT ) || die "write failure: $!"; close IN; -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no