Mercurial > emacs
comparison src/buffer.c @ 1252:86a17674c2a1
* buffer.c (Fbury_buffer): This used to undisplay the buffer being
buried only if the BUFFER argument was nil. Instead, undisplay the
buffer whenever it's displayed in the selected window, no matter
how it was specified by BUFFER. This is how it behaves in 18.58,
and I can't find any ChangeLog entry in 18.58 or 19.0 saying why
they differ. Fix the doc string accordingly.
| author | Jim Blandy <jimb@redhat.com> |
|---|---|
| date | Tue, 29 Sep 1992 04:08:04 +0000 |
| parents | beefc235076e |
| children | 7afcf7be0d30 |
comparison
equal
deleted
inserted
replaced
| 1251:4e556fda7a4d | 1252:86a17674c2a1 |
|---|---|
| 910 | 910 |
| 911 DEFUN ("bury-buffer", Fbury_buffer, Sbury_buffer, 0, 1, "", | 911 DEFUN ("bury-buffer", Fbury_buffer, Sbury_buffer, 0, 1, "", |
| 912 "Put BUFFER at the end of the list of all buffers.\n\ | 912 "Put BUFFER at the end of the list of all buffers.\n\ |
| 913 There it is the least likely candidate for `other-buffer' to return;\n\ | 913 There it is the least likely candidate for `other-buffer' to return;\n\ |
| 914 thus, the least likely buffer for \\[switch-to-buffer] to select by default.\n\ | 914 thus, the least likely buffer for \\[switch-to-buffer] to select by default.\n\ |
| 915 If the argument is nil, bury the current buffer\n\ | 915 BUFFER is also removed from the selected window if it was displayed there.\n\ |
| 916 and switch to some other buffer in the selected window.") | 916 If BUFFER is omitted, the current buffer is buried.") |
| 917 (buf) | 917 (buf) |
| 918 register Lisp_Object buf; | 918 register Lisp_Object buf; |
| 919 { | 919 { |
| 920 register Lisp_Object aelt, link; | 920 /* Figure out what buffer we're going to bury. */ |
| 921 | |
| 922 if (NILP (buf)) | 921 if (NILP (buf)) |
| 923 { | 922 XSET (buf, Lisp_Buffer, current_buffer); |
| 924 XSET (buf, Lisp_Buffer, current_buffer); | |
| 925 Fswitch_to_buffer (Fother_buffer (buf), Qnil); | |
| 926 } | |
| 927 else | 923 else |
| 928 { | 924 { |
| 929 Lisp_Object buf1; | 925 Lisp_Object buf1; |
| 930 | 926 |
| 931 buf1 = Fget_buffer (buf); | 927 buf1 = Fget_buffer (buf); |
| 932 if (NILP (buf1)) | 928 if (NILP (buf1)) |
| 933 nsberror (buf); | 929 nsberror (buf); |
| 934 buf = buf1; | 930 buf = buf1; |
| 935 } | 931 } |
| 936 | 932 |
| 937 aelt = Frassq (buf, Vbuffer_alist); | 933 /* Remove it from the screen. */ |
| 938 link = Fmemq (aelt, Vbuffer_alist); | 934 if (EQ (buf, XWINDOW (selected_frame)->buffer)) |
| 939 Vbuffer_alist = Fdelq (aelt, Vbuffer_alist); | 935 Fswitch_to_buffer (Fother_buffer (buf), Qnil); |
| 940 XCONS (link)->cdr = Qnil; | 936 |
| 941 Vbuffer_alist = nconc2 (Vbuffer_alist, link); | 937 /* Move it to the end of the buffer list. */ |
| 938 { | |
| 939 register Lisp_Object aelt, link; | |
| 940 | |
| 941 aelt = Frassq (buf, Vbuffer_alist); | |
| 942 link = Fmemq (aelt, Vbuffer_alist); | |
| 943 Vbuffer_alist = Fdelq (aelt, Vbuffer_alist); | |
| 944 XCONS (link)->cdr = Qnil; | |
| 945 Vbuffer_alist = nconc2 (Vbuffer_alist, link); | |
| 946 } | |
| 947 | |
| 942 return Qnil; | 948 return Qnil; |
| 943 } | 949 } |
| 944 | 950 |
| 945 DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, 0, | 951 DEFUN ("erase-buffer", Ferase_buffer, Serase_buffer, 0, 0, 0, |
| 946 "Delete the entire contents of the current buffer.\n\ | 952 "Delete the entire contents of the current buffer.\n\ |
