summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-compat.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-07-27 12:51:11 +0200
committerMichael Albinus <michael.albinus@gmx.de>2022-07-27 12:51:11 +0200
commitdb4dd28c21f95361de620c6e543d23da5d982fd5 (patch)
tree2b9723207893f663a512cc1b63cb601445d303a8 /lisp/net/tramp-compat.el
parent186429888981fb818624847f7356908f253b1bda (diff)
downloademacs-db4dd28c21f95361de620c6e543d23da5d982fd5.tar.gz
emacs-db4dd28c21f95361de620c6e543d23da5d982fd5.tar.bz2
emacs-db4dd28c21f95361de620c6e543d23da5d982fd5.zip
In Tramp, use `string-empty-p' and `string-equal-ignore-case' consequently
* lisp/net/tramp.el (tramp-find-method): * lisp/net/tramp-cmds.el (tramp-change-syntax): * lisp/net/tramp-sh.el (tramp-sh-get-signal-strings) (tramp-open-connection-setup-interactive-shell): Use `string-empty-p'. * lisp/net/tramp-compat.el (tramp-compat-string-equal-ignore-case): New defalias. * lisp/net/tramp-gvfs.el (tramp-gvfs-handler-mounted-unmounted): Use it.
Diffstat (limited to 'lisp/net/tramp-compat.el')
-rw-r--r--lisp/net/tramp-compat.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index ef5b1f7ec90..bc32044451c 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -312,6 +312,13 @@ CONDITION can also be a list of error conditions."
(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))
@@ -328,6 +335,6 @@ CONDITION can also be a list of error conditions."
;; 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