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.
This commit is contained in:
Stefan Kangas 2025-01-06 11:07:09 +01:00
parent 6a389d5be4
commit da5df90fad
10 changed files with 27 additions and 19 deletions

View file

@ -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))

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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)

View file

@ -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'."

View file

@ -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))

View file

@ -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)

View file

@ -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