Mercurial > emacs
comparison src/buffer.h @ 88155:d7ddb3e565de
sync with trunk
| author | Henrik Enberg <henrik.enberg@telia.com> |
|---|---|
| date | Mon, 16 Jan 2006 00:03:54 +0000 |
| parents | 23a1cea22d13 |
| children |
comparison
equal
deleted
inserted
replaced
| 88154:8ce476d3ba36 | 88155:d7ddb3e565de |
|---|---|
| 1 /* Header file for the buffer manipulation primitives. | 1 /* Header file for the buffer manipulation primitives. |
| 2 Copyright (C) 1985, 86, 93, 94, 95, 97, 1998, 1999, 2000, 2001 | 2 Copyright (C) 1985, 1986, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, |
| 3 Free Software Foundation, Inc. | 3 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
| 4 | 4 |
| 5 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
| 6 | 6 |
| 7 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
| 8 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
| 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 GNU General Public License for more details. | 15 GNU General Public License for more details. |
| 16 | 16 |
| 17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
| 18 along with GNU Emacs; see the file COPYING. If not, write to | 18 along with GNU Emacs; see the file COPYING. If not, write to |
| 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 20 Boston, MA 02111-1307, USA. */ | 20 Boston, MA 02110-1301, USA. */ |
| 21 | 21 |
| 22 | 22 |
| 23 /* Accessing the parameters of the current buffer. */ | 23 /* Accessing the parameters of the current buffer. */ |
| 24 | 24 |
| 25 /* These macros come in pairs, one for the char position | 25 /* These macros come in pairs, one for the char position |
| 26 and one for the byte position. */ | 26 and one for the byte position. */ |
| 27 | 27 |
| 28 /* Position of beginning of buffer. */ | 28 /* Position of beginning of buffer. */ |
| 29 #define BEG (1) | 29 #define BEG (1) |
| 30 #define BEG_BYTE (1) | 30 #define BEG_BYTE (BEG) |
| 31 | 31 |
| 32 /* Position of beginning of accessible range of buffer. */ | 32 /* Position of beginning of accessible range of buffer. */ |
| 33 #define BEGV (current_buffer->begv) | 33 #define BEGV (current_buffer->begv) |
| 34 #define BEGV_BYTE (current_buffer->begv_byte) | 34 #define BEGV_BYTE (current_buffer->begv_byte) |
| 35 | 35 |
| 60 | 60 |
| 61 /* Address of point in buffer. */ | 61 /* Address of point in buffer. */ |
| 62 #define PT_ADDR (BYTE_POS_ADDR (current_buffer->pt_byte)) | 62 #define PT_ADDR (BYTE_POS_ADDR (current_buffer->pt_byte)) |
| 63 | 63 |
| 64 /* Address of beginning of gap in buffer. */ | 64 /* Address of beginning of gap in buffer. */ |
| 65 #define GPT_ADDR (current_buffer->text->beg + current_buffer->text->gpt_byte - 1) | 65 #define GPT_ADDR (current_buffer->text->beg + current_buffer->text->gpt_byte - BEG_BYTE) |
| 66 | 66 |
| 67 /* Address of end of gap in buffer. */ | 67 /* Address of end of gap in buffer. */ |
| 68 #define GAP_END_ADDR (current_buffer->text->beg + current_buffer->text->gpt_byte + current_buffer->text->gap_size - 1) | 68 #define GAP_END_ADDR (current_buffer->text->beg + current_buffer->text->gpt_byte + current_buffer->text->gap_size - BEG_BYTE) |
| 69 | 69 |
| 70 /* Address of end of accessible range of buffer. */ | 70 /* Address of end of accessible range of buffer. */ |
| 71 #define ZV_ADDR (BYTE_POS_ADDR (current_buffer->zv_byte)) | 71 #define ZV_ADDR (BYTE_POS_ADDR (current_buffer->zv_byte)) |
| 72 | 72 |
| 73 /* Address of end of buffer. */ | 73 /* Address of end of buffer. */ |
| 74 #define Z_ADDR (current_buffer->text->beg + current_buffer->text->gap_size + current_buffer->text->z_byte - 1) | 74 #define Z_ADDR (current_buffer->text->beg + current_buffer->text->gap_size + current_buffer->text->z_byte - BEG_BYTE) |
| 75 | 75 |
| 76 /* Size of gap. */ | 76 /* Size of gap. */ |
| 77 #define GAP_SIZE (current_buffer->text->gap_size) | 77 #define GAP_SIZE (current_buffer->text->gap_size) |
| 78 | 78 |
| 79 /* Is the current buffer narrowed? */ | 79 /* Is the current buffer narrowed? */ |
| 100 | 100 |
| 101 /* Similar macros to operate on a specified buffer. | 101 /* Similar macros to operate on a specified buffer. |
| 102 Note that many of these evaluate the buffer argument more than once. */ | 102 Note that many of these evaluate the buffer argument more than once. */ |
| 103 | 103 |
| 104 /* Position of beginning of buffer. */ | 104 /* Position of beginning of buffer. */ |
| 105 #define BUF_BEG(buf) (1) | 105 #define BUF_BEG(buf) (BEG) |
| 106 #define BUF_BEG_BYTE(buf) (1) | 106 #define BUF_BEG_BYTE(buf) (BEG_BYTE) |
| 107 | 107 |
| 108 /* Position of beginning of accessible range of buffer. */ | 108 /* Position of beginning of accessible range of buffer. */ |
| 109 #define BUF_BEGV(buf) ((buf)->begv) | 109 #define BUF_BEGV(buf) ((buf)->begv) |
| 110 #define BUF_BEGV_BYTE(buf) ((buf)->begv_byte) | 110 #define BUF_BEGV_BYTE(buf) ((buf)->begv_byte) |
| 111 | 111 |
| 127 | 127 |
| 128 /* Address of beginning of buffer. */ | 128 /* Address of beginning of buffer. */ |
| 129 #define BUF_BEG_ADDR(buf) ((buf)->text->beg) | 129 #define BUF_BEG_ADDR(buf) ((buf)->text->beg) |
| 130 | 130 |
| 131 /* Address of beginning of gap of buffer. */ | 131 /* Address of beginning of gap of buffer. */ |
| 132 #define BUF_GPT_ADDR(buf) ((buf)->text->beg + (buf)->text->gpt_byte - 1) | 132 #define BUF_GPT_ADDR(buf) ((buf)->text->beg + (buf)->text->gpt_byte - BEG_BYTE) |
| 133 | 133 |
| 134 /* Address of end of buffer. */ | 134 /* Address of end of buffer. */ |
| 135 #define BUF_Z_ADDR(buf) ((buf)->text->beg + (buf)->text->gap_size + (buf)->text->z_byte - 1) | 135 #define BUF_Z_ADDR(buf) ((buf)->text->beg + (buf)->text->gap_size + (buf)->text->z_byte - BEG_BYTE) |
| 136 | 136 |
| 137 /* Address of end of gap in buffer. */ | 137 /* Address of end of gap in buffer. */ |
| 138 #define BUF_GAP_END_ADDR(buf) ((buf)->text->beg + (buf)->text->gpt_byte + (buf)->text->gap_size - 1) | 138 #define BUF_GAP_END_ADDR(buf) ((buf)->text->beg + (buf)->text->gpt_byte + (buf)->text->gap_size - BEG_BYTE) |
| 139 | 139 |
| 140 /* Size of gap. */ | 140 /* Size of gap. */ |
| 141 #define BUF_GAP_SIZE(buf) ((buf)->text->gap_size) | 141 #define BUF_GAP_SIZE(buf) ((buf)->text->gap_size) |
| 142 | 142 |
| 143 /* Is this buffer narrowed? */ | 143 /* Is this buffer narrowed? */ |
| 278 else | 278 else |
| 279 | 279 |
| 280 /* Return the address of byte position N in current buffer. */ | 280 /* Return the address of byte position N in current buffer. */ |
| 281 | 281 |
| 282 #define BYTE_POS_ADDR(n) \ | 282 #define BYTE_POS_ADDR(n) \ |
| 283 (((n) >= GPT_BYTE ? GAP_SIZE : 0) + (n) + BEG_ADDR - 1) | 283 (((n) >= GPT_BYTE ? GAP_SIZE : 0) + (n) + BEG_ADDR - BEG_BYTE) |
| 284 | 284 |
| 285 /* Return the address of char position N. */ | 285 /* Return the address of char position N. */ |
| 286 | 286 |
| 287 #define CHAR_POS_ADDR(n) \ | 287 #define CHAR_POS_ADDR(n) \ |
| 288 (((n) >= GPT ? GAP_SIZE : 0) \ | 288 (((n) >= GPT ? GAP_SIZE : 0) \ |
| 289 + buf_charpos_to_bytepos (current_buffer, n) \ | 289 + buf_charpos_to_bytepos (current_buffer, n) \ |
| 290 + BEG_ADDR - 1) | 290 + BEG_ADDR - BEG_BYTE) |
| 291 | 291 |
| 292 /* Convert a character position to a byte position. */ | 292 /* Convert a character position to a byte position. */ |
| 293 | 293 |
| 294 #define CHAR_TO_BYTE(charpos) \ | 294 #define CHAR_TO_BYTE(charpos) \ |
| 295 (buf_charpos_to_bytepos (current_buffer, charpos)) | 295 (buf_charpos_to_bytepos (current_buffer, charpos)) |
| 301 | 301 |
| 302 /* Convert PTR, the address of a byte in the buffer, into a byte position. */ | 302 /* Convert PTR, the address of a byte in the buffer, into a byte position. */ |
| 303 | 303 |
| 304 #define PTR_BYTE_POS(ptr) \ | 304 #define PTR_BYTE_POS(ptr) \ |
| 305 ((ptr) - (current_buffer)->text->beg \ | 305 ((ptr) - (current_buffer)->text->beg \ |
| 306 - (ptr - (current_buffer)->text->beg < (unsigned) GPT_BYTE ? 0 : GAP_SIZE) \ | 306 - (ptr - (current_buffer)->text->beg <= (unsigned) (GPT_BYTE - BEG_BYTE) ? 0 : GAP_SIZE) \ |
| 307 + 1) | 307 + BEG_BYTE) |
| 308 | 308 |
| 309 /* Return character at position POS. */ | 309 /* Return character at position POS. */ |
| 310 | 310 |
| 311 #define FETCH_CHAR(pos) \ | 311 #define FETCH_CHAR(pos) \ |
| 312 (!NILP (current_buffer->enable_multibyte_characters) \ | 312 (!NILP (current_buffer->enable_multibyte_characters) \ |
| 325 doesn't point the head of valid multi-byte form, only the byte at | 325 doesn't point the head of valid multi-byte form, only the byte at |
| 326 POS is returned. No range checking. */ | 326 POS is returned. No range checking. */ |
| 327 | 327 |
| 328 #define FETCH_MULTIBYTE_CHAR(pos) \ | 328 #define FETCH_MULTIBYTE_CHAR(pos) \ |
| 329 (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \ | 329 (_fetch_multibyte_char_p = (((pos) >= GPT_BYTE ? GAP_SIZE : 0) \ |
| 330 + (pos) + BEG_ADDR - 1), \ | 330 + (pos) + BEG_ADDR - BEG_BYTE), \ |
| 331 _fetch_multibyte_char_len \ | 331 _fetch_multibyte_char_len \ |
| 332 = ((pos) >= GPT_BYTE ? ZV_BYTE : GPT_BYTE) - (pos), \ | 332 = ((pos) >= GPT_BYTE ? ZV_BYTE : GPT_BYTE) - (pos), \ |
| 333 STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len)) | 333 STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len)) |
| 334 | 334 |
| 335 /* Macros for accessing a character or byte, | 335 /* Macros for accessing a character or byte, |
| 338 | 338 |
| 339 /* Return the address of character at byte position POS in buffer BUF. | 339 /* Return the address of character at byte position POS in buffer BUF. |
| 340 Note that both arguments can be computed more than once. */ | 340 Note that both arguments can be computed more than once. */ |
| 341 | 341 |
| 342 #define BUF_BYTE_ADDRESS(buf, pos) \ | 342 #define BUF_BYTE_ADDRESS(buf, pos) \ |
| 343 ((buf)->text->beg + (pos) - 1 \ | 343 ((buf)->text->beg + (pos) - BEG_BYTE \ |
| 344 + ((pos) >= (buf)->text->gpt_byte ? (buf)->text->gap_size : 0)) | 344 + ((pos) >= (buf)->text->gpt_byte ? (buf)->text->gap_size : 0)) |
| 345 | 345 |
| 346 /* Return the address of character at char position POS in buffer BUF. | 346 /* Return the address of character at char position POS in buffer BUF. |
| 347 Note that both arguments can be computed more than once. */ | 347 Note that both arguments can be computed more than once. */ |
| 348 | 348 |
| 349 #define BUF_CHAR_ADDRESS(buf, pos) \ | 349 #define BUF_CHAR_ADDRESS(buf, pos) \ |
| 350 ((buf)->text->beg + buf_charpos_to_bytepos ((buf), (pos)) - 1 \ | 350 ((buf)->text->beg + buf_charpos_to_bytepos ((buf), (pos)) - BEG_BYTE \ |
| 351 + ((pos) >= (buf)->text->gpt ? (buf)->text->gap_size : 0)) | 351 + ((pos) >= (buf)->text->gpt ? (buf)->text->gap_size : 0)) |
| 352 | 352 |
| 353 /* Convert PTR, the address of a char in buffer BUF, | 353 /* Convert PTR, the address of a char in buffer BUF, |
| 354 into a character position. */ | 354 into a character position. */ |
| 355 | 355 |
| 356 #define BUF_PTR_BYTE_POS(buf, ptr) \ | 356 #define BUF_PTR_BYTE_POS(buf, ptr) \ |
| 357 ((ptr) - (buf)->text->beg \ | 357 ((ptr) - (buf)->text->beg \ |
| 358 - (ptr - (buf)->text->beg < (unsigned) BUF_GPT_BYTE ((buf)) \ | 358 - (ptr - (buf)->text->beg <= (unsigned) (BUF_GPT_BYTE ((buf)) - BEG_BYTE)\ |
| 359 ? 0 : BUF_GAP_SIZE ((buf))) \ | 359 ? 0 : BUF_GAP_SIZE ((buf))) \ |
| 360 + 1) | 360 + BEG_BYTE) |
| 361 | 361 |
| 362 /* Return the character at byte position POS in buffer BUF. */ | 362 /* Return the character at byte position POS in buffer BUF. */ |
| 363 | 363 |
| 364 #define BUF_FETCH_CHAR(buf, pos) \ | 364 #define BUF_FETCH_CHAR(buf, pos) \ |
| 365 (!NILP (buf->enable_multibyte_characters) \ | 365 (!NILP (buf->enable_multibyte_characters) \ |
| 376 POS is returned. No range checking. */ | 376 POS is returned. No range checking. */ |
| 377 | 377 |
| 378 #define BUF_FETCH_MULTIBYTE_CHAR(buf, pos) \ | 378 #define BUF_FETCH_MULTIBYTE_CHAR(buf, pos) \ |
| 379 (_fetch_multibyte_char_p \ | 379 (_fetch_multibyte_char_p \ |
| 380 = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0) \ | 380 = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_GAP_SIZE (buf) : 0) \ |
| 381 + (pos) + BUF_BEG_ADDR (buf) - 1), \ | 381 + (pos) + BUF_BEG_ADDR (buf) - BEG_BYTE), \ |
| 382 _fetch_multibyte_char_len \ | 382 _fetch_multibyte_char_len \ |
| 383 = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_ZV_BYTE (buf) : BUF_GPT_BYTE (buf)) \ | 383 = (((pos) >= BUF_GPT_BYTE (buf) ? BUF_ZV_BYTE (buf) : BUF_GPT_BYTE (buf)) \ |
| 384 - (pos)), \ | 384 - (pos)), \ |
| 385 STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len)) | 385 STRING_CHAR (_fetch_multibyte_char_p, _fetch_multibyte_char_len)) |
| 386 | 386 |
| 395 this address might change when blocks are relocated which can | 395 this address might change when blocks are relocated which can |
| 396 e.g. happen when malloc is called. So, don't pass a pointer | 396 e.g. happen when malloc is called. So, don't pass a pointer |
| 397 into a buffer's text to functions that malloc. */ | 397 into a buffer's text to functions that malloc. */ |
| 398 unsigned char *beg; | 398 unsigned char *beg; |
| 399 | 399 |
| 400 int gpt; /* Char pos of gap in buffer. */ | 400 EMACS_INT gpt; /* Char pos of gap in buffer. */ |
| 401 int z; /* Char pos of end of buffer. */ | 401 EMACS_INT z; /* Char pos of end of buffer. */ |
| 402 int gpt_byte; /* Byte pos of gap in buffer. */ | 402 EMACS_INT gpt_byte; /* Byte pos of gap in buffer. */ |
| 403 int z_byte; /* Byte pos of end of buffer. */ | 403 EMACS_INT z_byte; /* Byte pos of end of buffer. */ |
| 404 int gap_size; /* Size of buffer's gap. */ | 404 EMACS_INT gap_size; /* Size of buffer's gap. */ |
| 405 int modiff; /* This counts buffer-modification events | 405 int modiff; /* This counts buffer-modification events |
| 406 for this buffer. It is incremented for | 406 for this buffer. It is incremented for |
| 407 each such event, and never otherwise | 407 each such event, and never otherwise |
| 408 changed. */ | 408 changed. */ |
| 409 int save_modiff; /* Previous value of modiff, as of last | 409 int save_modiff; /* Previous value of modiff, as of last |
| 410 time buffer visited or saved a file. */ | 410 time buffer visited or saved a file. */ |
| 411 | 411 |
| 412 int overlay_modiff; /* Counts modifications to overlays. */ | 412 int overlay_modiff; /* Counts modifications to overlays. */ |
| 413 | 413 |
| 414 /* Minimum value of GPT - BEG since last redisplay that finished. */ | 414 /* Minimum value of GPT - BEG since last redisplay that finished. */ |
| 415 int beg_unchanged; | 415 EMACS_INT beg_unchanged; |
| 416 | 416 |
| 417 /* Minimum value of Z - GPT since last redisplay that finished. */ | 417 /* Minimum value of Z - GPT since last redisplay that finished. */ |
| 418 int end_unchanged; | 418 EMACS_INT end_unchanged; |
| 419 | 419 |
| 420 /* MODIFF as of last redisplay that finished; if it matches MODIFF, | 420 /* MODIFF as of last redisplay that finished; if it matches MODIFF, |
| 421 beg_unchanged and end_unchanged contain no useful information. */ | 421 beg_unchanged and end_unchanged contain no useful information. */ |
| 422 int unchanged_modified; | 422 int unchanged_modified; |
| 423 | 423 |
| 431 | 431 |
| 432 /* The markers that refer to this buffer. | 432 /* The markers that refer to this buffer. |
| 433 This is actually a single marker --- | 433 This is actually a single marker --- |
| 434 successive elements in its marker `chain' | 434 successive elements in its marker `chain' |
| 435 are the other markers referring to this buffer. */ | 435 are the other markers referring to this buffer. */ |
| 436 Lisp_Object markers; | 436 struct Lisp_Marker *markers; |
| 437 }; | 437 }; |
| 438 | 438 |
| 439 /* This is the structure that the buffer Lisp object points to. */ | 439 /* This is the structure that the buffer Lisp object points to. */ |
| 440 | 440 |
| 441 struct buffer | 441 struct buffer |
| 462 In an ordinary buffer, this is the own_text field above. | 462 In an ordinary buffer, this is the own_text field above. |
| 463 In an indirect buffer, this is the own_text field of another buffer. */ | 463 In an indirect buffer, this is the own_text field of another buffer. */ |
| 464 struct buffer_text *text; | 464 struct buffer_text *text; |
| 465 | 465 |
| 466 /* Char position of point in buffer. */ | 466 /* Char position of point in buffer. */ |
| 467 int pt; | 467 EMACS_INT pt; |
| 468 /* Byte position of point in buffer. */ | 468 /* Byte position of point in buffer. */ |
| 469 int pt_byte; | 469 EMACS_INT pt_byte; |
| 470 /* Char position of beginning of accessible range. */ | 470 /* Char position of beginning of accessible range. */ |
| 471 int begv; | 471 EMACS_INT begv; |
| 472 /* Byte position of beginning of accessible range. */ | 472 /* Byte position of beginning of accessible range. */ |
| 473 int begv_byte; | 473 EMACS_INT begv_byte; |
| 474 /* Char position of end of accessible range. */ | 474 /* Char position of end of accessible range. */ |
| 475 int zv; | 475 EMACS_INT zv; |
| 476 /* Byte position of end of accessible range. */ | 476 /* Byte position of end of accessible range. */ |
| 477 int zv_byte; | 477 EMACS_INT zv_byte; |
| 478 | 478 |
| 479 /* In an indirect buffer, this points to the base buffer. | 479 /* In an indirect buffer, this points to the base buffer. |
| 480 In an ordinary buffer, it is 0. */ | 480 In an ordinary buffer, it is 0. */ |
| 481 struct buffer *base_buffer; | 481 struct buffer *base_buffer; |
| 482 | 482 |
| 501 /* The time at which we detected a failure to auto-save, | 501 /* The time at which we detected a failure to auto-save, |
| 502 Or -1 if we didn't have a failure. */ | 502 Or -1 if we didn't have a failure. */ |
| 503 int auto_save_failure_time; | 503 int auto_save_failure_time; |
| 504 /* Position in buffer at which display started | 504 /* Position in buffer at which display started |
| 505 the last time this buffer was displayed. */ | 505 the last time this buffer was displayed. */ |
| 506 int last_window_start; | 506 EMACS_INT last_window_start; |
| 507 | 507 |
| 508 /* Set nonzero whenever the narrowing is changed in this buffer. */ | 508 /* Set nonzero whenever the narrowing is changed in this buffer. */ |
| 509 int clip_changed; | 509 int clip_changed; |
| 510 | 510 |
| 511 /* If the long line scan cache is enabled (i.e. the buffer-local | 511 /* If the long line scan cache is enabled (i.e. the buffer-local |
| 528 struct region_cache *width_run_cache; | 528 struct region_cache *width_run_cache; |
| 529 | 529 |
| 530 /* Non-zero means don't use redisplay optimizations for | 530 /* Non-zero means don't use redisplay optimizations for |
| 531 displaying this buffer. */ | 531 displaying this buffer. */ |
| 532 unsigned prevent_redisplay_optimizations_p : 1; | 532 unsigned prevent_redisplay_optimizations_p : 1; |
| 533 | |
| 534 /* List of overlays that end at or before the current center, | |
| 535 in order of end-position. */ | |
| 536 struct Lisp_Overlay *overlays_before; | |
| 537 | |
| 538 /* List of overlays that end after the current center, | |
| 539 in order of start-position. */ | |
| 540 struct Lisp_Overlay *overlays_after; | |
| 541 | |
| 542 /* Position where the overlay lists are centered. */ | |
| 543 EMACS_INT overlay_center; | |
| 533 | 544 |
| 534 /* Everything from here down must be a Lisp_Object. */ | 545 /* Everything from here down must be a Lisp_Object. */ |
| 535 | 546 |
| 536 /* The name of this buffer. */ | 547 /* The name of this buffer. */ |
| 537 Lisp_Object name; | 548 Lisp_Object name; |
| 642 /* Display table to use for text in this buffer. */ | 653 /* Display table to use for text in this buffer. */ |
| 643 Lisp_Object display_table; | 654 Lisp_Object display_table; |
| 644 /* t means the mark and region are currently active. */ | 655 /* t means the mark and region are currently active. */ |
| 645 Lisp_Object mark_active; | 656 Lisp_Object mark_active; |
| 646 | 657 |
| 647 /* List of overlays that end at or before the current center, | |
| 648 in order of end-position. */ | |
| 649 Lisp_Object overlays_before; | |
| 650 | |
| 651 /* List of overlays that end after the current center, | |
| 652 in order of start-position. */ | |
| 653 Lisp_Object overlays_after; | |
| 654 | |
| 655 /* Position where the overlay lists are centered. */ | |
| 656 Lisp_Object overlay_center; | |
| 657 | |
| 658 /* Non-nil means the buffer contents are regarded as multi-byte | 658 /* Non-nil means the buffer contents are regarded as multi-byte |
| 659 form of characters, not a binary code. */ | 659 form of characters, not a binary code. */ |
| 660 Lisp_Object enable_multibyte_characters; | 660 Lisp_Object enable_multibyte_characters; |
| 661 | 661 |
| 662 /* Coding system to be used for encoding the buffer contents on | 662 /* Coding system to be used for encoding the buffer contents on |
| 663 saving. */ | 663 saving. */ |
| 664 Lisp_Object buffer_file_coding_system; | 664 Lisp_Object buffer_file_coding_system; |
| 665 | 665 |
| 666 /* List of symbols naming the file format used for visited file. */ | 666 /* List of symbols naming the file format used for visited file. */ |
| 667 Lisp_Object file_format; | 667 Lisp_Object file_format; |
| 668 | |
| 669 /* List of symbols naming the file format used for auto-save file. */ | |
| 670 Lisp_Object auto_save_file_format; | |
| 668 | 671 |
| 669 /* True if the newline position cache and width run cache are | 672 /* True if the newline position cache and width run cache are |
| 670 enabled. See search.c and indent.c. */ | 673 enabled. See search.c and indent.c. */ |
| 671 Lisp_Object cache_long_line_scans; | 674 Lisp_Object cache_long_line_scans; |
| 672 | 675 |
| 713 /* Incremented each time the buffer is displayed in a window. */ | 716 /* Incremented each time the buffer is displayed in a window. */ |
| 714 Lisp_Object display_count; | 717 Lisp_Object display_count; |
| 715 | 718 |
| 716 /* Widths of left and right marginal areas for windows displaying | 719 /* Widths of left and right marginal areas for windows displaying |
| 717 this buffer. */ | 720 this buffer. */ |
| 718 Lisp_Object left_margin_width, right_margin_width; | 721 Lisp_Object left_margin_cols, right_margin_cols; |
| 722 | |
| 723 /* Widths of left and right fringe areas for windows displaying | |
| 724 this buffer. */ | |
| 725 Lisp_Object left_fringe_width, right_fringe_width; | |
| 726 | |
| 727 /* Non-nil means fringes are drawn outside display margins; | |
| 728 othersize draw them between margin areas and text. */ | |
| 729 Lisp_Object fringes_outside_margins; | |
| 730 | |
| 731 /* Width and type of scroll bar areas for windows displaying | |
| 732 this buffer. */ | |
| 733 Lisp_Object scroll_bar_width, vertical_scroll_bar_type; | |
| 719 | 734 |
| 720 /* Non-nil means indicate lines not displaying text (in a style | 735 /* Non-nil means indicate lines not displaying text (in a style |
| 721 like vi). */ | 736 like vi). */ |
| 722 Lisp_Object indicate_empty_lines; | 737 Lisp_Object indicate_empty_lines; |
| 738 | |
| 739 /* Non-nil means indicate buffer boundaries and scrolling. */ | |
| 740 Lisp_Object indicate_buffer_boundaries; | |
| 723 | 741 |
| 724 /* Time stamp updated each time this buffer is displayed in a window. */ | 742 /* Time stamp updated each time this buffer is displayed in a window. */ |
| 725 Lisp_Object display_time; | 743 Lisp_Object display_time; |
| 726 | 744 |
| 727 /* If scrolling the display because point is below the bottom of a | 745 /* If scrolling the display because point is below the bottom of a |
| 741 Lisp_Object cursor_type; | 759 Lisp_Object cursor_type; |
| 742 | 760 |
| 743 /* An integer > 0 means put that number of pixels below text lines | 761 /* An integer > 0 means put that number of pixels below text lines |
| 744 in the display of this buffer. */ | 762 in the display of this buffer. */ |
| 745 Lisp_Object extra_line_spacing; | 763 Lisp_Object extra_line_spacing; |
| 764 | |
| 765 /* *Cursor type to display in non-selected windows. | |
| 766 t means to use hollow box cursor. | |
| 767 See `cursor-type' for other values. */ | |
| 768 Lisp_Object cursor_in_non_selected_windows; | |
| 746 }; | 769 }; |
| 747 | 770 |
| 748 | 771 |
| 749 /* This points to the current buffer. */ | 772 /* This points to the current buffer. */ |
| 750 | 773 |
| 790 | 813 |
| 791 If a slot here contains -1, the corresponding variable is read-only. */ | 814 If a slot here contains -1, the corresponding variable is read-only. */ |
| 792 | 815 |
| 793 extern struct buffer buffer_local_types; | 816 extern struct buffer buffer_local_types; |
| 794 | 817 |
| 818 extern void delete_all_overlays P_ ((struct buffer *)); | |
| 795 extern void reset_buffer P_ ((struct buffer *)); | 819 extern void reset_buffer P_ ((struct buffer *)); |
| 796 extern void evaporate_overlays P_ ((int)); | 820 extern void evaporate_overlays P_ ((EMACS_INT)); |
| 797 extern int overlays_at P_ ((int, int, Lisp_Object **, int *, int *, int *, int)); | 821 extern int overlays_at P_ ((EMACS_INT, int, Lisp_Object **, int *, int *, int *, int)); |
| 798 extern int sort_overlays P_ ((Lisp_Object *, int, struct window *)); | 822 extern int sort_overlays P_ ((Lisp_Object *, int, struct window *)); |
| 799 extern void recenter_overlay_lists P_ ((struct buffer *, int)); | 823 extern void recenter_overlay_lists P_ ((struct buffer *, EMACS_INT)); |
| 800 extern int overlay_strings P_ ((int, struct window *, unsigned char **)); | 824 extern int overlay_strings P_ ((EMACS_INT, struct window *, unsigned char **)); |
| 801 extern void validate_region P_ ((Lisp_Object *, Lisp_Object *)); | 825 extern void validate_region P_ ((Lisp_Object *, Lisp_Object *)); |
| 802 extern void set_buffer_internal P_ ((struct buffer *)); | 826 extern void set_buffer_internal P_ ((struct buffer *)); |
| 803 extern void set_buffer_internal_1 P_ ((struct buffer *)); | 827 extern void set_buffer_internal_1 P_ ((struct buffer *)); |
| 804 extern void set_buffer_temp P_ ((struct buffer *)); | 828 extern void set_buffer_temp P_ ((struct buffer *)); |
| 805 extern void record_buffer P_ ((Lisp_Object)); | 829 extern void record_buffer P_ ((Lisp_Object)); |
| 806 extern void buffer_slot_type_mismatch P_ ((int)); | 830 extern void buffer_slot_type_mismatch P_ ((int)); |
| 807 extern void fix_overlays_before P_ ((struct buffer *, int, int)); | 831 extern void fix_overlays_before P_ ((struct buffer *, EMACS_INT, EMACS_INT)); |
| 808 extern void mmap_set_vars P_ ((int)); | 832 extern void mmap_set_vars P_ ((int)); |
| 833 | |
| 834 /* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. | |
| 835 If NEXTP is non-NULL, return next overlay there. | |
| 836 See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */ | |
| 837 | |
| 838 #define GET_OVERLAYS_AT(posn, overlays, noverlays, nextp, chrq) \ | |
| 839 do { \ | |
| 840 int maxlen = 40; \ | |
| 841 overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \ | |
| 842 noverlays = overlays_at (posn, 0, &overlays, &maxlen, \ | |
| 843 nextp, NULL, chrq); \ | |
| 844 if (noverlays > maxlen) \ | |
| 845 { \ | |
| 846 maxlen = noverlays; \ | |
| 847 overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \ | |
| 848 noverlays = overlays_at (posn, 0, &overlays, &maxlen, \ | |
| 849 nextp, NULL, chrq); \ | |
| 850 } \ | |
| 851 } while (0) | |
| 809 | 852 |
| 810 EXFUN (Fbuffer_name, 1); | 853 EXFUN (Fbuffer_name, 1); |
| 811 EXFUN (Fget_file_buffer, 1); | 854 EXFUN (Fget_file_buffer, 1); |
| 812 EXFUN (Fnext_overlay_change, 1); | 855 EXFUN (Fnext_overlay_change, 1); |
| 813 EXFUN (Fdelete_overlay, 1); | 856 EXFUN (Fdelete_overlay, 1); |
| 814 EXFUN (Fbuffer_local_value, 2); | 857 EXFUN (Fbuffer_local_value, 2); |
| 858 EXFUN (Fgenerate_new_buffer_name, 2); | |
| 815 | 859 |
| 816 /* Functions to call before and after each text change. */ | 860 /* Functions to call before and after each text change. */ |
| 817 extern Lisp_Object Vbefore_change_functions; | 861 extern Lisp_Object Vbefore_change_functions; |
| 818 extern Lisp_Object Vafter_change_functions; | 862 extern Lisp_Object Vafter_change_functions; |
| 819 extern Lisp_Object Vfirst_change_hook; | 863 extern Lisp_Object Vfirst_change_hook; |
| 891 if ((IDX) < 0 || (IDX) >= last_per_buffer_idx) \ | 935 if ((IDX) < 0 || (IDX) >= last_per_buffer_idx) \ |
| 892 abort (); \ | 936 abort (); \ |
| 893 (B)->local_flags[IDX] = (VAL); \ | 937 (B)->local_flags[IDX] = (VAL); \ |
| 894 } while (0) | 938 } while (0) |
| 895 | 939 |
| 896 /* Return the index of the per-buffer variable at offset OFFSET in the | 940 /* Return the index value of the per-buffer variable at offset OFFSET |
| 897 buffer structure. */ | 941 in the buffer structure. |
| 942 | |
| 943 If the slot OFFSET has a corresponding default value in | |
| 944 buffer_defaults, the index value is positive and has only one | |
| 945 nonzero bit. When a buffer has its own local value for a slot, the | |
| 946 bit for that slot (found in the same slot in this structure) is | |
| 947 turned on in the buffer's local_flags array. | |
| 948 | |
| 949 If the index value is -1, even though there may be a | |
| 950 DEFVAR_PER_BUFFER for the slot, there is no default value for it; | |
| 951 and the corresponding slot in buffer_defaults is not used. | |
| 952 | |
| 953 If the index value is -2, then there is no DEFVAR_PER_BUFFER for | |
| 954 the slot, but there is a default value which is copied into each | |
| 955 new buffer. | |
| 956 | |
| 957 If a slot in this structure corresponding to a DEFVAR_PER_BUFFER is | |
| 958 zero, that is a bug */ | |
| 959 | |
| 898 | 960 |
| 899 #define PER_BUFFER_IDX(OFFSET) \ | 961 #define PER_BUFFER_IDX(OFFSET) \ |
| 900 XINT (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_flags)) | 962 XINT (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_flags)) |
| 901 | 963 |
| 902 /* Return the default value of the per-buffer variable at offset | 964 /* Return the default value of the per-buffer variable at offset |
| 920 /* Return the type of the per-buffer variable at offset OFFSET in the | 982 /* Return the type of the per-buffer variable at offset OFFSET in the |
| 921 buffer structure. */ | 983 buffer structure. */ |
| 922 | 984 |
| 923 #define PER_BUFFER_TYPE(OFFSET) \ | 985 #define PER_BUFFER_TYPE(OFFSET) \ |
| 924 (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_types)) | 986 (*(Lisp_Object *)((OFFSET) + (char *) &buffer_local_types)) |
| 987 | |
| 988 /* arch-tag: 679305dd-d41c-4a50-b170-3caf5c97b2d1 | |
| 989 (do not change this comment) */ |
