mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-05 07:01:11 -08:00
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'.
This commit is contained in:
parent
5961e4fa42
commit
e5ef4c660c
4 changed files with 11 additions and 10 deletions
|
|
@ -1091,7 +1091,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
|
|||
;; otherwise we might be interrupted by
|
||||
;; `verify-visited-file-modtime'.
|
||||
(let ((buffer-undo-list t)
|
||||
(buffer-read-only nil)
|
||||
(inhibit-read-only t)
|
||||
(mark (point)))
|
||||
(clear-visited-file-modtime)
|
||||
(narrow-to-region (point-max) (point-max))
|
||||
|
|
@ -1242,7 +1242,7 @@ the exit status is not equal 0, and t otherwise."
|
|||
(skip-chars-forward "^ ")
|
||||
(prog1
|
||||
(zerop (read (current-buffer)))
|
||||
(let (buffer-read-only)
|
||||
(let ((inhibit-read-only t))
|
||||
(delete-region (match-beginning 0) (point-max))))))
|
||||
|
||||
(defun tramp-adb-barf-unless-okay (vec command fmt &rest args)
|
||||
|
|
@ -1260,7 +1260,7 @@ FMT and ARGS are passed to `error'."
|
|||
(if (tramp-wait-for-regexp
|
||||
proc timeout
|
||||
(tramp-get-connection-property proc "prompt" tramp-adb-prompt))
|
||||
(let (buffer-read-only)
|
||||
(let ((inhibit-read-only t))
|
||||
(goto-char (point-min))
|
||||
;; ADB terminal sends "^H" sequences.
|
||||
(when (re-search-forward "<\b+" (point-at-eol) t)
|
||||
|
|
|
|||
|
|
@ -2906,7 +2906,7 @@ the result will be a local, non-Tramp, file name."
|
|||
;; otherwise we might be interrupted by
|
||||
;; `verify-visited-file-modtime'.
|
||||
(let ((buffer-undo-list t)
|
||||
(buffer-read-only nil)
|
||||
(inhibit-read-only t)
|
||||
(mark (point-max)))
|
||||
(clear-visited-file-modtime)
|
||||
(narrow-to-region (point-max) (point-max))
|
||||
|
|
@ -5081,7 +5081,7 @@ function waits for output unless NOOUTPUT is set."
|
|||
(regexp1 (format "\\(^\\|\000\\)%s" regexp))
|
||||
(found (tramp-wait-for-regexp proc timeout regexp1)))
|
||||
(if found
|
||||
(let (buffer-read-only)
|
||||
(let ((inhibit-read-only t))
|
||||
;; A simple-minded busybox has sent " ^H" sequences.
|
||||
;; Delete them.
|
||||
(goto-char (point-min))
|
||||
|
|
@ -5128,7 +5128,7 @@ DONT-SUPPRESS-ERR is non-nil, stderr won't be sent to /dev/null."
|
|||
(skip-chars-forward "^ ")
|
||||
(prog1
|
||||
(zerop (read (current-buffer)))
|
||||
(let (buffer-read-only)
|
||||
(let ((inhibit-read-only t))
|
||||
(delete-region (match-beginning 0) (point-max))))))
|
||||
|
||||
(defun tramp-barf-unless-okay (vec command fmt &rest args)
|
||||
|
|
|
|||
|
|
@ -2029,7 +2029,7 @@ If ARGUMENT is non-nil, use it as argument for
|
|||
Removes smb prompt. Returns nil if an error message has appeared."
|
||||
(with-current-buffer (tramp-get-connection-buffer vec)
|
||||
(let ((p (get-buffer-process (current-buffer)))
|
||||
buffer-read-only)
|
||||
(inhibit-read-only t))
|
||||
|
||||
;; Read pending output.
|
||||
(while (tramp-accept-process-output p 0.1))
|
||||
|
|
|
|||
|
|
@ -4074,7 +4074,7 @@ connection buffer."
|
|||
(t "Login failed")))))
|
||||
(when (numberp pos)
|
||||
(with-current-buffer (tramp-get-connection-buffer vec)
|
||||
(let (buffer-read-only) (delete-region pos (point))))))))
|
||||
(let ((inhibit-read-only t)) (delete-region pos (point))))))))
|
||||
|
||||
;;; Utility functions:
|
||||
|
||||
|
|
@ -4083,7 +4083,8 @@ connection buffer."
|
|||
This is needed in order to hide `last-coding-system-used', which is set
|
||||
for process communication also."
|
||||
(with-current-buffer (process-buffer proc)
|
||||
(let (buffer-read-only last-coding-system-used
|
||||
(let ((inhibit-read-only t)
|
||||
last-coding-system-used
|
||||
;; We do not want to run timers.
|
||||
timer-list timer-idle-list
|
||||
result)
|
||||
|
|
@ -4186,7 +4187,7 @@ the remote host use line-endings as defined in the variable
|
|||
(with-current-buffer (tramp-get-connection-buffer vec)
|
||||
;; Clean up the buffer. We cannot call `erase-buffer' because
|
||||
;; narrowing might be in effect.
|
||||
(let (buffer-read-only) (delete-region (point-min) (point-max)))
|
||||
(let ((inhibit-read-only t)) (delete-region (point-min) (point-max)))
|
||||
;; Replace "\n" by `tramp-rsh-end-of-line'.
|
||||
(setq string
|
||||
(mapconcat
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue