emacs-bpr icon indicating copy to clipboard operation
emacs-bpr copied to clipboard

Add comint-output-filter so output is colorized

Open svend opened this issue 8 years ago • 4 comments
trafficstars

Add comint-output-filter to process so that ouput is colorized in the same way as async-shell-command.

shell-command has the following:

    ;; Use the comint filter for proper handling of carriage motion
    ;; (see `comint-inhibit-carriage-motion'),.
    (set-process-filter proc 'comint-output-filter)

svend avatar Aug 22 '17 23:08 svend

Thanks for the package!

I like the way async-shell-command colorized output as it is displayed. With bpr-colorize-output set, output first shows up with escape codes, then gets colorized when I hit enter on the next prompt.

After making the change in this PR, output is colorized on the fly.

svend avatar Aug 22 '17 23:08 svend

Thank you, this is very nice improvement! I think there is a problem when bpr-process-mode is not derived from comint mode. For example comint-output-filter doesn't work with fundamental mode.

iliabv avatar Aug 23 '17 22:08 iliabv

Good catch. Would abpr-on-start defcustom be an option? Users could set this to a function that calls set-process-filter on the process.

Implemented in #12

svend avatar Aug 23 '17 22:08 svend

Thanks, I've merged bpr-on-start pull request. Regarding this PR - I can close it and add a note about bpr-on-start + comint-output-filter to the readme. On the other hand it nice to have this functionality built-in, I think it should be possible to use something like derived-mode-class or derived-mode-p to check that bpr-process-mode is derived from comint-mode. I'll try to investigate it deeper a bit later.

iliabv avatar Aug 23 '17 23:08 iliabv