aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1993-12-23 01:53:11 +0000
committerRichard M. Stallman1993-12-23 01:53:11 +0000
commitd9bc1c99c08860e101bc8c208e418165871f31d0 (patch)
tree5a02bfc2a5bb4371e8c5f60f201ef7777de8e7c5 /src
parent7c6b2ea4a607449331f67b5d6dd302aedc7f3eff (diff)
downloademacs-d9bc1c99c08860e101bc8c208e418165871f31d0.tar.gz
emacs-d9bc1c99c08860e101bc8c208e418165871f31d0.zip
(Fmake_symbolic_link): Do expand FILENAME if starts with ~.
(Fread_file_name): If defalt is nil and user tries to use it, signal an error.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 09313252a3a..25860721709 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1885,9 +1885,11 @@ This happens for interactive use with M-x.")
1885 GCPRO2 (filename, linkname); 1885 GCPRO2 (filename, linkname);
1886 CHECK_STRING (filename, 0); 1886 CHECK_STRING (filename, 0);
1887 CHECK_STRING (linkname, 1); 1887 CHECK_STRING (linkname, 1);
1888#if 0 /* This made it impossible to make a link to a relative name. */ 1888 /* If the link target has a ~, we must expand it to get
1889 filename = Fexpand_file_name (filename, Qnil); 1889 a truly valid file name. Otherwise, do not expand;
1890#endif 1890 we want to permit links to relative file names. */
1891 if (XSTRING (filename)->data[0] == '~')
1892 filename = Fexpand_file_name (filename, Qnil);
1891 linkname = Fexpand_file_name (linkname, Qnil); 1893 linkname = Fexpand_file_name (linkname, Qnil);
1892 1894
1893 /* If the file name has special constructs in it, 1895 /* If the file name has special constructs in it,
@@ -3431,7 +3433,12 @@ DIR defaults to current buffer's directory default.")
3431 if (!NILP (tem) && !NILP (defalt)) 3433 if (!NILP (tem) && !NILP (defalt))
3432 return defalt; 3434 return defalt;
3433 if (XSTRING (val)->size == 0 && NILP (insdef)) 3435 if (XSTRING (val)->size == 0 && NILP (insdef))
3434 return defalt; 3436 {
3437 if (!NILP (defalt))
3438 return defalt;
3439 else
3440 error ("No default file name");
3441 }
3435 return Fsubstitute_in_file_name (val); 3442 return Fsubstitute_in_file_name (val);
3436} 3443}
3437 3444