diff options
| author | Eli Zaretskii | 2008-10-18 17:58:25 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2008-10-18 17:58:25 +0000 |
| commit | 018a960d04c5ef46c850ffa3ceda92db07cd78d0 (patch) | |
| tree | 3fa79574c977ec2ffb4b9fb524795a121ad6f038 | |
| parent | d653c8cc93c2d7f522de4ba548a641cd657569bc (diff) | |
| download | emacs-018a960d04c5ef46c850ffa3ceda92db07cd78d0.tar.gz emacs-018a960d04c5ef46c850ffa3ceda92db07cd78d0.zip | |
(Changing Files): Document symbolic input of file modes to `set-file-modes'.
Document `read-file-modes' and `file-modes-symbolic-to-number'.
| -rw-r--r-- | doc/lispref/ChangeLog | 4 | ||||
| -rw-r--r-- | doc/lispref/files.texi | 43 | ||||
| -rw-r--r-- | etc/NEWS | 5 |
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 @@ | |||
| 1 | 2008-10-18 Eli Zaretskii <eliz@gnu.org> | 1 | 2008-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. | |||
| 1487 | See also @code{delete-directory} in @ref{Create/Delete Dirs}. | 1487 | See 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 |
| 1491 | This function sets mode bits of @var{filename} to @var{mode} (which | 1491 | This function sets mode bits of @var{filename} to @var{mode} (which |
| 1492 | must be an integer). Only the low 12 bits of @var{mode} are used. | 1492 | must be an integer when the function is called non-interactively). |
| 1493 | Only the low 12 bits of @var{mode} are used. | ||
| 1494 | |||
| 1495 | Interactively, @var{mode} is read from the minibuffer using | ||
| 1496 | @code{read-file-modes}, which accepts mode bits either as a number or | ||
| 1497 | as a character string representing the mode bits symbolically. See | ||
| 1498 | the description of @code{read-file-modes} below for the supported | ||
| 1499 | forms of symbolic notation for mode bits. | ||
| 1500 | |||
| 1493 | This function recursively follows symbolic links at all levels for | 1501 | This 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. | |||
| 1521 | This function returns the current default protection value. | 1529 | This function returns the current default protection value. |
| 1522 | @end defun | 1530 | @end defun |
| 1523 | 1531 | ||
| 1532 | @defun read-file-modes &optional prompt base-file | ||
| 1533 | This function reads file mode bits from the minibuffer. The optional | ||
| 1534 | argument @var{prompt} specifies a non-default prompt. Second optional | ||
| 1535 | argument @var{base-file} is the name of a file on whose permissions to | ||
| 1536 | base the mode bits that this function returns, if what the user types | ||
| 1537 | specifies mode bits relative to permissions of an existing file. | ||
| 1538 | |||
| 1539 | If user input represents an octal number, this function returns that | ||
| 1540 | number. If it is a complete symbolic specification of mode bits, as | ||
| 1541 | in @code{"u=rwx"}, the function converts it to the equivalent numeric | ||
| 1542 | value using @code{file-modes-symbolic-to-number} and returns the | ||
| 1543 | result. If the specification is relative, as in @code{"o+g"}, then | ||
| 1544 | the permissions on which the specification is based is taken from the | ||
| 1545 | mode 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 | ||
| 1547 | complete 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 | ||
| 1550 | symbolic mode bits specifications. | ||
| 1551 | @end defun | ||
| 1552 | |||
| 1553 | @deffn Subroutine file-modes-symbolic-to-number modes &optional base-modes | ||
| 1554 | This subroutine converts a symbolic specification of file mode bits in | ||
| 1555 | @var{modes} into the equivalent numeric value. If the symbolic | ||
| 1556 | specification is based on an existing file, that file's mode bits are | ||
| 1557 | taken from the optional argument @var{base-modes}; if that argument is | ||
| 1558 | omitted 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 |
| 1525 | This function sets the access and modification times of @var{filename} | 1562 | This function sets the access and modification times of @var{filename} |
| 1526 | to @var{time}. The return value is @code{t} if the times are successfully | 1563 | to @var{time}. The return value is @code{t} if the times are successfully |
| @@ -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. | ||
| 505 | The mode bits can be specified in symbolic notation, like with GNU | ||
| 506 | Coreutils, 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 |
| 1309 | symbolic notation thanks to auxiliary functions. | 1314 | symbolic notation thanks to auxiliary functions. |
| 1310 | 1315 | ||