diff options
| author | Richard M. Stallman | 1994-05-11 04:16:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-05-11 04:16:19 +0000 |
| commit | d59698c431e4bff8680ac2779084c89d11eed3d7 (patch) | |
| tree | 1318b930e5b9b6c23e25028d94ac2d194c1c3d49 /src/buffer.c | |
| parent | 8fb3cf64812e31c63bdec8df1cd008ddf7634710 (diff) | |
| download | emacs-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.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).") | |||
| 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\ | |||
| 2591 | That's because these variables are temporarily set to nil.\n\ | 2595 | That's because these variables are temporarily set to nil.\n\ |
| 2592 | As a result, a hook function cannot straightforwardly alter the value of\n\ | 2596 | As a result, a hook function cannot straightforwardly alter the value of\n\ |
| 2593 | these variables. See the Emacs Lisp manual for a way of\n\ | 2597 | these variables. See the Emacs Lisp manual for a way of\n\ |
| 2594 | accomplishing an equivalent result by using other variables.") | 2598 | accomplishing 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\ | |||
| 2608 | That's because these variables are temporarily set to nil.\n\ | 2612 | That's because these variables are temporarily set to nil.\n\ |
| 2609 | As a result, a hook function cannot straightforwardly alter the value of\n\ | 2613 | As a result, a hook function cannot straightforwardly alter the value of\n\ |
| 2610 | these variables. See the Emacs Lisp manual for a way of\n\ | 2614 | these variables. See the Emacs Lisp manual for a way of\n\ |
| 2611 | accomplishing an equivalent result by using other variables.") | 2615 | accomplishing 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\ | |||
| 2623 | That's because these variables are temporarily set to nil.\n\ | 2627 | That's because these variables are temporarily set to nil.\n\ |
| 2624 | As a result, a hook function cannot straightforwardly alter the value of\n\ | 2628 | As a result, a hook function cannot straightforwardly alter the value of\n\ |
| 2625 | these variables. See the Emacs Lisp manual for a way of\n\ | 2629 | these variables. See the Emacs Lisp manual for a way of\n\ |
| 2626 | accomplishing an equivalent result by using other variables.") | 2630 | accomplishing 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\ | |||
| 2640 | That's because these variables are temporarily set to nil.\n\ | 2644 | That's because these variables are temporarily set to nil.\n\ |
| 2641 | As a result, a hook function cannot straightforwardly alter the value of\n\ | 2645 | As a result, a hook function cannot straightforwardly alter the value of\n\ |
| 2642 | these variables. See the Emacs Lisp manual for a way of\n\ | 2646 | these variables. See the Emacs Lisp manual for a way of\n\ |
| 2643 | accomplishing an equivalent result by using other variables.") | 2647 | accomplishing an equivalent result by using other variables."); |
| 2644 | 2648 | ||
| 2645 | Vafter_change_functions = Qnil; | 2649 | Vafter_change_functions = Qnil; |
| 2646 | 2650 | ||