summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2018-11-10 15:55:23 +0100
committerMichael Albinus <michael.albinus@gmx.de>2018-11-10 15:55:23 +0100
commit55f3f21b39389263d707b091d7e1b45d295a149c (patch)
tree8c3ffe1a51ca3a45b55701c8276343b5167514a4
parent70c75167ede4c54bb796187146437120856f890b (diff)
downloademacs-55f3f21b39389263d707b091d7e1b45d295a149c.tar.gz
emacs-55f3f21b39389263d707b091d7e1b45d295a149c.tar.bz2
emacs-55f3f21b39389263d707b091d7e1b45d295a149c.zip
* lisp/net/tramp.el (tramp-get-local-gid): Use `group-name' if available.
-rw-r--r--lisp/net/tramp.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 4ee69d71986..44d66404f15 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4193,10 +4193,14 @@ ID-FORMAT valid values are `string' and `integer'."
(defun tramp-get-local-gid (id-format)
"The gid of the local user, in ID-FORMAT.
ID-FORMAT valid values are `string' and `integer'."
- ;; `group-gid' has been introduced with Emacs 24.4.
- (if (and (fboundp 'group-gid) (equal id-format 'integer))
- (tramp-compat-funcall 'group-gid)
- (tramp-compat-file-attribute-group-id (file-attributes "~/" id-format))))
+ (cond
+ ;; `group-gid' has been introduced with Emacs 24.4.
+ ((and (fboundp 'group-gid) (equal id-format 'integer))
+ (tramp-compat-funcall 'group-gid))
+ ;; `group-name' has been introduced with Emacs 27.1.
+ ((and (fboundp 'group-name) (equal id-format 'string))
+ (tramp-compat-funcall 'group-name (tramp-compat-funcall 'group-gid)))
+ ((tramp-compat-file-attribute-group-id (file-attributes "~/" id-format)))))
(defun tramp-get-local-locale (&optional vec)
"Determine locale, supporting UTF8 if possible.