diff options
| author | Jim Blandy | 1992-11-16 00:33:17 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-11-16 00:33:17 +0000 |
| commit | a56118855c36c3b772a320137e1efd1e6e760a48 (patch) | |
| tree | 349923c60fbb3c202bf70e44c78c82422c438766 /src/buffer.c | |
| parent | 82d3f7435fe0960336eb52a66ebab775d411bfe0 (diff) | |
| download | emacs-a56118855c36c3b772a320137e1efd1e6e760a48.tar.gz emacs-a56118855c36c3b772a320137e1efd1e6e760a48.zip | |
* 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.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/buffer.c b/src/buffer.c index 74a9ad78dd6..3a318190725 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -927,14 +927,20 @@ 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; |
| @@ -945,11 +951,7 @@ If BUFFER is omitted, the current buffer is buried.") | |||
| 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 | ||
| @@ -965,7 +967,7 @@ If BUFFER is omitted, the current buffer is buried.") | |||
| 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 | { |