help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: ^M chars in *Async Command Output*


From: Andreas Politz
Subject: Re: ^M chars in *Async Command Output*
Date: Sat, 24 Jan 2009 09:25:51 +0100
User-agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018)

Sebastian Tennant wrote:
Quoth Sebastian Tennant <address@hidden>:
A function; (comint-carriage-motion), and a variable;
comint-inhibit-carriage-motion, exist precisely for this purpose.

How best to apply them to buffer *Async Command Output* is something I'm
still working on.

And it turns out neither of these are any help!

The best (shortest) solution I can find is this:

 (add-hook 'shell-mode-hook
           (lambda ()
             (when (equal (buffer-name (current-buffer)) "*Async Shell 
Command*")
               (set-process-filter proc 'comint-output-filter))))

It's ugly, (proc is a local variable!), but short of patching
shell-command it does the trick for now.

Sebastian

It's better than what I first came up with.
Anyway, 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))))

-ap


reply via email to

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