diff options
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c index 1d363738342..db498bbf29b 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -535,13 +535,14 @@ This does not change the name of the visited file (if any).") | |||
| 535 | return name; | 535 | return name; |
| 536 | } | 536 | } |
| 537 | 537 | ||
| 538 | DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 1, 0, | 538 | DEFUN ("other-buffer", Fother_buffer, Sother_buffer, 0, 2, 0, |
| 539 | "Return most recently selected buffer other than BUFFER.\n\ | 539 | "Return most recently selected buffer other than BUFFER.\n\ |
| 540 | Buffers not visible in windows are preferred to visible buffers.\n\ | 540 | Buffers not visible in windows are preferred to visible buffers,\n\ |
| 541 | unless optional second argument VISIBLE-OK is non-nil.\n\ | ||
| 541 | If no other buffer exists, the buffer `*scratch*' is returned.\n\ | 542 | If no other buffer exists, the buffer `*scratch*' is returned.\n\ |
| 542 | If BUFFER is omitted or nil, some interesting buffer is returned.") | 543 | If BUFFER is omitted or nil, some interesting buffer is returned.") |
| 543 | (buffer) | 544 | (buffer, visible_ok) |
| 544 | register Lisp_Object buffer; | 545 | register Lisp_Object buffer, visible_ok; |
| 545 | { | 546 | { |
| 546 | register Lisp_Object tail, buf, notsogood, tem; | 547 | register Lisp_Object tail, buf, notsogood, tem; |
| 547 | notsogood = Qnil; | 548 | notsogood = Qnil; |
| @@ -553,7 +554,10 @@ If BUFFER is omitted or nil, some interesting buffer is returned.") | |||
| 553 | continue; | 554 | continue; |
| 554 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') | 555 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') |
| 555 | continue; | 556 | continue; |
| 556 | tem = Fget_buffer_window (buf, Qnil); | 557 | if (NILP (visible_ok)) |
| 558 | tem = Fget_buffer_window (buf, Qnil); | ||
| 559 | else | ||
| 560 | tem = Qnil; | ||
| 557 | if (NILP (tem)) | 561 | if (NILP (tem)) |
| 558 | return buf; | 562 | return buf; |
| 559 | if (NILP (notsogood)) | 563 | if (NILP (notsogood)) |