Mercurial > hg > xemacs-beta
comparison man/lispref/files.texi @ 280:7df0dd720c89 r21-0b38
Import from CVS: tag r21-0b38
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:32:22 +0200 |
parents | 1856695b1fa9 |
children | c9fe270a4101 |
comparison
equal
deleted
inserted
replaced
279:c20b2fb5bb0a | 280:7df0dd720c89 |
---|---|
1536 (expand-file-name "bar/../foo") | 1536 (expand-file-name "bar/../foo") |
1537 @result{} "/xcssun/users/rms/lewis/foo" | 1537 @result{} "/xcssun/users/rms/lewis/foo" |
1538 @end group | 1538 @end group |
1539 @end example | 1539 @end example |
1540 | 1540 |
1541 @samp{~/} is expanded into the user's home directory. A @samp{/} or | 1541 @samp{~/} at the beginning is expanded into the user's home directory. |
1542 @samp{~} following a @samp{/} is taken to be the start of an absolute | 1542 A @samp{/} or @samp{~} following a @samp{/}. |
1543 file name that overrides what precedes it, so everything before that | |
1544 @samp{/} or @samp{~} is deleted. For example: | |
1545 | |
1546 @example | |
1547 @group | |
1548 (expand-file-name | |
1549 "/a1/gnu//usr/local/lib/emacs/etc/MACHINES") | |
1550 @result{} "/usr/local/lib/emacs/etc/MACHINES" | |
1551 @end group | |
1552 @group | |
1553 (expand-file-name "/a1/gnu/~/foo") | |
1554 @result{} "/xcssun/users/rms/foo" | |
1555 @end group | |
1556 @end example | |
1557 | |
1558 @noindent | |
1559 In both cases, @file{/a1/gnu/} is discarded because an absolute file | |
1560 name follows it. | |
1561 | 1543 |
1562 Note that @code{expand-file-name} does @emph{not} expand environment | 1544 Note that @code{expand-file-name} does @emph{not} expand environment |
1563 variables; only @code{substitute-in-file-name} does that. | 1545 variables; only @code{substitute-in-file-name} does that. |
1564 @end defun | 1546 @end defun |
1565 | 1547 |