Mercurial > emacs
comparison src/buffer.c @ 1586:f84e400808d0
* buffer.c (Ferase_buffer): Doc fix.
* buffer.c (Fbury_buffer): Make this behave as in 18.59, although
that behavior is very odd - only remove the buffer from the
selected window if BUFFER was nil or omitted.
| author | Jim Blandy <jimb@redhat.com> |
|---|---|
| date | Mon, 16 Nov 1992 00:33:17 +0000 |
| parents | e721339972b0 |
| children | 86c951f6a444 |
comparison
equal
deleted
inserted
replaced
| 1585:447d89e51c6e | 1586:f84e400808d0 |
|---|---|
| 925 | 925 |
| 926 DEFUN ("bury-buffer", Fbury_buffer, Sbury_buffer, 0, 1, "", | 926 DEFUN ("bury-buffer", Fbury_buffer, Sbury_buffer, 0, 1, "", |
| 927 "Put BUFFER at the end of the list of all buffers.\n\ | 927 "Put BUFFER at the end of the list of all buffers.\n\ |
| 928 There it is the least likely candidate for `other-buffer' to return;\n\ | 928 There it is the least likely candidate for `other-buffer' to return;\n\ |
| 929 thus, the least likely buffer for \\[switch-to-buffer] to select by default.\n\ | 929 thus, the least likely buffer for \\[switch-to-buffer] to select by default.\n\ |
| 930 BUFFER is also removed from the selected window if it was displayed there.\n\ | 930 If BUFFER is nil or omitted, bury the current buffer.\n\ |
| 931 If BUFFER is omitted, the current buffer is buried.") | 931 Also, if BUFFER is nil or omitted, remove the current buffer from the\n\ |
| 932 selected window if it is displayed there.") | |
| 932 (buf) | 933 (buf) |
| 933 register Lisp_Object buf; | 934 register Lisp_Object buf; |
| 934 { | 935 { |
| 935 /* Figure out what buffer we're going to bury. */ | 936 /* Figure out what buffer we're going to bury. */ |
| 936 if (NILP (buf)) | 937 if (NILP (buf)) |
| 937 XSET (buf, Lisp_Buffer, current_buffer); | 938 { |
| 939 XSET (buf, Lisp_Buffer, current_buffer); | |
| 940 | |
| 941 /* If we're burying the current buffer, unshow it. */ | |
| 942 Fswitch_to_buffer (Fother_buffer (buf), Qnil); | |
| 943 } | |
| 938 else | 944 else |
| 939 { | 945 { |
| 940 Lisp_Object buf1; | 946 Lisp_Object buf1; |
| 941 | 947 |
| 942 buf1 = Fget_buffer (buf); | 948 buf1 = Fget_buffer (buf); |
| 943 if (NILP (buf1)) | 949 if (NILP (buf1)) |
| 944 nsberror (buf); | 950 nsberror (buf); |
| 945 buf = buf1; | 951 buf = buf1; |
| 946 } | 952 } |
| 947 | 953 |
| 948 /* Remove it from the screen. */ | 954 /* Move buf to the end of the buffer list. */ |
| 949 if (EQ (buf, XWINDOW (selected_window)->buffer)) | |
| 950 Fswitch_to_buffer (Fother_buffer (buf, Qnil), Qnil); | |
| 951 | |
| 952 /* Move it to the end of the buffer list. */ | |
| 953 { | 955 { |
| 954 register Lisp_Object aelt, link; | 956 register Lisp_Object aelt, link; |
| 955 | 957 |
| 956 aelt = Frassq (buf, Vbuffer_alist); | 958 aelt = Frassq (buf, Vbuffer_alist); |
| 957 link = Fmemq (aelt, Vbuffer_alist); | 959 link = Fmemq (aelt, Vbuffer_alist); |
| 963 return Qnil; | 965 return Qnil; |
| 964 } | 966 } |
| 965 | 967 |
| 966 DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, 0, | 968 DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, 0, |
| 967 "Delete the entire contents of the current buffer.\n\ | 969 "Delete the entire contents of the current buffer.\n\ |
| 968 Any clipping restriction in effect (see `narrow-to-buffer') is removed,\n\ | 970 Any clipping restriction in effect (see `narrow-to-region') is removed,\n\ |
| 969 so the buffer is truly empty after this.") | 971 so the buffer is truly empty after this.") |
| 970 () | 972 () |
| 971 { | 973 { |
| 972 Fwiden (); | 974 Fwiden (); |
| 973 del_range (BEG, Z); | 975 del_range (BEG, Z); |
