[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ^M chars in *Async Command Output*

From: Sebastian Tennant
Subject: Re: ^M chars in *Async Command Output*
Date: Sun, 25 Jan 2009 17:41:15 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Quoth Andreas Politz <address@hidden>:
> [...] the local variable is not nessecary.
> (defun shell-command-filter-hook nil
>   "Filter all shell command output via `comint-output-filter'."
>   (let ((proc (get-buffer-process "*Async Shell Command*")))
>     (when proc
>       (set-process-filter proc 'comint-output-filter))))

The problem only afflicts asynchronous shell commands so better still
would be test this condition in the hook itself:

 (defun async-shell-command-filter-hook nil
   "Filter asynchronous shell command output via `comint-output-filter'."
   (when (equal (buffer-name (current-buffer)) "*Async Shell Command*")
     (let ((proc (get-buffer-process (current-buffer))))
       (when proc (set-process-filter proc 'comint-output-filter)))))

People can then simply do:

 (add-hook 'shell-mode-hook 'async-shell-command-filter-hook)

I filed a bug report against simple.el on this matter (a little
prematurely no doubt) but if we can get this hook added it will have
definitely been worthwhile.

Thanks for your help Andreas.

Emacs' AlsaPlayer - Music Without Jolts
Lightweight, full-featured and mindful of your idyllic happiness.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]