diff options
| author | Eli Zaretskii | 2012-11-13 16:17:18 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-11-13 16:17:18 +0200 |
| commit | 3c4ca7155293ffc2d04708007131bcbc882d8913 (patch) | |
| tree | 61787be8cd43b6fb3d5159852fbd186eea404de7 /src/buffer.c | |
| parent | 5ade42a5114255c43117065494b96d480c1e1588 (diff) | |
| parent | c708524567662c8911c5ab2695acc7bda0383705 (diff) | |
| download | emacs-3c4ca7155293ffc2d04708007131bcbc882d8913.tar.gz emacs-3c4ca7155293ffc2d04708007131bcbc882d8913.zip | |
Merge from trunk.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/src/buffer.c b/src/buffer.c index 0b3dde27968..619a729a859 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -406,7 +406,6 @@ followed by the rest of the buffers. */) | |||
| 406 | Lisp_Object framelist, prevlist, tail; | 406 | Lisp_Object framelist, prevlist, tail; |
| 407 | Lisp_Object args[3]; | 407 | Lisp_Object args[3]; |
| 408 | 408 | ||
| 409 | CHECK_FRAME (frame); | ||
| 410 | framelist = Fcopy_sequence (XFRAME (frame)->buffer_list); | 409 | framelist = Fcopy_sequence (XFRAME (frame)->buffer_list); |
| 411 | prevlist = Fnreverse (Fcopy_sequence | 410 | prevlist = Fnreverse (Fcopy_sequence |
| 412 | (XFRAME (frame)->buried_buffer_list)); | 411 | (XFRAME (frame)->buried_buffer_list)); |
| @@ -1543,17 +1542,11 @@ list first, followed by the list of all buffers. If no other buffer | |||
| 1543 | exists, return the buffer `*scratch*' (creating it if necessary). */) | 1542 | exists, return the buffer `*scratch*' (creating it if necessary). */) |
| 1544 | (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) | 1543 | (register Lisp_Object buffer, Lisp_Object visible_ok, Lisp_Object frame) |
| 1545 | { | 1544 | { |
| 1546 | Lisp_Object tail, buf, pred; | 1545 | struct frame *f = decode_any_frame (frame); |
| 1547 | Lisp_Object notsogood = Qnil; | 1546 | Lisp_Object tail = f->buffer_list, pred = f->buffer_predicate; |
| 1547 | Lisp_Object buf, notsogood = Qnil; | ||
| 1548 | 1548 | ||
| 1549 | if (NILP (frame)) | ||
| 1550 | frame = selected_frame; | ||
| 1551 | |||
| 1552 | CHECK_FRAME (frame); | ||
| 1553 | |||
| 1554 | pred = frame_buffer_predicate (frame); | ||
| 1555 | /* Consider buffers that have been seen in the frame first. */ | 1549 | /* Consider buffers that have been seen in the frame first. */ |
| 1556 | tail = XFRAME (frame)->buffer_list; | ||
| 1557 | for (; CONSP (tail); tail = XCDR (tail)) | 1550 | for (; CONSP (tail); tail = XCDR (tail)) |
| 1558 | { | 1551 | { |
| 1559 | buf = XCAR (tail); | 1552 | buf = XCAR (tail); |
| @@ -2109,7 +2102,7 @@ set_buffer_internal_1 (register struct buffer *b) | |||
| 2109 | return; | 2102 | return; |
| 2110 | 2103 | ||
| 2111 | BUFFER_CHECK_INDIRECTION (b); | 2104 | BUFFER_CHECK_INDIRECTION (b); |
| 2112 | 2105 | ||
| 2113 | old_buf = current_buffer; | 2106 | old_buf = current_buffer; |
| 2114 | current_buffer = b; | 2107 | current_buffer = b; |
| 2115 | last_known_column_point = -1; /* invalidate indentation cache */ | 2108 | last_known_column_point = -1; /* invalidate indentation cache */ |
| @@ -3139,8 +3132,8 @@ compare_overlays (const void *v1, const void *v2) | |||
| 3139 | between "equal" overlays. The result can still change between | 3132 | between "equal" overlays. The result can still change between |
| 3140 | invocations of Emacs, but it won't change in the middle of | 3133 | invocations of Emacs, but it won't change in the middle of |
| 3141 | `find_field' (bug#6830). */ | 3134 | `find_field' (bug#6830). */ |
| 3142 | if (XHASH (s1->overlay) != XHASH (s2->overlay)) | 3135 | if (!EQ (s1->overlay, s2->overlay)) |
| 3143 | return XHASH (s1->overlay) < XHASH (s2->overlay) ? -1 : 1; | 3136 | return XLI (s1->overlay) < XLI (s2->overlay) ? -1 : 1; |
| 3144 | return 0; | 3137 | return 0; |
| 3145 | } | 3138 | } |
| 3146 | 3139 | ||
| @@ -5112,11 +5105,6 @@ void | |||
| 5112 | init_buffer_once (void) | 5105 | init_buffer_once (void) |
| 5113 | { | 5106 | { |
| 5114 | int idx; | 5107 | int idx; |
| 5115 | /* If you add, remove, or reorder Lisp_Objects in a struct buffer, make | ||
| 5116 | sure that this is still correct. Otherwise, mark_vectorlike may not | ||
| 5117 | trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */ | ||
| 5118 | const int pvecsize | ||
| 5119 | = (offsetof (struct buffer, own_text) - header_size) / word_size; | ||
| 5120 | 5108 | ||
| 5121 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); | 5109 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); |
| 5122 | 5110 | ||
| @@ -5139,8 +5127,8 @@ init_buffer_once (void) | |||
| 5139 | /* This is not strictly necessary, but let's make them initialized. */ | 5127 | /* This is not strictly necessary, but let's make them initialized. */ |
| 5140 | bset_name (&buffer_defaults, build_pure_c_string (" *buffer-defaults*")); | 5128 | bset_name (&buffer_defaults, build_pure_c_string (" *buffer-defaults*")); |
| 5141 | bset_name (&buffer_local_symbols, build_pure_c_string (" *buffer-local-symbols*")); | 5129 | bset_name (&buffer_local_symbols, build_pure_c_string (" *buffer-local-symbols*")); |
| 5142 | XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); | 5130 | BUFFER_PVEC_INIT (&buffer_defaults); |
| 5143 | XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize); | 5131 | BUFFER_PVEC_INIT (&buffer_local_symbols); |
| 5144 | 5132 | ||
| 5145 | /* Set up the default values of various buffer slots. */ | 5133 | /* Set up the default values of various buffer slots. */ |
| 5146 | /* Must do these before making the first buffer! */ | 5134 | /* Must do these before making the first buffer! */ |
| @@ -6210,15 +6198,15 @@ is a member of the list. */); | |||
| 6210 | doc: /* Cursor to use when this buffer is in the selected window. | 6198 | doc: /* Cursor to use when this buffer is in the selected window. |
| 6211 | Values are interpreted as follows: | 6199 | Values are interpreted as follows: |
| 6212 | 6200 | ||
| 6213 | t use the cursor specified for the frame | 6201 | t use the cursor specified for the frame |
| 6214 | nil don't display a cursor | 6202 | nil don't display a cursor |
| 6215 | box display a filled box cursor | 6203 | box display a filled box cursor |
| 6216 | hollow display a hollow box cursor | 6204 | hollow display a hollow box cursor |
| 6217 | bar display a vertical bar cursor with default width | 6205 | bar display a vertical bar cursor with default width |
| 6218 | (bar . WIDTH) display a vertical bar cursor with width WIDTH | 6206 | (bar . WIDTH) display a vertical bar cursor with width WIDTH |
| 6219 | hbar display a horizontal bar cursor with default height | 6207 | hbar display a horizontal bar cursor with default height |
| 6220 | (hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT | 6208 | (hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT |
| 6221 | ANYTHING ELSE display a hollow box cursor | 6209 | ANYTHING ELSE display a hollow box cursor |
| 6222 | 6210 | ||
| 6223 | When the buffer is displayed in a non-selected window, the | 6211 | When the buffer is displayed in a non-selected window, the |
| 6224 | cursor's appearance is instead controlled by the variable | 6212 | cursor's appearance is instead controlled by the variable |