From: Stefan Kangas Date: Mon, 6 Jan 2025 10:07:09 +0000 (+0100) Subject: Improve integer file mode options docstrings X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8b744539311c33d69d52200f2aa43718fb84ad1d;p=emacs.git Improve integer file mode options docstrings * lisp/eshell/esh-util.el (eshell-private-file-modes) (eshell-private-directory-modes): * lisp/gnus/mail-source.el (mail-source-default-file-modes): * lisp/printing.el (pr-file-modes): * lisp/gnus/mm-decode.el (mm-attachment-file-modes): * lisp/gnus/nnmail.el (nnmail-default-file-modes): * lisp/recentf.el (recentf-save-file-modes): * lisp/vc/ediff-init.el (ediff-temp-file-mode): * lisp/vc/emerge.el (emerge-temp-file-mode): Better document the fact that these are integer and not octal values. * lisp/epg.el (epg--start): * lisp/emacs-lisp/package.el (package-import-keyring): Use octal values to make the code more self-documenting. (cherry picked from commit da5df90fadbec9db692ff34abcd28ce5a5b29c2a) --- diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ef502314e3d..9accb2e0e62 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1751,7 +1751,7 @@ The variable `package-load-list' controls which packages to load." (setq file (expand-file-name file)) (let ((context (epg-make-context 'OpenPGP))) (when package-gnupghome-dir - (with-file-modes 448 + (with-file-modes #o700 (make-directory package-gnupghome-dir t)) (setf (epg-context-home-directory context) package-gnupghome-dir)) (message "Importing %s..." (file-name-nondirectory file)) diff --git a/lisp/epg.el b/lisp/epg.el index 385e5a7f7c8..c796230b12c 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -670,7 +670,7 @@ callback data (if any)." :noquery t)) (setf (epg-context-error-buffer context) (process-buffer error-process)) (with-existing-directory - (with-file-modes 448 + (with-file-modes #o700 (setq process (make-process :name "epg" :buffer buffer :command (cons (epg-context-program context) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 189be5fe57c..bc2e04746b1 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -64,11 +64,13 @@ Setting this to nil is offered as an aid to debugging only." :type 'boolean) (defcustom eshell-private-file-modes #o600 ; umask 177 - "The file-modes value to use for creating \"private\" files." + "The file-modes value to use for creating \"private\" files. +This is decimal, not octal. The default is 384 (0600 in octal)." :type 'integer) (defcustom eshell-private-directory-modes #o700 ; umask 077 - "The file-modes value to use for creating \"private\" directories." + "The file-modes value to use for creating \"private\" directories. +This is decimal, not octal. The default is 448 (0700 in octal)." :type 'integer) (defcustom eshell-tar-regexp diff --git a/lisp/gnus/mail-source.el b/lisp/gnus/mail-source.el index 838ba7dac77..eece03a62bc 100644 --- a/lisp/gnus/mail-source.el +++ b/lisp/gnus/mail-source.el @@ -246,8 +246,9 @@ If non-nil, this maildrop will be checked periodically for new mail." "Directory where incoming mail source files (if any) will be stored." :type 'directory) -(defcustom mail-source-default-file-modes 384 - "Set the mode bits of all new mail files to this integer." +(defcustom mail-source-default-file-modes #o600 + "Set the mode bits of all new mail files to this integer. +This is decimal, not octal. The default is 384 (0600 in octal)." :type 'integer) (defcustom mail-source-delete-incoming diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index eced568ff09..543c1cc257a 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -442,8 +442,9 @@ If not set, `default-directory' will be used." :type '(choice directory (const :tag "Default" nil)) :group 'mime-display) -(defcustom mm-attachment-file-modes 384 - "Set the mode bits of saved attachments to this integer." +(defcustom mm-attachment-file-modes #o600 + "Set the mode bits of saved attachments to this integer. +This is decimal, not octal. The default is 384 (0600 in octal)." :version "22.1" :type 'integer :group 'mime-display) diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el index 966078659f7..e580d7aebba 100644 --- a/lisp/gnus/nnmail.el +++ b/lisp/gnus/nnmail.el @@ -152,8 +152,9 @@ If nil, groups like \"mail.misc\" will end up in directories like :group 'nnmail-files :type 'boolean) -(defcustom nnmail-default-file-modes 384 - "Set the mode bits of all new mail files to this integer." +(defcustom nnmail-default-file-modes #o600 + "Set the mode bits of all new mail files to this integer. +This is decimal, not octal. The default is 384 (0600 in octal)." :group 'nnmail-files :type 'integer) diff --git a/lisp/printing.el b/lisp/printing.el index 0d7013a30cf..c84ee54eb7f 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -1814,9 +1814,9 @@ See also `pr-temp-dir' and `pr-file-modes'." ;; It uses 0600 as default instead of (default-file-modes). ;; So, by default, only the session owner have permission to deal with files ;; generated by `printing'. -(defcustom pr-file-modes ?\600 +(defcustom pr-file-modes #o600 "Specify the file permission bits for newly created files. - +This is decimal, not octal. The default is 384 (0600 in octal). It should be an integer; only the low 9 bits are used. See also `pr-temp-dir' and `pr-ps-temp-file'." diff --git a/lisp/recentf.el b/lisp/recentf.el index 1f1d6b94ae9..4e84dc68721 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -96,9 +96,10 @@ See the command `recentf-save-list'." (defcustom recentf-save-file-modes #o600 "Mode bits of recentf save file, as an integer, or nil. -If non-nil, after writing `recentf-save-file', set its mode bits to -this value. By default give R/W access only to the user who owns that -file. See also the function `set-file-modes'." +If non-nil, after writing `recentf-save-file', set its mode bits to this +value. This is decimal, not octal. The default is 384 (0600 in octal), +which gives R/W access only to the user who owns that file. See also +the function `set-file-modes'." :group 'recentf :type '(choice (const :tag "Don't change" nil) integer)) diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index 03f280d080f..d67785d96fa 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -1218,8 +1218,9 @@ Instead, C-h would jump to previous difference." (define-obsolete-variable-alias 'ediff-temp-file-prefix 'temporary-file-directory "28.1") -(defcustom ediff-temp-file-mode 384 ; u=rw only - "Mode for Ediff temporary files." +(defcustom ediff-temp-file-mode #o0600 + "Mode for Ediff temporary files. +This is decimal, not octal. The default is 384 (0600 in octal)." :type 'integer :group 'ediff) diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el index ca48f2f3c7b..45405028df9 100644 --- a/lisp/vc/emerge.el +++ b/lisp/vc/emerge.el @@ -233,8 +233,9 @@ Do not start with `~/' or `~USERNAME/'." "customize `temporary-file-directory' instead." "24.4" 'set) -(defcustom emerge-temp-file-mode 384 ; u=rw only - "Mode for Emerge temporary files." +(defcustom emerge-temp-file-mode #o600 + "Mode for Emerge temporary files. +This is decimal, not octal. The default is 384 (0600 in octal)." :type 'integer) (make-obsolete-variable 'emerge-temp-file-mode