(let ((input (completing-read
"Enter Tramp syntax: " (tramp-syntax-values) nil t
(symbol-name tramp-syntax))))
- (unless (string-equal input "")
+ (unless (string-empty-p input)
(list (intern input)))))
(when syntax
(customize-set-variable 'tramp-syntax syntax)))
(if (>= n (length list))
list (nbutlast list (- (length list) n)))))))
+;; Function `string-equal-ignore-case' is new in Emacs 29.1.
+(defalias 'tramp-compat-string-equal-ignore-case
+ (if (fboundp 'string-equal-ignore-case)
+ #'string-equal-ignore-case
+ (lambda (string1 string2)
+ (eq t (compare-strings string1 nil nil string2 nil nil t)))))
+
(dolist (elt (all-completions "tramp-compat-" obarray 'functionp))
(put (intern elt) 'tramp-suppress-trace t))
;; parentheses with a backslash in docstrings anymore.
;;
;; * Starting with Emacs 27.1, there's `make-empty-file'. Could be
-;; used instead of `write-region'.
+;; used instead of `(write-region "" ...)'.
;;; tramp-compat.el ends here
v 6 "%s %s"
signal-name (tramp-gvfs-stringify-dbus-message mount-info))
(tramp-flush-file-property v "/" "list-mounts")
- (if (string-equal (downcase signal-name) "unmounted")
+ (if (tramp-compat-string-equal-ignore-case signal-name "unmounted")
(tramp-flush-file-properties v "/")
;; Set mountpoint and location.
(tramp-set-file-property v "/" "fuse-mountpoint" fuse-mountpoint)
(with-current-buffer (tramp-get-connection-buffer vec)
(goto-char (point-min))
(buffer-substring (point-at-bol) (point-at-eol)))))
- (if (string-equal res "")
+ (if (string-empty-p res)
(format "Signal %d" i)
res)))
result))
(copy-sequence tramp-remote-process-environment))))
(setq item (split-string item "=" 'omit))
(setcdr item (string-join (cdr item) "="))
- (if (and (stringp (cdr item)) (not (string-equal (cdr item) "")))
+ (if (and (stringp (cdr item)) (not (string-empty-p (cdr item))))
(push (format "%s %s" (car item) (cdr item)) vars)
(push (car item) unset)))
(when vars
This is METHOD, if non-nil. Otherwise, do a lookup in
`tramp-default-method-alist' and `tramp-default-method'."
(when (and method
- (or (string-equal method "")
+ (or (string-empty-p method)
(string-equal method tramp-default-method-marker)))
(setq method nil))
(let ((result