aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/files.texi4
-rw-r--r--src/fileio.c10
2 files changed, 12 insertions, 2 deletions
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index f49b02de97c..254eab03ea5 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1821,7 +1821,9 @@ has these permissions, or a subset of them (@code{write-region} will
1821not grant execute permissions even if the default file permissions 1821not grant execute permissions even if the default file permissions
1822allow execution). On GNU and other POSIX-like systems, the default 1822allow execution). On GNU and other POSIX-like systems, the default
1823permissions are given by the bitwise complement of the @samp{umask} 1823permissions are given by the bitwise complement of the @samp{umask}
1824value. 1824value, i.e.@: each bit that is set in the argument @var{mode} will be
1825@emph{reset} in the default permissions with which Emacs creates
1826files.
1825 1827
1826The argument @var{mode} should be an integer which specifies the 1828The argument @var{mode} should be an integer which specifies the
1827permissions, similar to @code{set-file-modes} above. Only the lowest 1829permissions, similar to @code{set-file-modes} above. Only the lowest
diff --git a/src/fileio.c b/src/fileio.c
index b7df38c8570..92cc39496c4 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3125,7 +3125,15 @@ symbolic notation, like the `chmod' command from GNU Coreutils. */)
3125DEFUN ("set-default-file-modes", Fset_default_file_modes, Sset_default_file_modes, 1, 1, 0, 3125DEFUN ("set-default-file-modes", Fset_default_file_modes, Sset_default_file_modes, 1, 1, 0,
3126 doc: /* Set the file permission bits for newly created files. 3126 doc: /* Set the file permission bits for newly created files.
3127The argument MODE should be an integer; only the low 9 bits are used. 3127The argument MODE should be an integer; only the low 9 bits are used.
3128This setting is inherited by subprocesses. */) 3128On Posix hosts, this setting is inherited by subprocesses.
3129
3130This function works by setting the Emacs's file mode creation mask.
3131Each bit that is set in the mask means that the corresponding bit
3132in the the permissions of newly created files will be disabled.
3133
3134Note that when `write-region' creates a file, it resets the
3135execute bit, even if the mask set by this function allows that bit
3136by having the corresponding bit in the mask reset. */)
3129 (Lisp_Object mode) 3137 (Lisp_Object mode)
3130{ 3138{
3131 mode_t oldrealmask, oldumask, newumask; 3139 mode_t oldrealmask, oldumask, newumask;