|
From: | Lennart Borgman |
Subject: | Unwanted ^M in the output from shell-command-on-region |
Date: | Tue, 16 May 2006 22:07:29 +0200 |
User-agent: | Thunderbird 1.5.0.2 (Windows/20060308) |
I have made an example below. It uses the program Tidy from http://tidy.sourceforge.net/trt/tidy_win32.zip. (Tidy is a program for (X)HTML curing.)
I am doing this on w32 with GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 2006-05-13
*** Example code: (defvar temp-html ;; Start-here " <html> <head> </head> </html> ") ;; Stop-here (defun temp-c-m() (let* ((temp-buffer (get-buffer-create "temp-c-m")) (start (save-excursion (goto-char (point-min)) (search-forward "Start-here") (forward-line 2) (point))) (end (save-excursion (goto-char start) (search-forward "Stop-here") (beginning-of-line) (point))) (command (concat "c:/dl/programs/Tidy.exe" )) (coding-system-for-read 'undecided-dos) (coding-system-for-write 'undecided-dos) ) (with-current-buffer temp-buffer (erase-buffer)) (shell-command-on-region start end command temp-buffer nil) (with-current-buffer temp-buffer (goto-char (point-max)) (insert (current-time-string) "\n\n")) )) (temp-c-m)
[Prev in Thread] | Current Thread | [Next in Thread] |