diff options
| author | Richard M. Stallman <rms@gnu.org> | 1994-05-11 04:16:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1994-05-11 04:16:19 +0000 |
| commit | d59698c431e4bff8680ac2779084c89d11eed3d7 (patch) | |
| tree | 1318b930e5b9b6c23e25028d94ac2d194c1c3d49 /src | |
| parent | 8fb3cf64812e31c63bdec8df1cd008ddf7634710 (diff) | |
| download | emacs-d59698c431e4bff8680ac2779084c89d11eed3d7.tar.gz | |
(Frename_buffer): Reject empty string as new name.
(syms_of_buffer): Fix typo in previous change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c index fa7d74bb6c0..3008583b491 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -581,6 +581,10 @@ This does not change the name of the visited file (if any).") register Lisp_Object tem, buf; CHECK_STRING (name, 0); + + if (XSTRING (name)->size == 0) + error ("Empty string is invalid as a buffer name"); + tem = Fget_buffer (name); /* Don't short-circuit if UNIQUE is t. That is a useful way to rename the buffer automatically so you can create another with the original name. @@ -2591,7 +2595,7 @@ don't call any before-change or after-change functions.\n\ That's because these variables are temporarily set to nil.\n\ As a result, a hook function cannot straightforwardly alter the value of\n\ these variables. See the Emacs Lisp manual for a way of\n\ -accomplishing an equivalent result by using other variables.") +accomplishing an equivalent result by using other variables."); Vbefore_change_function = Qnil; DEFVAR_LISP ("after-change-function", &Vafter_change_function, @@ -2608,7 +2612,7 @@ don't call any before-change or after-change functions.\n\ That's because these variables are temporarily set to nil.\n\ As a result, a hook function cannot straightforwardly alter the value of\n\ these variables. See the Emacs Lisp manual for a way of\n\ -accomplishing an equivalent result by using other variables.") +accomplishing an equivalent result by using other variables."); Vafter_change_function = Qnil; DEFVAR_LISP ("before-change-functions", &Vbefore_change_functions, @@ -2623,7 +2627,7 @@ don't call any before-change or after-change functions.\n\ That's because these variables are temporarily set to nil.\n\ As a result, a hook function cannot straightforwardly alter the value of\n\ these variables. See the Emacs Lisp manual for a way of\n\ -accomplishing an equivalent result by using other variables.") +accomplishing an equivalent result by using other variables."); Vbefore_change_functions = Qnil; DEFVAR_LISP ("after-change-functions", &Vafter_change_functions, @@ -2640,7 +2644,7 @@ don't call any before-change or after-change functions.\n\ That's because these variables are temporarily set to nil.\n\ As a result, a hook function cannot straightforwardly alter the value of\n\ these variables. See the Emacs Lisp manual for a way of\n\ -accomplishing an equivalent result by using other variables.") +accomplishing an equivalent result by using other variables."); Vafter_change_functions = Qnil; |
