aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/lispref/ChangeLog4
-rw-r--r--doc/lispref/files.texi43
-rw-r--r--etc/NEWS5
3 files changed, 49 insertions, 3 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 1ea66a9b8fa..be520fa509b 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,5 +1,9 @@
12008-10-18 Eli Zaretskii <eliz@gnu.org> 12008-10-18 Eli Zaretskii <eliz@gnu.org>
2 2
3 * files.texi (Changing Files): Document symbolic input of file
4 modes to `set-file-modes'. Document `read-file-modes' and
5 `file-modes-symbolic-to-number'.
6
3 * maps.texi (Standard Keymaps): Document `multi-query-replace-map' 7 * maps.texi (Standard Keymaps): Document `multi-query-replace-map'
4 and `search-map'. 8 and `search-map'.
5 9
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 26ff06186f0..89c9d25f5ae 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1487,12 +1487,20 @@ levels of parent directories.
1487See also @code{delete-directory} in @ref{Create/Delete Dirs}. 1487See also @code{delete-directory} in @ref{Create/Delete Dirs}.
1488@end deffn 1488@end deffn
1489 1489
1490@defun set-file-modes filename mode 1490@deffn Command set-file-modes filename mode
1491This function sets mode bits of @var{filename} to @var{mode} (which 1491This function sets mode bits of @var{filename} to @var{mode} (which
1492must be an integer). Only the low 12 bits of @var{mode} are used. 1492must be an integer when the function is called non-interactively).
1493Only the low 12 bits of @var{mode} are used.
1494
1495Interactively, @var{mode} is read from the minibuffer using
1496@code{read-file-modes}, which accepts mode bits either as a number or
1497as a character string representing the mode bits symbolically. See
1498the description of @code{read-file-modes} below for the supported
1499forms of symbolic notation for mode bits.
1500
1493This function recursively follows symbolic links at all levels for 1501This function recursively follows symbolic links at all levels for
1494@var{filename}. 1502@var{filename}.
1495@end defun 1503@end deffn
1496 1504
1497@c Emacs 19 feature 1505@c Emacs 19 feature
1498@defun set-default-file-modes mode 1506@defun set-default-file-modes mode
@@ -1521,6 +1529,35 @@ the default file protection has no effect.
1521This function returns the current default protection value. 1529This function returns the current default protection value.
1522@end defun 1530@end defun
1523 1531
1532@defun read-file-modes &optional prompt base-file
1533This function reads file mode bits from the minibuffer. The optional
1534argument @var{prompt} specifies a non-default prompt. Second optional
1535argument @var{base-file} is the name of a file on whose permissions to
1536base the mode bits that this function returns, if what the user types
1537specifies mode bits relative to permissions of an existing file.
1538
1539If user input represents an octal number, this function returns that
1540number. If it is a complete symbolic specification of mode bits, as
1541in @code{"u=rwx"}, the function converts it to the equivalent numeric
1542value using @code{file-modes-symbolic-to-number} and returns the
1543result. If the specification is relative, as in @code{"o+g"}, then
1544the permissions on which the specification is based is taken from the
1545mode bits of @var{base-file}. If @var{base-file} is omitted or
1546@code{nil}, the function uses @code{0} as the base mode bits. The
1547complete and relative specifications can be combined, as in
1548@code{"u+r,g+rx,o+r,g-w"}. @xref{File Permissions,,, coreutils, The
1549@sc{gnu} @code{Coreutils} Manual}, for detailed description of
1550symbolic mode bits specifications.
1551@end defun
1552
1553@deffn Subroutine file-modes-symbolic-to-number modes &optional base-modes
1554This subroutine converts a symbolic specification of file mode bits in
1555@var{modes} into the equivalent numeric value. If the symbolic
1556specification is based on an existing file, that file's mode bits are
1557taken from the optional argument @var{base-modes}; if that argument is
1558omitted or nil, it defaults to zero, i.e.@: no access rights at all.
1559@end deffn
1560
1524@defun set-file-times filename &optional time 1561@defun set-file-times filename &optional time
1525This function sets the access and modification times of @var{filename} 1562This function sets the access and modification times of @var{filename}
1526to @var{time}. The return value is @code{t} if the times are successfully 1563to @var{time}. The return value is @code{t} if the times are successfully
diff --git a/etc/NEWS b/etc/NEWS
index 06d9ecbff91..a766de1e367 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -501,6 +501,10 @@ matches a regexp.
501*** The new commands `pp-macroexpand-expression' and 501*** The new commands `pp-macroexpand-expression' and
502`pp-macroexpand-last-sexp' pretty-print macro expansions. 502`pp-macroexpand-last-sexp' pretty-print macro expansions.
503 503
504*** The new command `set-file-modes' allows to set file's mode bits.
505The mode bits can be specified in symbolic notation, like with GNU
506Coreutils, in addition to an octal number.
507
504 508
505* New Modes and Packages in Emacs 23.1 509* New Modes and Packages in Emacs 23.1
506 510
@@ -1305,6 +1309,7 @@ unless it ends in whitespace.
1305 1309
1306** File handling changes 1310** File handling changes
1307 1311
1312+++
1308*** set-file-modes is now interactive and can take the mode value in 1313*** set-file-modes is now interactive and can take the mode value in
1309symbolic notation thanks to auxiliary functions. 1314symbolic notation thanks to auxiliary functions.
1310 1315