diff options
| author | Richard M. Stallman | 1997-06-26 21:09:22 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-26 21:09:22 +0000 |
| commit | 08460cd4fb8890f5f797b10281afc4b3d8ee71db (patch) | |
| tree | 1084c278a27ccfd87600fcb572752273d832fdba /src | |
| parent | b79e7b7b3e8941f35e305b3f2984d1c0b52def22 (diff) | |
| download | emacs-08460cd4fb8890f5f797b10281afc4b3d8ee71db.tar.gz emacs-08460cd4fb8890f5f797b10281afc4b3d8ee71db.zip | |
(Fbuffer_list): New optional argument FRAME.
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c index e220981243f..baa7f6104d4 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -39,6 +39,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 39 | #include "region-cache.h" | 39 | #include "region-cache.h" |
| 40 | #include "indent.h" | 40 | #include "indent.h" |
| 41 | #include "blockinput.h" | 41 | #include "blockinput.h" |
| 42 | #include "frame.h" | ||
| 42 | 43 | ||
| 43 | struct buffer *current_buffer; /* the current buffer */ | 44 | struct buffer *current_buffer; /* the current buffer */ |
| 44 | 45 | ||
| @@ -179,11 +180,34 @@ Value is nil if OBJECT is not a buffer or if it has been killed.") | |||
| 179 | ? Qt : Qnil); | 180 | ? Qt : Qnil); |
| 180 | } | 181 | } |
| 181 | 182 | ||
| 182 | DEFUN ("buffer-list", Fbuffer_list, Sbuffer_list, 0, 0, 0, | 183 | DEFUN ("buffer-list", Fbuffer_list, Sbuffer_list, 0, 1, 0, |
| 183 | "Return a list of all existing live buffers.") | 184 | "Return a list of all existing live buffers.\n\ |
| 184 | () | 185 | If the optional arg FRAME is a frame, we return that frame's buffer list.") |
| 186 | (frame) | ||
| 187 | Lisp_Object frame; | ||
| 185 | { | 188 | { |
| 186 | return Fmapcar (Qcdr, Vbuffer_alist); | 189 | Lisp_Object framelist, general; |
| 190 | general = Fmapcar (Qcdr, Vbuffer_alist); | ||
| 191 | |||
| 192 | if (FRAMEP (frame)) | ||
| 193 | { | ||
| 194 | Lisp_Object tail; | ||
| 195 | |||
| 196 | CHECK_FRAME (frame, 1); | ||
| 197 | |||
| 198 | framelist = Fcopy_sequence (XFRAME (frame)->buffer_list); | ||
| 199 | |||
| 200 | /* Remove from GENERAL any buffer that duplicates one in FRAMELIST. */ | ||
| 201 | tail = framelist; | ||
| 202 | while (! NILP (tail)) | ||
| 203 | { | ||
| 204 | general = Fdelq (XCONS (tail)->car, general); | ||
| 205 | tail = XCONS (tail)->cdr; | ||
| 206 | } | ||
| 207 | return nconc2 (framelist, general); | ||
| 208 | } | ||
| 209 | |||
| 210 | return general; | ||
| 187 | } | 211 | } |
| 188 | 212 | ||
| 189 | /* Like Fassoc, but use Fstring_equal to compare | 213 | /* Like Fassoc, but use Fstring_equal to compare |