aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2019-01-21 09:48:55 +0100
committerMichael Albinus2019-01-21 09:48:55 +0100
commite5ef4c660c191223912b15ebfa3b61a058221992 (patch)
tree7203fbd2f9cd94a6c8bd74676ca967724316f18b
parent5961e4fa427822fa441f4fcf53041043dd6741e1 (diff)
downloademacs-e5ef4c660c191223912b15ebfa3b61a058221992.tar.gz
emacs-e5ef4c660c191223912b15ebfa3b61a058221992.zip
Use `inhibit-read-only' in Tramp
* lisp/net/tramp.el (tramp-process-actions, tramp-accept-process-output) (tramp-send-string): * lisp/net/tramp-adb.el (tramp-adb-handle-make-process) (tramp-adb-send-command-and-check, tramp-adb-wait-for-output): * lisp/net/tramp-sh.el (tramp-sh-handle-make-process) (tramp-wait-for-output, tramp-send-command-and-check): * lisp/net/tramp-smb.el (tramp-smb-wait-for-output): Use `inhibit-read-only'.
-rw-r--r--lisp/net/tramp-adb.el6
-rw-r--r--lisp/net/tramp-sh.el6
-rw-r--r--lisp/net/tramp-smb.el2
-rw-r--r--lisp/net/tramp.el7
4 files changed, 11 insertions, 10 deletions
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 0a357e1ae2f..73774dbc444 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -1091,7 +1091,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
1091 ;; otherwise we might be interrupted by 1091 ;; otherwise we might be interrupted by
1092 ;; `verify-visited-file-modtime'. 1092 ;; `verify-visited-file-modtime'.
1093 (let ((buffer-undo-list t) 1093 (let ((buffer-undo-list t)
1094 (buffer-read-only nil) 1094 (inhibit-read-only t)
1095 (mark (point))) 1095 (mark (point)))
1096 (clear-visited-file-modtime) 1096 (clear-visited-file-modtime)
1097 (narrow-to-region (point-max) (point-max)) 1097 (narrow-to-region (point-max) (point-max))
@@ -1242,7 +1242,7 @@ the exit status is not equal 0, and t otherwise."
1242 (skip-chars-forward "^ ") 1242 (skip-chars-forward "^ ")
1243 (prog1 1243 (prog1
1244 (zerop (read (current-buffer))) 1244 (zerop (read (current-buffer)))
1245 (let (buffer-read-only) 1245 (let ((inhibit-read-only t))
1246 (delete-region (match-beginning 0) (point-max)))))) 1246 (delete-region (match-beginning 0) (point-max))))))
1247 1247
1248(defun tramp-adb-barf-unless-okay (vec command fmt &rest args) 1248(defun tramp-adb-barf-unless-okay (vec command fmt &rest args)
@@ -1260,7 +1260,7 @@ FMT and ARGS are passed to `error'."
1260 (if (tramp-wait-for-regexp 1260 (if (tramp-wait-for-regexp
1261 proc timeout 1261 proc timeout
1262 (tramp-get-connection-property proc "prompt" tramp-adb-prompt)) 1262 (tramp-get-connection-property proc "prompt" tramp-adb-prompt))
1263 (let (buffer-read-only) 1263 (let ((inhibit-read-only t))
1264 (goto-char (point-min)) 1264 (goto-char (point-min))
1265 ;; ADB terminal sends "^H" sequences. 1265 ;; ADB terminal sends "^H" sequences.
1266 (when (re-search-forward "<\b+" (point-at-eol) t) 1266 (when (re-search-forward "<\b+" (point-at-eol) t)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 5c9c568545c..4fa8b3fa3f1 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -2906,7 +2906,7 @@ the result will be a local, non-Tramp, file name."
2906 ;; otherwise we might be interrupted by 2906 ;; otherwise we might be interrupted by
2907 ;; `verify-visited-file-modtime'. 2907 ;; `verify-visited-file-modtime'.
2908 (let ((buffer-undo-list t) 2908 (let ((buffer-undo-list t)
2909 (buffer-read-only nil) 2909 (inhibit-read-only t)
2910 (mark (point-max))) 2910 (mark (point-max)))
2911 (clear-visited-file-modtime) 2911 (clear-visited-file-modtime)
2912 (narrow-to-region (point-max) (point-max)) 2912 (narrow-to-region (point-max) (point-max))
@@ -5081,7 +5081,7 @@ function waits for output unless NOOUTPUT is set."
5081 (regexp1 (format "\\(^\\|\000\\)%s" regexp)) 5081 (regexp1 (format "\\(^\\|\000\\)%s" regexp))
5082 (found (tramp-wait-for-regexp proc timeout regexp1))) 5082 (found (tramp-wait-for-regexp proc timeout regexp1)))
5083 (if found 5083 (if found
5084 (let (buffer-read-only) 5084 (let ((inhibit-read-only t))
5085 ;; A simple-minded busybox has sent " ^H" sequences. 5085 ;; A simple-minded busybox has sent " ^H" sequences.
5086 ;; Delete them. 5086 ;; Delete them.
5087 (goto-char (point-min)) 5087 (goto-char (point-min))
@@ -5128,7 +5128,7 @@ DONT-SUPPRESS-ERR is non-nil, stderr won't be sent to /dev/null."
5128 (skip-chars-forward "^ ") 5128 (skip-chars-forward "^ ")
5129 (prog1 5129 (prog1
5130 (zerop (read (current-buffer))) 5130 (zerop (read (current-buffer)))
5131 (let (buffer-read-only) 5131 (let ((inhibit-read-only t))
5132 (delete-region (match-beginning 0) (point-max)))))) 5132 (delete-region (match-beginning 0) (point-max))))))
5133 5133
5134(defun tramp-barf-unless-okay (vec command fmt &rest args) 5134(defun tramp-barf-unless-okay (vec command fmt &rest args)
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index 8198930abc6..08f2f30747a 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -2029,7 +2029,7 @@ If ARGUMENT is non-nil, use it as argument for
2029Removes smb prompt. Returns nil if an error message has appeared." 2029Removes smb prompt. Returns nil if an error message has appeared."
2030 (with-current-buffer (tramp-get-connection-buffer vec) 2030 (with-current-buffer (tramp-get-connection-buffer vec)
2031 (let ((p (get-buffer-process (current-buffer))) 2031 (let ((p (get-buffer-process (current-buffer)))
2032 buffer-read-only) 2032 (inhibit-read-only t))
2033 2033
2034 ;; Read pending output. 2034 ;; Read pending output.
2035 (while (tramp-accept-process-output p 0.1)) 2035 (while (tramp-accept-process-output p 0.1))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 3b235095d37..a65094f811f 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4074,7 +4074,7 @@ connection buffer."
4074 (t "Login failed"))))) 4074 (t "Login failed")))))
4075 (when (numberp pos) 4075 (when (numberp pos)
4076 (with-current-buffer (tramp-get-connection-buffer vec) 4076 (with-current-buffer (tramp-get-connection-buffer vec)
4077 (let (buffer-read-only) (delete-region pos (point)))))))) 4077 (let ((inhibit-read-only t)) (delete-region pos (point))))))))
4078 4078
4079;;; Utility functions: 4079;;; Utility functions:
4080 4080
@@ -4083,7 +4083,8 @@ connection buffer."
4083This is needed in order to hide `last-coding-system-used', which is set 4083This is needed in order to hide `last-coding-system-used', which is set
4084for process communication also." 4084for process communication also."
4085 (with-current-buffer (process-buffer proc) 4085 (with-current-buffer (process-buffer proc)
4086 (let (buffer-read-only last-coding-system-used 4086 (let ((inhibit-read-only t)
4087 last-coding-system-used
4087 ;; We do not want to run timers. 4088 ;; We do not want to run timers.
4088 timer-list timer-idle-list 4089 timer-list timer-idle-list
4089 result) 4090 result)
@@ -4186,7 +4187,7 @@ the remote host use line-endings as defined in the variable
4186 (with-current-buffer (tramp-get-connection-buffer vec) 4187 (with-current-buffer (tramp-get-connection-buffer vec)
4187 ;; Clean up the buffer. We cannot call `erase-buffer' because 4188 ;; Clean up the buffer. We cannot call `erase-buffer' because
4188 ;; narrowing might be in effect. 4189 ;; narrowing might be in effect.
4189 (let (buffer-read-only) (delete-region (point-min) (point-max))) 4190 (let ((inhibit-read-only t)) (delete-region (point-min) (point-max)))
4190 ;; Replace "\n" by `tramp-rsh-end-of-line'. 4191 ;; Replace "\n" by `tramp-rsh-end-of-line'.
4191 (setq string 4192 (setq string
4192 (mapconcat 4193 (mapconcat