aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorRichard M. Stallman1994-05-11 04:16:19 +0000
committerRichard M. Stallman1994-05-11 04:16:19 +0000
commitd59698c431e4bff8680ac2779084c89d11eed3d7 (patch)
tree1318b930e5b9b6c23e25028d94ac2d194c1c3d49 /src/buffer.c
parent8fb3cf64812e31c63bdec8df1cd008ddf7634710 (diff)
downloademacs-d59698c431e4bff8680ac2779084c89d11eed3d7.tar.gz
emacs-d59698c431e4bff8680ac2779084c89d11eed3d7.zip
(Frename_buffer): Reject empty string as new name.
(syms_of_buffer): Fix typo in previous change.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c12
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).")
581 register Lisp_Object tem, buf; 581 register Lisp_Object tem, buf;
582 582
583 CHECK_STRING (name, 0); 583 CHECK_STRING (name, 0);
584
585 if (XSTRING (name)->size == 0)
586 error ("Empty string is invalid as a buffer name");
587
584 tem = Fget_buffer (name); 588 tem = Fget_buffer (name);
585 /* Don't short-circuit if UNIQUE is t. That is a useful way to rename 589 /* Don't short-circuit if UNIQUE is t. That is a useful way to rename
586 the buffer automatically so you can create another with the original name. 590 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\
2591That's because these variables are temporarily set to nil.\n\ 2595That's because these variables are temporarily set to nil.\n\
2592As a result, a hook function cannot straightforwardly alter the value of\n\ 2596As a result, a hook function cannot straightforwardly alter the value of\n\
2593these variables. See the Emacs Lisp manual for a way of\n\ 2597these variables. See the Emacs Lisp manual for a way of\n\
2594accomplishing an equivalent result by using other variables.") 2598accomplishing an equivalent result by using other variables.");
2595 Vbefore_change_function = Qnil; 2599 Vbefore_change_function = Qnil;
2596 2600
2597 DEFVAR_LISP ("after-change-function", &Vafter_change_function, 2601 DEFVAR_LISP ("after-change-function", &Vafter_change_function,
@@ -2608,7 +2612,7 @@ don't call any before-change or after-change functions.\n\
2608That's because these variables are temporarily set to nil.\n\ 2612That's because these variables are temporarily set to nil.\n\
2609As a result, a hook function cannot straightforwardly alter the value of\n\ 2613As a result, a hook function cannot straightforwardly alter the value of\n\
2610these variables. See the Emacs Lisp manual for a way of\n\ 2614these variables. See the Emacs Lisp manual for a way of\n\
2611accomplishing an equivalent result by using other variables.") 2615accomplishing an equivalent result by using other variables.");
2612 Vafter_change_function = Qnil; 2616 Vafter_change_function = Qnil;
2613 2617
2614 DEFVAR_LISP ("before-change-functions", &Vbefore_change_functions, 2618 DEFVAR_LISP ("before-change-functions", &Vbefore_change_functions,
@@ -2623,7 +2627,7 @@ don't call any before-change or after-change functions.\n\
2623That's because these variables are temporarily set to nil.\n\ 2627That's because these variables are temporarily set to nil.\n\
2624As a result, a hook function cannot straightforwardly alter the value of\n\ 2628As a result, a hook function cannot straightforwardly alter the value of\n\
2625these variables. See the Emacs Lisp manual for a way of\n\ 2629these variables. See the Emacs Lisp manual for a way of\n\
2626accomplishing an equivalent result by using other variables.") 2630accomplishing an equivalent result by using other variables.");
2627 Vbefore_change_functions = Qnil; 2631 Vbefore_change_functions = Qnil;
2628 2632
2629 DEFVAR_LISP ("after-change-functions", &Vafter_change_functions, 2633 DEFVAR_LISP ("after-change-functions", &Vafter_change_functions,
@@ -2640,7 +2644,7 @@ don't call any before-change or after-change functions.\n\
2640That's because these variables are temporarily set to nil.\n\ 2644That's because these variables are temporarily set to nil.\n\
2641As a result, a hook function cannot straightforwardly alter the value of\n\ 2645As a result, a hook function cannot straightforwardly alter the value of\n\
2642these variables. See the Emacs Lisp manual for a way of\n\ 2646these variables. See the Emacs Lisp manual for a way of\n\
2643accomplishing an equivalent result by using other variables.") 2647accomplishing an equivalent result by using other variables.");
2644 2648
2645 Vafter_change_functions = Qnil; 2649 Vafter_change_functions = Qnil;
2646 2650