diff options
| author | Tom Tromey <tromey@redhat.com> | 2013-03-17 05:17:24 -0600 |
|---|---|---|
| committer | Tom Tromey <tromey@redhat.com> | 2013-03-17 05:17:24 -0600 |
| commit | 6bd488cd8d05aa3983ca55f70ee384732d8c0085 (patch) | |
| tree | 5645fc7b882638d6c0eb3f61fd55bde1a63fc190 /lisp/net/net-utils.el | |
| parent | 71f91792e3013b397996905224f387da5cc539a9 (diff) | |
| parent | 9c44569ea2a18099307e0571d523d8637000a153 (diff) | |
| download | emacs-6bd488cd8d05aa3983ca55f70ee384732d8c0085.tar.gz | |
merge from trunk
Diffstat (limited to 'lisp/net/net-utils.el')
| -rw-r--r-- | lisp/net/net-utils.el | 36 |
1 files changed, 11 insertions, 25 deletions
diff --git a/lisp/net/net-utils.el b/lisp/net/net-utils.el index 82c1ce010b8..9a6c7b124c7 100644 --- a/lisp/net/net-utils.el +++ b/lisp/net/net-utils.el @@ -54,11 +54,6 @@ :group 'comm :version "20.3") -(defcustom net-utils-remove-ctl-m (memq system-type '(windows-nt msdos)) - "If non-nil, remove control-Ms from output." - :group 'net-utils - :type 'boolean) - (defcustom traceroute-program (if (eq system-type 'windows-nt) "tracert" @@ -319,25 +314,17 @@ This variable is only used if the variable (defun net-utils-remove-ctrl-m-filter (process output-string) "Remove trailing control Ms." - (let ((old-buffer (current-buffer)) - (filtered-string output-string)) - (unwind-protect - (let ((moving)) - (set-buffer (process-buffer process)) - (let ((inhibit-read-only t)) - (setq moving (= (point) (process-mark process))) - - (while (string-match "\r" filtered-string) - (setq filtered-string - (replace-match "" nil nil filtered-string))) - - (save-excursion - ;; Insert the text, moving the process-marker. - (goto-char (process-mark process)) - (insert filtered-string) - (set-marker (process-mark process) (point)))) - (if moving (goto-char (process-mark process)))) - (set-buffer old-buffer)))) + (with-current-buffer (process-buffer process) + (save-excursion + (let ((inhibit-read-only t) + (filtered-string output-string)) + (while (string-match "\r" filtered-string) + (setq filtered-string + (replace-match "" nil nil filtered-string))) + ;; Insert the text, moving the process-marker. + (goto-char (process-mark process)) + (insert filtered-string) + (set-marker (process-mark process) (point)))))) (defun net-utils-run-program (name header program args) "Run a network information program." @@ -375,7 +362,6 @@ This variable is only used if the variable (apply 'start-process program-name (current-buffer) program-name args) 'net-utils-remove-ctrl-m-filter) - (goto-char (point-min)) (unless nodisplay (display-buffer (current-buffer))))) (defun net-utils--revert-function (&optional ignore-auto noconfirm) |
