From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark Oteiza Newsgroups: gmane.emacs.bugs Subject: bug#22096: 25.0.50; reading from fifo breaks display Date: Sat, 05 Dec 2015 10:58:38 -0500 Message-ID: <87oae4opjl.fsf@udel.edu> References: <87lh9aglih.fsf@udel.edu> <83oae5fgtn.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1449331223 21376 80.91.229.3 (5 Dec 2015 16:00:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Dec 2015 16:00:23 +0000 (UTC) To: 22096@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 05 17:00:15 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a5FFs-0000lu-7U for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2015 17:00:12 +0100 Original-Received: from localhost ([::1]:46925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5FFr-0001ss-KL for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2015 11:00:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5FFo-0001rY-AJ for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 11:00:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5FFl-0000zr-3q for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 11:00:08 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50292) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5FFl-0000zn-1B for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 11:00:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a5FFk-0006W0-L0 for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 11:00:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Mark Oteiza Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Dec 2015 16:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22096 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.144933114824948 (code B ref -1); Sat, 05 Dec 2015 16:00:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Dec 2015 15:59:08 +0000 Original-Received: from localhost ([127.0.0.1]:40000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5FEq-0006UK-35 for submit@debbugs.gnu.org; Sat, 05 Dec 2015 10:59:08 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42768) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a5FEV-0006Td-Do for submit@debbugs.gnu.org; Sat, 05 Dec 2015 10:59:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5FEU-0000jc-0A for submit@debbugs.gnu.org; Sat, 05 Dec 2015 10:58:47 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5FET-0000jY-Si for submit@debbugs.gnu.org; Sat, 05 Dec 2015 10:58:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5FES-000187-Sm for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 10:58:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5FEP-0000jH-Ja for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 10:58:44 -0500 Original-Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]:33115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5FEP-0000jD-CE for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 10:58:41 -0500 Original-Received: by qgea14 with SMTP id a14so112962173qge.0 for ; Sat, 05 Dec 2015 07:58:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=udel-edu.20150623.gappssmtp.com; s=20150623; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=g9F2za9JSW+yl5KQqcxETp1GOoZldyB12Tt2eJOCcf8=; b=eux3z7Xn2ISKGI2Hj64kytEqDe2Q7Lxy5xnccoawA+873w4J+damDC9YK553kbfwcO x83uDJg6mN7KZwxnE8KzeoYfWFepP1SwMPJOuOaWDPmlwhxhpFuyLJIhvRKbD2mYGyXv SiRooTVK+h+ZiwRx9MGSsa8jbi09UNFn6YXUQESBC9DCSCetw2qTNBHeZDM8MEN6RQ2/ jrJStOLuENSlm4ODr0Qsaj9aDV5tmjhUbsDP7jwxpORh3+O+oYdtZrWARHvGEhEwL+kT qpOtauiwm55eT3Omgwk7ByRZjH57IdTDupJF5lnzMcSeWKfCycuwHk3aKRZt7KdhK6A1 jd6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=g9F2za9JSW+yl5KQqcxETp1GOoZldyB12Tt2eJOCcf8=; b=K/Gk9UqWRAaGibVhGcnAGz/Aid9DyxHk5qi/KGZ/tPVz3cSbonAbDyBzbaMzbOdZZN wIIAuNcF8NW7nQ3L0LXrSXI67ZXm8b4lpDnjWOzWJOz1l3DkGEDKbOZQkTwNea703h+F 8wqlPJAHcP3YxSzSmh7kmQe0deHo42+KkhtS4SiUys3LdcdQUZWWUhdkcCDbecSNK+Rs BspsqQfloGdMFE0LzdcPq7c4iBl0EB7CZTF1W5E0tQYD/WxioXsr6zX9WJoIxhG+oFuu RmCeUF6wPI76rgdHdu+l21fMzW/ihC+7Hwoagn8nKL1HjPyPmEOMrscl1wpgsmJ6XuCK 0aMw== X-Gm-Message-State: ALoCoQlU5MFiqIp2UBSONhEnquV+DGzalId2RrFL5LxGmZApleHBZ2EfAV/yQQGebiOhs0P5TOs3 X-Received: by 10.140.173.65 with SMTP id t62mr28022950qht.96.1449331120795; Sat, 05 Dec 2015 07:58:40 -0800 (PST) Original-Received: from holos.localdomain (c-73-172-248-173.hsd1.md.comcast.net. [73.172.248.173]) by smtp.gmail.com with ESMTPSA id u135sm7939182qka.22.2015.12.05.07.58.39 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Dec 2015 07:58:40 -0800 (PST) Original-Received: by holos.localdomain (Postfix, from userid 1000) id 5333869D67; Sat, 5 Dec 2015 10:58:38 -0500 (EST) In-Reply-To: <83oae5fgtn.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Dec 2015 10:19:32 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109647 Archived-At: Eli Zaretskii writes: >> From: Mark Oteiza >> Date: Fri, 04 Dec 2015 12:40:38 -0500 >> >> I suppose this is two issues, really. I am trying to read from a FIFO, >> specifically one written to by mpd, configured in mpd.conf with >> >> audio_output { >> type "fifo" >> name "FIFO" >> path "/tmp/mpd.fifo" >> format "44100:16:2" >> } >> >> With mpd running I can see that the FIFO is there and I can read from it >> with other tools/mpd clients. >> >> (info "(elisp) Reading from Files") suggests I should be able to read >> from a FIFO. > > I guess you mean this part: > > It is possible to read a special file (such as a FIFO or an I/O > device) with `insert-file-contents', as long as REPLACE and VISIT > are `nil'. > > It seems this is no longer true, and we have to fix the manual to that > effect. I hope Paul (CC'ed) will be able to take a look. Well, darn. >> From emacs -Q, insert the following into the scratch buffer: >> >> (insert-file-contents "/tmp/mpd.fifo" nil 0 10 nil) >> >> First issue: evaluating this yields >> >> (file-error "not a regular file" "/tmp/mpd.fifo") >> >> Second issue: changing the VISIT argument to t and evaluating: >> >> (insert-file-contents "/tmp/mpd.fifo" t 0 10 nil) >> >> breaks the display engine. "nil)" becomes invisible, the last "r" in the >> scratch buffer message becomes fontified as a matching paren, and >> hitting C-a at the end of the form takes me to the aforementioned "r". >> I have attached an image. > > Can you tell what were the 10 bytes inserted by the above? Then it > should be possible to reproduce the display issue without having > access to your system. No. I can't tell that anything from the fifo is ever inserted. Sometimes it seems the multibyte flag of the buffer gets flipped off. Sometimes I actually get the "not a regular file" error. What consistently seems to happen is "nil)" is deleted. If I do insert-file-contents{,-literally} with just FILENAME and no other arguments, it appears to read the fifo just fine, just that I have to C-g to make it stop, of course. The buffer will be stuffed with binary data, but nothing breaks as far as I can tell. > Anyway, you are reading a binary byte stream from an audio daemon, so > I think you cannot expect it to be displayed in any human-readable > way, let alone hope that the major mode in effect in *scratch will be > able to fontify it in some reasonable way. You should use > insert-file-contents-literally instead, I think. (And I very much > doubt that "visiting" a non-regular file makes sense, but maybe I'm > missing something.) Right, I didn't expect VISIT=t to make sense, but the resulting breakage is unexpected.