aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Volpiatto2013-03-11 14:30:49 -0400
committerStefan Monnier2013-03-11 14:30:49 -0400
commitc6bdd1107112f2eaf0bfb0964f2aeb636d6389c8 (patch)
treeb153b76878472669e90c12f3b1fcf2e04ad7c4aa
parentbd3921f0b884011ff267faf3a2301b3653a9f20f (diff)
downloademacs-c6bdd1107112f2eaf0bfb0964f2aeb636d6389c8.tar.gz
emacs-c6bdd1107112f2eaf0bfb0964f2aeb636d6389c8.zip
* lisp/net/net-utils.el (net-utils-remove-ctrl-m-filter):
Use with-current-buffer and don't move point. (net-utils-run-simple): Remove useless code. (net-utils-remove-ctl-m): Remove unused custom.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/net/net-utils.el36
2 files changed, 18 insertions, 25 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0361e5af0aa..bdfa6ae25ac 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12013-03-11 Thierry Volpiatto <thierry.volpiatto@gmail.com>
2
3 * net/net-utils.el (net-utils-remove-ctrl-m-filter):
4 Use with-current-buffer and don't move point.
5 (net-utils-run-simple): Remove useless code.
6 (net-utils-remove-ctl-m): Remove unused custom.
7
12013-03-11 Per Starbäck <starback@stp.lingfil.uu.se> 82013-03-11 Per Starbäck <starback@stp.lingfil.uu.se>
2 9
3 * international/characters.el (glyphless-set-char-table-range): New fun. 10 * international/characters.el (glyphless-set-char-table-range): New fun.
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 @@
54 :group 'comm 54 :group 'comm
55 :version "20.3") 55 :version "20.3")
56 56
57(defcustom net-utils-remove-ctl-m (memq system-type '(windows-nt msdos))
58 "If non-nil, remove control-Ms from output."
59 :group 'net-utils
60 :type 'boolean)
61
62(defcustom traceroute-program 57(defcustom traceroute-program
63 (if (eq system-type 'windows-nt) 58 (if (eq system-type 'windows-nt)
64 "tracert" 59 "tracert"
@@ -319,25 +314,17 @@ This variable is only used if the variable
319 314
320(defun net-utils-remove-ctrl-m-filter (process output-string) 315(defun net-utils-remove-ctrl-m-filter (process output-string)
321 "Remove trailing control Ms." 316 "Remove trailing control Ms."
322 (let ((old-buffer (current-buffer)) 317 (with-current-buffer (process-buffer process)
323 (filtered-string output-string)) 318 (save-excursion
324 (unwind-protect 319 (let ((inhibit-read-only t)
325 (let ((moving)) 320 (filtered-string output-string))
326 (set-buffer (process-buffer process)) 321 (while (string-match "\r" filtered-string)
327 (let ((inhibit-read-only t)) 322 (setq filtered-string
328 (setq moving (= (point) (process-mark process))) 323 (replace-match "" nil nil filtered-string)))
329 324 ;; Insert the text, moving the process-marker.
330 (while (string-match "\r" filtered-string) 325 (goto-char (process-mark process))
331 (setq filtered-string 326 (insert filtered-string)
332 (replace-match "" nil nil filtered-string))) 327 (set-marker (process-mark process) (point))))))
333
334 (save-excursion
335 ;; Insert the text, moving the process-marker.
336 (goto-char (process-mark process))
337 (insert filtered-string)
338 (set-marker (process-mark process) (point))))
339 (if moving (goto-char (process-mark process))))
340 (set-buffer old-buffer))))
341 328
342(defun net-utils-run-program (name header program args) 329(defun net-utils-run-program (name header program args)
343 "Run a network information program." 330 "Run a network information program."
@@ -375,7 +362,6 @@ This variable is only used if the variable
375 (apply 'start-process program-name 362 (apply 'start-process program-name
376 (current-buffer) program-name args) 363 (current-buffer) program-name args)
377 'net-utils-remove-ctrl-m-filter) 364 'net-utils-remove-ctrl-m-filter)
378 (goto-char (point-min))
379 (unless nodisplay (display-buffer (current-buffer))))) 365 (unless nodisplay (display-buffer (current-buffer)))))
380 366
381(defun net-utils--revert-function (&optional ignore-auto noconfirm) 367(defun net-utils--revert-function (&optional ignore-auto noconfirm)