summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/newst-treeview.el11
-rw-r--r--lisp/net/tramp-adb.el2
-rw-r--r--lisp/net/tramp-archive.el2
-rw-r--r--lisp/net/tramp-compat.el23
-rw-r--r--lisp/net/tramp-crypt.el2
-rw-r--r--lisp/net/tramp-gvfs.el7
-rw-r--r--lisp/net/tramp-sh.el47
7 files changed, 70 insertions, 24 deletions
diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el
index 637f53e6550..e98767ae7c7 100644
--- a/lisp/net/newst-treeview.el
+++ b/lisp/net/newst-treeview.el
@@ -361,7 +361,8 @@ AGES is the list of ages that are to be shown."
(mapc (lambda (feed)
(let ((feed-name-symbol (intern (car feed))))
(mapc (lambda (item)
- (when (memq (newsticker--age item) ages)
+ (when (or (memq 'all ages)
+ (memq (newsticker--age item) ages))
(newsticker--treeview-list-add-item
item feed-name-symbol t)))
(newsticker--treeview-list-sort-items
@@ -1218,11 +1219,11 @@ Note: does not update the layout."
(newsticker--treeview-list-update t)
(newsticker--treeview-item-update)
(newsticker--treeview-tree-update-tags)
- (cond (newsticker--treeview-current-feed
- (newsticker--treeview-list-items newsticker--treeview-current-feed))
- (newsticker--treeview-current-vfeed
+ (cond (newsticker--treeview-current-vfeed
(newsticker--treeview-list-items-with-age
- (intern newsticker--treeview-current-vfeed))))
+ (intern newsticker--treeview-current-vfeed)))
+ (newsticker--treeview-current-feed
+ (newsticker--treeview-list-items newsticker--treeview-current-feed)))
(newsticker--treeview-tree-update-highlight)
(newsticker--treeview-list-update-highlight)
(let ((cur-feed (or newsticker--treeview-current-feed
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index d033667e87f..170583f608c 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -324,7 +324,7 @@ arguments to pass to the OPERATION."
(tramp-compat-file-name-concat localname "."))
(tramp-shell-quote-argument
(tramp-compat-file-name-concat localname ".."))))
- (replace-regexp-in-region
+ (tramp-compat-replace-regexp-in-region
(regexp-quote
(tramp-compat-file-name-unquote
(file-name-as-directory localname)))
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index fda1441615e..548999ca1d2 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -325,7 +325,7 @@ arguments to pass to the OPERATION."
;; Starting with Emacs 29, `tramp-archive-file-name-handler' is
;; autoloaded. But it must still be in tramp-loaddefs.el for older
;; Emacsen.
-;;;###autoload(autoload 'tramp-archive-file-name-handler "tramp-archine")
+;;;###autoload(autoload 'tramp-archive-file-name-handler "tramp-archive")
;;;###tramp-autoload
(defun tramp-archive-file-name-handler (operation &rest args)
"Invoke the file archive related OPERATION.
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index b83f9f0724e..203d3ede98f 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -330,6 +330,29 @@ CONDITION can also be a list of error conditions."
(autoload 'netrc-parse "netrc")
(netrc-parse file))))
+;; Function `replace-regexp-in-region' is new in Emacs 28.1.
+(defalias 'tramp-compat-replace-regexp-in-region
+ (if (fboundp 'replace-regexp-in-region)
+ #'replace-regexp-in-region
+ (lambda (regexp replacement &optional start end)
+ (if start
+ (when (< start (point-min))
+ (error "Start before start of buffer"))
+ (setq start (point)))
+ (if end
+ (when (> end (point-max))
+ (error "End after end of buffer"))
+ (setq end (point-max)))
+ (save-excursion
+ (let ((matches 0)
+ (case-fold-search nil))
+ (goto-char start)
+ (while (re-search-forward regexp end t)
+ (replace-match replacement t)
+ (setq matches (1+ matches)))
+ (and (not (zerop matches))
+ matches))))))
+
(dolist (elt (all-completions "tramp-compat-" obarray 'functionp))
(put (intern elt) 'tramp-suppress-trace t))
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
index 7f385292626..27b359d439b 100644
--- a/lisp/net/tramp-crypt.el
+++ b/lisp/net/tramp-crypt.el
@@ -426,7 +426,7 @@ Otherwise, return NAME."
(if (directory-name-p name) #'file-name-as-directory #'identity)
(concat
dir
- (unless (string-equal localname "/")
+ (unless (string-match-p (rx (seq bos (opt "/") eos)) localname)
(with-tramp-file-property
crypt-vec localname (concat (symbol-name op) "-file-name")
(unless (tramp-crypt-send-command
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 0b40ff867f2..ca5e959bea5 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1055,9 +1055,10 @@ file names."
;; code in case of direct copy/move. Apply
;; sanity checks.
(or (not equal-remote)
- (tramp-gvfs-info newname)
- (eq op 'copy)
- (not (tramp-gvfs-info filename))))
+ (and
+ (tramp-gvfs-info newname)
+ (or (eq op 'copy)
+ (not (tramp-gvfs-info filename))))))
(if (or (not equal-remote)
(and equal-remote
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index a2b675cf885..f2e3c48235a 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -4205,14 +4205,17 @@ file exists and nonzero exit status otherwise."
;; by some sh implementations (eg, bash when called as sh) on
;; startup; this way, we avoid the startup file clobbering $PS1.
;; $PROMPT_COMMAND is another way to set the prompt in /bin/bash,
- ;; it must be discarded as well. $HISTFILE is set according to
- ;; `tramp-histfile-override'. $TERM and $INSIDE_EMACS set here to
- ;; ensure they have the correct values when the shell starts, not
- ;; just processes run within the shell. (Which processes include
- ;; our initial probes to ensure the remote shell is usable.)
- ;; For the time being, we assume that all shells interpret -i as
- ;; interactive shell. Must be the last argument, because (for
- ;; example) bash expects long options first.
+ ;; it must be discarded as well. Some ssh daemons (for example,
+ ;; on Android devices) do not acknowledge the $PS1 setting in
+ ;; that call, so we make a further sanity check. (Bug#57044)
+ ;; $HISTFILE is set according to `tramp-histfile-override'. $TERM
+ ;; and $INSIDE_EMACS set here to ensure they have the correct
+ ;; values when the shell starts, not just processes run within the
+ ;; shell. (Which processes include our initial probes to ensure
+ ;; the remote shell is usable.) For the time being, we assume
+ ;; that all shells interpret -i as interactive shell. Must be the
+ ;; last argument, because (for example) bash expects long options
+ ;; first.
(tramp-send-command
vec (format
(concat
@@ -4228,7 +4231,21 @@ file exists and nonzero exit status otherwise."
""))
(tramp-shell-quote-argument tramp-end-of-output)
shell (or (tramp-get-sh-extra-args shell) ""))
- t)
+ t t)
+
+ ;; Sanity check.
+ (tramp-barf-if-no-shell-prompt
+ (tramp-get-connection-process vec) 10
+ "Couldn't find remote shell prompt for %s" shell)
+ (unless
+ (tramp-check-for-regexp
+ (tramp-get-connection-process vec) (regexp-quote tramp-end-of-output))
+ (tramp-message vec 5 "Setting shell prompt")
+ (tramp-send-command
+ vec (format "PS1=%s PS2='' PS3='' PROMPT_COMMAND=''"
+ (tramp-shell-quote-argument tramp-end-of-output))
+ t))
+
;; Check proper HISTFILE setting. We give up when not working.
(when (and (stringp tramp-histfile-override)
(file-name-directory tramp-histfile-override))
@@ -5524,10 +5541,14 @@ Nonexistent directories are removed from spec."
;; "--color=never" argument (for example on FreeBSD).
(when (tramp-send-command-and-check
vec (format "%s -lnd /" result))
- (when (tramp-send-command-and-check
- vec (format
- "%s --color=never -al %s"
- result (tramp-get-remote-null-device vec)))
+ (when (and (tramp-send-command-and-check
+ vec (format
+ "%s --color=never -al %s"
+ result (tramp-get-remote-null-device vec)))
+ (not (string-match-p
+ (regexp-quote "\e")
+ (tramp-get-buffer-string
+ (tramp-get-buffer vec)))))
(setq result (concat result " --color=never")))
(throw 'ls-found result))
(setq dl (cdr dl))))))