summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1992-02-15 22:18:37 +0000
committerJim Blandy <jimb@redhat.com>1992-02-15 22:18:37 +0000
commit36a8c287a8731587bec4810565df541176b86ce5 (patch)
treef2b6665281767ad92fe76ec8b30a6b062cd9f909 /src
parent35e46c62b9fa31f0b3ed4b237c9d92f3020af52e (diff)
downloademacs-36a8c287a8731587bec4810565df541176b86ce5.tar.gz
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c12
-rw-r--r--src/fileio.c33
2 files changed, 39 insertions, 6 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 55d85f979ba..bbf0e297302 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -715,10 +715,10 @@ with `delete-process'.")
return Qt;
}
-/* Put the element for buffer BUF at the front of buffer-alist.
- This is done when a buffer is selected "visibly".
- It keeps buffer-alist in the order of recency of selection
- so that other_buffer will return something nice. */
+/* Move the assoc for buffer BUF to the front of buffer-alist. Since
+ we do this each time BUF is selected visibly, the more recently
+ selected buffers are always closer to the front of the list. This
+ means that other_buffer is more likely to choose a relevant buffer. */
record_buffer (buf)
Lisp_Object buf;
@@ -733,8 +733,8 @@ record_buffer (buf)
prev = link;
}
- /* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist)
- but cannot use Fdelq here it that allows quitting. */
+ /* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist);
+ we cannot use Fdelq itself here because it allows quitting. */
if (NILP (prev))
Vbuffer_alist = XCONS (Vbuffer_alist)->cdr;
diff --git a/src/fileio.c b/src/fileio.c
index 42ac45b4e53..b12f48c625a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1911,6 +1911,37 @@ Only the 12 low bits of MODE are used.")
return Qnil;
}
+DEFUN ("set-umask", Fset_umask, Sset_umask, 1, 1, 0,
+ "Select which permission bits to disable in newly created files.\n\
+MASK should be an integer; if a permission's bit in MASK is 1,\n\
+subsequently created files will not have that permission enabled.\n\
+Only the low 9 bits are used.\n\
+This setting is inherited by subprocesses.")
+ (mask)
+ Lisp_Object mask;
+{
+ CHECK_NUMBER (mask, 0);
+
+ umask (XINT (mask) & 0777);
+
+ return Qnil;
+}
+
+DEFUN ("umask", Fumask, Sumask, 0, 0, 0,
+ "Return the current umask value.\n\
+The umask value determines which permissions are enabled in newly\n\
+created files. If a permission's bit in the umask is 1, subsequently\n\
+created files will not have that permission enabled.")
+ ()
+{
+ Lisp_Object mask;
+
+ XSET (mask, Lisp_Int, umask (0));
+ umask (XINT (mask));
+
+ return mask;
+}
+
DEFUN ("file-newer-than-file-p", Ffile_newer_than_file_p, Sfile_newer_than_file_p, 2, 2, 0,
"Return t if file FILE1 is newer than file FILE2.\n\
If FILE1 does not exist, the answer is nil;\n\
@@ -2842,6 +2873,8 @@ nil means use format `var'. This variable is meaningful only on VMS.");
defsubr (&Sfile_accessible_directory_p);
defsubr (&Sfile_modes);
defsubr (&Sset_file_modes);
+ defsubr (&Sset_umask);
+ defsubr (&Sumask);
defsubr (&Sfile_newer_than_file_p);
defsubr (&Sinsert_file_contents);
defsubr (&Swrite_region);