diff options
| author | Jim Blandy | 1992-09-29 04:08:04 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-09-29 04:08:04 +0000 |
| commit | b271272a9a8a0ace7d4784ad03196d451aebc010 (patch) | |
| tree | c34e7eb3c928b9a48543aba45f391329c1610d55 /src | |
| parent | 8693ca83b88b09184d62c5947ef94abd8e7d38e6 (diff) | |
| download | emacs-b271272a9a8a0ace7d4784ad03196d451aebc010.tar.gz emacs-b271272a9a8a0ace7d4784ad03196d451aebc010.zip | |
* 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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/src/buffer.c b/src/buffer.c index 6632e603514..80d4ece06a1 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -912,18 +912,14 @@ 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; |
| @@ -932,13 +928,23 @@ and switch to some other buffer in the selected window.") | |||
| 932 | if (NILP (buf1)) | 928 | if (NILP (buf1)) |
| 933 | nsberror (buf); | 929 | nsberror (buf); |
| 934 | buf = buf1; | 930 | buf = buf1; |
| 935 | } | 931 | } |
| 932 | |||
| 933 | /* Remove it from the screen. */ | ||
| 934 | if (EQ (buf, XWINDOW (selected_frame)->buffer)) | ||
| 935 | Fswitch_to_buffer (Fother_buffer (buf), Qnil); | ||
| 936 | |||
| 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 | } | ||
| 936 | 947 | ||
| 937 | aelt = Frassq (buf, Vbuffer_alist); | ||
| 938 | link = Fmemq (aelt, Vbuffer_alist); | ||
| 939 | Vbuffer_alist = Fdelq (aelt, Vbuffer_alist); | ||
| 940 | XCONS (link)->cdr = Qnil; | ||
| 941 | Vbuffer_alist = nconc2 (Vbuffer_alist, link); | ||
| 942 | return Qnil; | 948 | return Qnil; |
| 943 | } | 949 | } |
| 944 | 950 | ||