From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22096: 25.0.50; reading from fifo breaks display Date: Sat, 05 Dec 2015 10:19:32 +0200 Message-ID: <83oae5fgtn.fsf@gnu.org> References: <87lh9aglih.fsf@udel.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1449303686 22962 80.91.229.3 (5 Dec 2015 08:21:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Dec 2015 08:21:26 +0000 (UTC) Cc: 22096@debbugs.gnu.org To: Mark Oteiza , Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Dec 05 09:21:11 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 1a585e-0003XT-TJ for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2015 09:21:11 +0100 Original-Received: from localhost ([::1]:44922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a585d-0005KT-VV for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 Dec 2015 03:21:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a585a-0005KL-A4 for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 03:21:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a585X-00048r-5c for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 03:21:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:49846) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a585X-00048n-27 for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 03:21:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a585W-00006r-IH for bug-gnu-emacs@gnu.org; Sat, 05 Dec 2015 03:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Dec 2015 08:21:02 +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: Original-Received: via spool by 22096-submit@debbugs.gnu.org id=B22096.1449303606338 (code B ref 22096); Sat, 05 Dec 2015 08:21:02 +0000 Original-Received: (at 22096) by debbugs.gnu.org; 5 Dec 2015 08:20:06 +0000 Original-Received: from localhost ([127.0.0.1]:39554 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a584b-00005N-Mw for submit@debbugs.gnu.org; Sat, 05 Dec 2015 03:20:06 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:37795) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a584H-0008WF-1t for 22096@debbugs.gnu.org; Sat, 05 Dec 2015 03:20:04 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NYV00J00LGURC00@a-mtaout20.012.net.il> for 22096@debbugs.gnu.org; Sat, 05 Dec 2015 10:19:43 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NYV00J1ILSVMX90@a-mtaout20.012.net.il>; Sat, 05 Dec 2015 10:19:43 +0200 (IST) In-reply-to: <87lh9aglih.fsf@udel.edu> X-012-Sender: halo1@inter.net.il 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:109635 Archived-At: > 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. > 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. 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.) Thanks.