From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Tennant Newsgroups: gmane.emacs.bugs Subject: bug#1973: Bug in simple.el (Emacs version 22.2.1) Date: Fri, 23 Jan 2009 18:01:13 +0000 Message-ID: <1vutoqae.fsf@vps203.linuxvps.org> References: <63k9n3fx.fsf@vps203.linuxvps.org> <8wp37x1c.fsf@vps203.linuxvps.org> Reply-To: Sebastian Tennant , 1973@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1232735135 12969 80.91.229.12 (23 Jan 2009 18:25:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 23 Jan 2009 18:25:35 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 23 19:26:48 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LQQjn-0002gA-T2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Jan 2009 19:26:40 +0100 Original-Received: from localhost ([127.0.0.1]:59235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQQiW-0007MX-CM for geb-bug-gnu-emacs@m.gmane.org; Fri, 23 Jan 2009 13:25:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQQgn-0006TC-1o for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 13:23:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQQgm-0006S0-09 for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 13:23:32 -0500 Original-Received: from [199.232.76.173] (port=55320 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQQgl-0006Rr-Rc for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 13:23:31 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:51066) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQQgl-0005jR-8U for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 13:23:31 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0NINSNk000488; Fri, 23 Jan 2009 10:23:29 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n0NI54Ii028412; Fri, 23 Jan 2009 10:05:04 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Sebastian Tennant Original-Sender: news Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 23 Jan 2009 18:05:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1973 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.123273358726336 (code B ref -1); Fri, 23 Jan 2009 18:05:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 23 Jan 2009 17:59:47 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n0NHxgav026330 for ; Fri, 23 Jan 2009 09:59:44 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LQQJi-0007Na-57 for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 12:59:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LQQJg-0007MH-Oy for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 12:59:41 -0500 Original-Received: from [199.232.76.173] (port=34010 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LQQJg-0007M9-IH for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 12:59:40 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:33946 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LQQJf-0003VQ-TQ for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 12:59:40 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LQQJd-0006Uq-Ie for bug-gnu-emacs@gnu.org; Fri, 23 Jan 2009 17:59:37 +0000 Original-Received: from vps203.linuxvps.org ([91.186.7.203]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Jan 2009 17:59:37 +0000 Original-Received: from sebyte by vps203.linuxvps.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 23 Jan 2009 17:59:37 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 67 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: vps203.linuxvps.org User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:dCfJDhn3zHBxnrVkIEVCtgLeiZo= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Fri, 23 Jan 2009 13:23:32 -0500 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:24433 Archived-At: Quoth Sebastian Tennant : > The question for me now is how to make buffer *Async Command Output* > behave like buffer *shell*, an odd thing to be doing given that they are > both in Shell mode! And I've found a solution, but it's ugly: (add-hook 'shell-mode-hook (lambda () (set-process-filter proc 'comint-output-filter))) No one likes to see the guts of a function (local variable 'proc') in their mode hooks. This works because shell-mode is called after the process is started. --- shell-command snippet --- (with-current-buffer buffer (setq buffer-read-only nil) (erase-buffer) (display-buffer buffer) (setq default-directory directory) (setq proc (start-process "Shell" buffer shell-file-name shell-command-switch command)) (setq mode-line-process '(":%s")) (require 'shell) (shell-mode) (set-process-sentinel proc 'shell-command-sentinel)) --- end of snippet --- The whole thing's a bit of a mess if you ask me. We have two buffers (*shell* and *Async Command Output*) that both claim to be in Shell mode, yet process output is handled completely differently in each case. Why is *Async Command Output* in Shell mode at all if we're not to assume it will only be used for shell commands (that require ^M character handling)? Even replacing the call to shell-mode with a call to comint-mode makes no difference to the way ^M characters are handled. In either case the process filter must be explicitly set to 'comint-ouput-filter. I'd expect something as visually arresting as mangled output to be handled by a mode setting, but hey ho. If it were up to me, I'd rewrite the asynchronous part of shell-command so that make-comint-in-buffer is used to create a Comint mode buffer called *Async Shell Command Output* and leave it at that. After all, the command that creates the buffer is called shell-command so let's assume that's what the buffer is for. I can't think of a single shell command that would depend on ^M characters _not_ being handled in this way for its output to display properly. Can you think of any? Sebastian P.S. Are there any buffer naming conventions in respect to capitalisation of words? The lowercase 's' in *shell* has always struck me as odd alongside *Messages*, *Buffer List* e.t.c. -- Emacs' AlsaPlayer - Music Without Jolts Lightweight, full-featured and mindful of your idyllic happiness. http://home.gna.org/eap