aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2005-02-23 09:18:23 +0000
committerMiles Bader2005-02-23 09:18:23 +0000
commit1ff56495788f79262ed64540eebb81083e571369 (patch)
tree32203951504b9857186ee711b64b1eb87bfa19af /src
parent8d46efcc0f2045a1e5a2739c55ba6a88fbf4bcfc (diff)
parent82a8ad04d22cee5291657f2888c0899c235d3d00 (diff)
downloademacs-1ff56495788f79262ed64540eebb81083e571369.tar.gz
emacs-1ff56495788f79262ed64540eebb81083e571369.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-16
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-106 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-110 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-111 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-112 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-113 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-114 <no summary provided> * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-115 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-123 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-124 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-17 - miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-19 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-20 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-21 More work on moving images to etc/images * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-22 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-23 Fix errors with image-file installation * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-24 etc/Makefile.in (install): Put gnus-tut.txt in the right place. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-25 etc/Makefile.in (install, uninstall): Fix installed image dirs. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-26 etc/Makefile.in (install): Create $(etcdir)/images/gnus dir. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-27 Update from CVS
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit187
-rw-r--r--src/ChangeLog77
-rw-r--r--src/ChangeLog.510
-rw-r--r--src/alloc.c11
-rw-r--r--src/gtkutil.c17
-rw-r--r--src/keymap.h3
-rw-r--r--src/minibuf.c24
-rw-r--r--src/window.c25
-rw-r--r--src/xdisp.c117
-rw-r--r--src/xfaces.c2
10 files changed, 377 insertions, 96 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index e0e8535186e..c3c7e6fd428 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -101,6 +101,193 @@ document ppt
101Print point, beg, end, narrow, and gap for current buffer. 101Print point, beg, end, narrow, and gap for current buffer.
102end 102end
103 103
104# Print out iterator given as first arg
105define pitx
106 set $it = $arg0
107 printf "cur=%d", $it->current.pos.charpos
108 if ($it->current.pos.charpos != $it->current.pos.bytepos)
109 printf "[%d]", $it->current.pos.bytepos
110 end
111 printf " start=%d", $it->start.pos.charpos
112 if ($it->start.pos.charpos != $it->start.pos.bytepos)
113 printf "[%d]", $it->start.pos.bytepos
114 end
115 printf " stop=%d ", $it->stop_charpos
116 output $it->what
117 if ($it->what == IT_CHARACTER)
118 if ($it->len == 1 && $it->c >= ' ' && it->c < 255)
119 printf "['%c']", $it->c
120 else
121 printf "[%d,%d]", $it->c, $it->len
122 end
123 end
124 printf " next="
125 output $it->method
126 printf "\n"
127 printf "vpos=%d hpos=%d", $it->vpos, $it->hpos,
128 printf " y=%d lvy=%d", $it->current_y, $it->last_visible_y
129 printf " x=%d lvx=%d", $it->current_x, $it->last_visible_x
130 printf " a+d=%d+%d=%d", $it->ascent, $it->descent, $it->ascent+$it->descent
131 printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent
132 printf "\n"
133end
134document pitx
135Pretty print a display iterator.
136Take one arg, an iterator object or pointer.
137end
138
139define pit
140 pitx it
141end
142document pit
143Pretty print the display iterator it.
144end
145
146define prowx
147 set $row = $arg0
148 printf "y=%d x=%d pwid=%d", $row->y, $row->x, $row->pixel_width
149 printf " a+d=%d+%d=%d", $row->ascent, $row->height-$row->ascent, $row->height
150 printf " phys=%d+%d=%d", $row->phys_ascent, $row->phys_height-$row->phys_ascent, $row->phys_height
151 printf " vis=%d", $row->visible_height
152 printf " L=%d T=%d R=%d", $row->used[0], $row->used[1], $row->used[2]
153 printf "\n"
154 printf "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos
155 if ($row->enabled_p)
156 printf " ENA"
157 end
158 if ($row->displays_text_p)
159 printf " DISP"
160 end
161 if ($row->mode_line_p)
162 printf " MODEL"
163 end
164 if ($row->continued_p)
165 printf " CONT"
166 end
167 if ($row-> truncated_on_left_p)
168 printf " TRUNC:L"
169 end
170 if ($row-> truncated_on_right_p)
171 printf " TRUNC:R"
172 end
173 if ($row->starts_in_middle_of_char_p)
174 printf " STARTMID"
175 end
176 if ($row->ends_in_middle_of_char_p)
177 printf " ENDMID"
178 end
179 if ($row->ends_in_newline_from_string_p)
180 printf " ENDNLFS"
181 end
182 if ($row->ends_at_zv_p)
183 printf " ENDZV"
184 end
185 if ($row->overlapped_p)
186 printf " OLAPD"
187 end
188 if ($row->overlapping_p)
189 printf " OLAPNG"
190 end
191 printf "\n"
192end
193document prowx
194Pretty print information about glyph_row.
195Takes one argument, a row object or pointer.
196end
197
198define prow
199 prowx row
200end
201document prow
202Pretty print information about glyph_row in row.
203end
204
205
206define pcursorx
207 set $cp = $arg0
208 printf "y=%d x=%d vpos=%d hpos=%d", $cp->y, $cp->x, $cp->vpos, $cp->hpos
209end
210document pcursorx
211Pretty print a window cursor
212end
213
214define pcursor
215 printf "output: "
216 pcursorx output_cursor
217 printf "\n"
218end
219document pcursor
220Pretty print the output_cursor
221end
222
223define pwinx
224 set $w = $arg0
225 xgetint $w->sequence_number
226 if ($w->mini_p != Qnil)
227 printf "Mini "
228 end
229 printf "Window %d ", $int
230 xgetptr $w->buffer
231 set $tem = (struct buffer *) $ptr
232 xgetptr $tem->name
233 printf "%s", ((struct Lisp_String *) $ptr)->data
234 printf "\n"
235 xgetptr $w->start
236 set $tem = (struct Lisp_Marker *) $ptr
237 printf "start=%d end:", $tem->charpos
238 if ($w->window_end_valid != Qnil)
239 xgetint $w->window_end_pos
240 printf "pos=%d", $int
241 xgetint $w->window_end_vpos
242 printf " vpos=%d", $int
243 else
244 printf "invalid"
245 end
246 printf " vscroll=%d", $w->vscroll
247 if ($w->force_start != Qnil)
248 printf " FORCE_START"
249 end
250 if ($w->must_be_updated_p)
251 printf " MUST_UPD"
252 end
253 printf "\n"
254 printf "cursor: "
255 pcursorx $w->cursor
256 printf " phys: "
257 pcursorx $w->phys_cursor
258 if ($w->phys_cursor_on_p)
259 printf " ON"
260 else
261 printf " OFF"
262 end
263 printf " blk="
264 if ($w->last_cursor_off_p != $w->cursor_off_p)
265 if ($w->last_cursor_off_p)
266 printf "ON->"
267 else
268 printf "OFF->"
269 end
270 end
271 if ($w->cursor_off_p)
272 printf "ON"
273 else
274 printf "OFF"
275 end
276 printf "\n"
277end
278document pwinx
279Pretty print a window structure.
280Takes one argument, a pointer to a window structure
281end
282
283define pwin
284 pwinx w
285end
286document pwin
287Pretty print window structure w.
288end
289
290
104define xtype 291define xtype
105 xgettype $ 292 xgettype $
106 output $type 293 output $type
diff --git a/src/ChangeLog b/src/ChangeLog
index 089a3f3a694..d70ccc3d42d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,66 @@
12005-02-22 Kim F. Storm <storm@cua.dk>
2
3 * minibuf.c (Ftry_completion, Fall_completions): Allow both string
4 and symbol keys in alists and hash tables.
5
6 * xdisp.c (fast_find_position): Fix search for start of overlay.
7
82005-02-21 Kim F. Storm <storm@cua.dk>
9
10 * window.c (window_scroll_pixel_based): When scrolling backwards,
11 handle partial visible line at end of window even when we hit PT.
12
132005-02-21 Stefan <monnier@iro.umontreal.ca>
14
15 * keymap.h: Declare Fcurrent_active_maps, used in doc.c.
16
172005-02-21 Kim F. Storm <storm@cua.dk>
18
19 * xdisp.c (move_it_vertically_backward): Eliminate two xasserts.
20 I think those asserts are bogus if buffer contains invisible text
21 or images.
22
232005-02-21 David Kastrup <dak@gnu.org>
24
25 * gtkutil.c (xg_create_frame_widgets): UNBLOCK_INPUT on error.
26
272005-02-20 Kim F. Storm <storm@cua.dk>
28
29 * xdisp.c (pos_visible_p): Be sure to move to the specified
30 position. Always get the full ascent / descent of the
31 corresponding row, to return reliable rtop and rbot values.
32 (back_to_previous_visible_line_start): Fix 2005-01-18 change.
33 Must look one character back, as back_to_previous_line_start
34 returns position after the newline.
35 (move_it_vertically_backward): Fix heuristic for when to move further
36 back in case line_height * 2/3 is larger than window height.
37 (cursor_row_fully_visible_p): Rename make_cursor_line_fully_visible_p
38 as it does not do anything anymore. Add arg current_matrix_p to
39 use current matrix rather than desired matrix when set.
40 (try_cursor_movement): Don't scroll to make cursor row fully
41 visible if cursor didn't move. This avoids unexpected recentering
42 in case of blinking cursor or accepting process output.
43 Use current matrix to check cursor row visibility.
44 (redisplay_window): Fix whether to recenter or move to top in case
45 cursor line is taller than window height.
46 (find_first_unchanged_at_end_row): Stop search if we reach a row
47 which not enabled (instead of abort).
48
492005-02-18 Kim F. Storm <storm@cua.dk>
50
51 * xfaces.c (Finternal_set_lisp_face_attribute): Allow :color property
52 to be nil in a :box attribute value list; customize prints that
53 as lisp value when no box color is specified.
54
55 * .gdbinit (pitx, pit): Pretty print display iterator.
56 (prowx, prow): Pretty print glyph row.
57 (pcursorx, pcursor): Pretty print a window cursor.
58 (pwinx, pwin): Pretty print struct window.
59
602005-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
61
62 * alloc.c (BLOCK_BYTES): Harmless typo.
63
12005-02-17 Andreas Schwab <schwab@suse.de> 642005-02-17 Andreas Schwab <schwab@suse.de>
2 65
3 * xfns.c (hack_wm_protocols): Use correct type for last parameter 66 * xfns.c (hack_wm_protocols): Use correct type for last parameter
@@ -811,13 +874,8 @@
811 (install_window_handler) [TARGET_API_MAC_CARBON]: 874 (install_window_handler) [TARGET_API_MAC_CARBON]:
812 Register handlers for tracking/receiving drag-and-drop items. 875 Register handlers for tracking/receiving drag-and-drop items.
813 (do_ae_open_documents): Generate unibyte strings for filenames. 876 (do_ae_open_documents): Generate unibyte strings for filenames.
814<<<<<<< ChangeLog
815 (mac_do_receive_drag) [TARGET_API_MAC_CARBON] : Likewise.
816 Reject only non-filename items. Set event modifiers and return value.
817=======
818 (mac_do_receive_drag) [TARGET_API_MAC_CARBON] : Likewise. 877 (mac_do_receive_drag) [TARGET_API_MAC_CARBON] : Likewise.
819 Reject only non-filename items. Set event modifiers, and return value. 878 Reject only non-filename items. Set event modifiers, and return value.
820>>>>>>> 1.4187
821 879
8222004-12-28 Dan Nicolaescu <dann@ics.uci.edu> 8802004-12-28 Dan Nicolaescu <dann@ics.uci.edu>
823 881
@@ -927,12 +985,7 @@
927 (x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window 985 (x_make_frame_visible) [TARGET_API_MAC_CARBON]: Reposition window
928 if the position is neither user-specified nor program-specified. 986 if the position is neither user-specified nor program-specified.
929 (x_free_frame_resources): Free size_hints. 987 (x_free_frame_resources): Free size_hints.
930<<<<<<< ChangeLog
931 (x_wm_set_size_hint): Allocate size_hints if needed.
932 Set size_hints.
933=======
934 (x_wm_set_size_hint): Allocate size_hints if needed. Set size_hints. 988 (x_wm_set_size_hint): Allocate size_hints if needed. Set size_hints.
935>>>>>>> 1.4187
936 (mac_clear_font_name_table): New function. 989 (mac_clear_font_name_table): New function.
937 (mac_do_list_fonts): Initialize font_name_table if needed. 990 (mac_do_list_fonts): Initialize font_name_table if needed.
938 (x_list_fonts): Don't initialize font_name_table. Add BLOCK_INPUT 991 (x_list_fonts): Don't initialize font_name_table. Add BLOCK_INPUT
@@ -984,11 +1037,7 @@
984 1037
9852004-12-27 Richard M. Stallman <rms@gnu.org> 10382004-12-27 Richard M. Stallman <rms@gnu.org>
986 1039
987<<<<<<< ChangeLog
988 * buffer.c (Fbuffer_disable_undo): Delete (moved to simple.el).
989=======
990 * buffer.c (Fbuffer_disable_undo): Delete (move to simple.el). 1040 * buffer.c (Fbuffer_disable_undo): Delete (move to simple.el).
991>>>>>>> 1.4187
992 (syms_of_buffer): Don't defsubr it. 1041 (syms_of_buffer): Don't defsubr it.
993 1042
994 * process.c (list_processes_1): Set undo_list instead 1043 * process.c (list_processes_1): Set undo_list instead
diff --git a/src/ChangeLog.5 b/src/ChangeLog.5
index 20fc4887084..5e50066bc78 100644
--- a/src/ChangeLog.5
+++ b/src/ChangeLog.5
@@ -3405,7 +3405,7 @@
3405 (UNISTD_H_INCLUDED): Don't define or test this. 3405 (UNISTD_H_INCLUDED): Don't define or test this.
3406 * m/ibm370aix.h (NEED_UNISTD_H): Defined. 3406 * m/ibm370aix.h (NEED_UNISTD_H): Defined.
3407 * s/aix3-1.h (NEED_UNISTD_H): Defined. 3407 * s/aix3-1.h (NEED_UNISTD_H): Defined.
3408 * s/irix4-0.h (NEED_UNISTD_H): Defined. 3408 * s/irix4-0.h (NEED_UNISTD_H): Define.
3409 3409
3410 * fileio.c (internal_delete_file, internal_delete_file_1): 3410 * fileio.c (internal_delete_file, internal_delete_file_1):
3411 New functions. 3411 New functions.
@@ -3419,7 +3419,7 @@
34191994-11-24 Francesco Potorti` <pot@cnuce.cnr.it> 34191994-11-24 Francesco Potorti` <pot@cnuce.cnr.it>
3420 3420
3421 * m/delta.h (C_SWITCH_MACHINE): -inline-functions removed, 3421 * m/delta.h (C_SWITCH_MACHINE): -inline-functions removed,
3422 because the compiler shipped with R3V7 is not stable. 3422 because the compiler shipped with R3V7 is not stable.
3423 3423
34241994-11-24 Richard Stallman <rms@mole.gnu.ai.mit.edu> 34241994-11-24 Richard Stallman <rms@mole.gnu.ai.mit.edu>
3425 3425
@@ -3443,7 +3443,7 @@
3443 (complete_and_exit_1, complete_and_exit_2): New subroutines. 3443 (complete_and_exit_1, complete_and_exit_2): New subroutines.
3444 3444
3445 * s/aix4.h: New file. 3445 * s/aix4.h: New file.
3446 * s/aix3-1.h (AIXHFT): Defined. 3446 * s/aix3-1.h (AIXHFT): Define.
3447 * m/ibmrs6000.h (OBJECTS_MACHINE): Define only if AIXHFT. 3447 * m/ibmrs6000.h (OBJECTS_MACHINE): Define only if AIXHFT.
3448 3448
3449 * sysdep.c (init_sys_modes): Tes AIXHFT, not AIX. 3449 * sysdep.c (init_sys_modes): Tes AIXHFT, not AIX.
@@ -6451,7 +6451,7 @@
6451 Add an unwind protect to restore original buffer and kill the temp. 6451 Add an unwind protect to restore original buffer and kill the temp.
6452 6452
6453 * sysdep.c (init_system_name): Retry gethostbyname after TRY_AGAIN 6453 * sysdep.c (init_system_name): Retry gethostbyname after TRY_AGAIN
6454 failure. 6454 failure.
6455 6455
6456 * process.c (Fopen_network_stream): 6456 * process.c (Fopen_network_stream):
6457 Retry gethostbyname after TRY_AGAIN failure. 6457 Retry gethostbyname after TRY_AGAIN failure.
@@ -6477,7 +6477,7 @@
6477 6477
6478 * s/linux.h [emacs]: Include stdio.h. 6478 * s/linux.h [emacs]: Include stdio.h.
6479 6479
6480 * commands.h (unread_command_char): Declared. 6480 * commands.h (unread_command_char): Declare.
6481 * dispnew.c (sit_for): Return immediately if unread events exist. 6481 * dispnew.c (sit_for): Return immediately if unread events exist.
6482 6482
64831994-07-17 Richard Stallman (rms@mole.gnu.ai.mit.edu) 64831994-07-17 Richard Stallman (rms@mole.gnu.ai.mit.edu)
diff --git a/src/alloc.c b/src/alloc.c
index 2fac07bdf85..70cf2d7b70e 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,6 +1,6 @@
1/* Storage allocation and gc for GNU Emacs Lisp interpreter. 1/* Storage allocation and gc for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
3 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. 3 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -890,12 +890,13 @@ lisp_free (block)
890 On glibc-2.3.2, malloc never tries to align, so a padding of 0 is best. 890 On glibc-2.3.2, malloc never tries to align, so a padding of 0 is best.
891 posix_memalign on the other hand would ideally prefer a value of 4 891 posix_memalign on the other hand would ideally prefer a value of 4
892 because otherwise, there's 1020 bytes wasted between each ablocks. 892 because otherwise, there's 1020 bytes wasted between each ablocks.
893 But testing shows that those 1020 will most of the time be efficiently 893 In Emacs, testing shows that those 1020 can most of the time be
894 used by malloc to place other objects, so a value of 0 is still preferable 894 efficiently used by malloc to place other objects, so a value of 0 can
895 unless you have a lot of cons&floats and virtually nothing else. */ 895 still preferable unless you have a lot of aligned blocks and virtually
896 nothing else. */
896#define BLOCK_PADDING 0 897#define BLOCK_PADDING 0
897#define BLOCK_BYTES \ 898#define BLOCK_BYTES \
898 (BLOCK_ALIGN - sizeof (struct aligned_block *) - BLOCK_PADDING) 899 (BLOCK_ALIGN - sizeof (struct ablock *) - BLOCK_PADDING)
899 900
900/* Internal data structures and constants. */ 901/* Internal data structures and constants. */
901 902
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6bf0c25f350..c291b44f5a2 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -584,14 +584,14 @@ xg_resize_widgets (f, pixelwidth, pixelheight)
584{ 584{
585 int mbheight = FRAME_MENUBAR_HEIGHT (f); 585 int mbheight = FRAME_MENUBAR_HEIGHT (f);
586 int tbheight = FRAME_TOOLBAR_HEIGHT (f); 586 int tbheight = FRAME_TOOLBAR_HEIGHT (f);
587 int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (pixelheight 587 int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (pixelheight
588 - mbheight - tbheight)); 588 - mbheight - tbheight));
589 int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth); 589 int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
590 590
591 if (FRAME_GTK_WIDGET (f) 591 if (FRAME_GTK_WIDGET (f)
592 && (columns != FRAME_COLS (f) 592 && (columns != FRAME_COLS (f)
593 || rows != FRAME_LINES (f) 593 || rows != FRAME_LINES (f)
594 || pixelwidth != FRAME_PIXEL_WIDTH (f) 594 || pixelwidth != FRAME_PIXEL_WIDTH (f)
595 || pixelheight != FRAME_PIXEL_HEIGHT (f))) 595 || pixelheight != FRAME_PIXEL_HEIGHT (f)))
596 { 596 {
597 struct x_output *x = f->output_data.x; 597 struct x_output *x = f->output_data.x;
@@ -719,6 +719,7 @@ xg_create_frame_widgets (f)
719 if (wvbox) gtk_widget_destroy (wvbox); 719 if (wvbox) gtk_widget_destroy (wvbox);
720 if (wfixed) gtk_widget_destroy (wfixed); 720 if (wfixed) gtk_widget_destroy (wfixed);
721 721
722 UNBLOCK_INPUT;
722 return 0; 723 return 0;
723 } 724 }
724 725
@@ -2881,7 +2882,7 @@ scroll_bar_button_cb (widget, event, user_data)
2881 if (xg_timer) xg_stop_timer (); 2882 if (xg_timer) xg_stop_timer ();
2882 bar->dragging = Qnil; 2883 bar->dragging = Qnil;
2883 } 2884 }
2884 2885
2885 return FALSE; 2886 return FALSE;
2886} 2887}
2887 2888
@@ -2945,7 +2946,7 @@ xg_create_scroll_bar (f, bar, scroll_callback, scroll_bar_name)
2945 event box window. */ 2946 event box window. */
2946 gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), webox, -1, -1); 2947 gtk_fixed_put (GTK_FIXED (f->output_data.x->edit_widget), webox, -1, -1);
2947 gtk_container_add (GTK_CONTAINER (webox), wscroll); 2948 gtk_container_add (GTK_CONTAINER (webox), wscroll);
2948 2949
2949 2950
2950 /* Set the cursor to an arrow. */ 2951 /* Set the cursor to an arrow. */
2951 xg_set_cursor (webox, FRAME_X_DISPLAY_INFO (f)->xg_cursor); 2952 xg_set_cursor (webox, FRAME_X_DISPLAY_INFO (f)->xg_cursor);
@@ -3270,10 +3271,10 @@ xg_tool_bar_item_expose_callback (w, event, client_data)
3270 3271
3271 event->area.x = max (0, event->area.x); 3272 event->area.x = max (0, event->area.x);
3272 event->area.y = max (0, event->area.y); 3273 event->area.y = max (0, event->area.y);
3273 3274
3274 event->area.width = max (width, event->area.width); 3275 event->area.width = max (width, event->area.width);
3275 event->area.height = max (height, event->area.height); 3276 event->area.height = max (height, event->area.height);
3276 3277
3277 return FALSE; 3278 return FALSE;
3278} 3279}
3279 3280
@@ -3394,7 +3395,7 @@ update_frame_tool_bar (f)
3394 DEFAULT_TOOL_BAR_BUTTON_MARGIN has no effect. */ 3395 DEFAULT_TOOL_BAR_BUTTON_MARGIN has no effect. */
3395 hmargin = max (0, hmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN); 3396 hmargin = max (0, hmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN);
3396 vmargin = max (0, vmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN); 3397 vmargin = max (0, vmargin - DEFAULT_TOOL_BAR_BUTTON_MARGIN);
3397 3398
3398 if (! x->toolbar_widget) 3399 if (! x->toolbar_widget)
3399 xg_create_tool_bar (f); 3400 xg_create_tool_bar (f);
3400 3401
diff --git a/src/keymap.h b/src/keymap.h
index e50a62c8aa5..bec39186863 100644
--- a/src/keymap.h
+++ b/src/keymap.h
@@ -1,5 +1,5 @@
1/* Functions to manipulate keymaps. 1/* Functions to manipulate keymaps.
2 Copyright (C) 2001 Free Software Foundation, Inc. 2 Copyright (C) 2001, 2005 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
@@ -33,6 +33,7 @@ EXFUN (Fkey_binding, 3);
33EXFUN (Fkey_description, 2); 33EXFUN (Fkey_description, 2);
34EXFUN (Fsingle_key_description, 2); 34EXFUN (Fsingle_key_description, 2);
35EXFUN (Fwhere_is_internal, 5); 35EXFUN (Fwhere_is_internal, 5);
36EXFUN (Fcurrent_active_maps, 1);
36extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int)); 37extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int));
37extern Lisp_Object get_keyelt P_ ((Lisp_Object, int)); 38extern Lisp_Object get_keyelt P_ ((Lisp_Object, int));
38extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int)); 39extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int));
diff --git a/src/minibuf.c b/src/minibuf.c
index e1939339ce8..329070c5cb3 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1181,13 +1181,16 @@ minibuf_conform_representation (string, basis)
1181DEFUN ("try-completion", Ftry_completion, Stry_completion, 2, 3, 0, 1181DEFUN ("try-completion", Ftry_completion, Stry_completion, 2, 3, 0,
1182 doc: /* Return common substring of all completions of STRING in ALIST. 1182 doc: /* Return common substring of all completions of STRING in ALIST.
1183Each car of each element of ALIST (or each element if it is not a cons cell) 1183Each car of each element of ALIST (or each element if it is not a cons cell)
1184is tested to see if it begins with STRING. 1184is tested to see if it begins with STRING. The possible matches may be
1185strings or symbols. Symbols are converted to strings before testing,
1186see `symbol-name'.
1185All that match are compared together; the longest initial sequence 1187All that match are compared together; the longest initial sequence
1186common to all matches is returned as a string. 1188common to all matches is returned as a string.
1187If there is no match at all, nil is returned. 1189If there is no match at all, nil is returned.
1188For a unique match which is exact, t is returned. 1190For a unique match which is exact, t is returned.
1189 1191
1190If ALIST is a hash-table, all the string keys are the possible matches. 1192If ALIST is a hash-table, all the string and symbol keys are the
1193possible matches.
1191If ALIST is an obarray, the names of all symbols in the obarray 1194If ALIST is an obarray, the names of all symbols in the obarray
1192are the possible matches. 1195are the possible matches.
1193 1196
@@ -1257,7 +1260,7 @@ is used to further constrain the set of candidates. */)
1257 if (!EQ (bucket, zero)) 1260 if (!EQ (bucket, zero))
1258 { 1261 {
1259 elt = bucket; 1262 elt = bucket;
1260 eltstring = Fsymbol_name (elt); 1263 eltstring = elt;
1261 if (XSYMBOL (bucket)->next) 1264 if (XSYMBOL (bucket)->next)
1262 XSETSYMBOL (bucket, XSYMBOL (bucket)->next); 1265 XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
1263 else 1266 else
@@ -1284,6 +1287,9 @@ is used to further constrain the set of candidates. */)
1284 1287
1285 /* Is this element a possible completion? */ 1288 /* Is this element a possible completion? */
1286 1289
1290 if (SYMBOLP (eltstring))
1291 eltstring = Fsymbol_name (eltstring);
1292
1287 if (STRINGP (eltstring) 1293 if (STRINGP (eltstring)
1288 && SCHARS (string) <= SCHARS (eltstring) 1294 && SCHARS (string) <= SCHARS (eltstring)
1289 && (tem = Fcompare_strings (eltstring, zero, 1295 && (tem = Fcompare_strings (eltstring, zero,
@@ -1440,10 +1446,13 @@ is used to further constrain the set of candidates. */)
1440DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 4, 0, 1446DEFUN ("all-completions", Fall_completions, Sall_completions, 2, 4, 0,
1441 doc: /* Search for partial matches to STRING in ALIST. 1447 doc: /* Search for partial matches to STRING in ALIST.
1442Each car of each element of ALIST (or each element if it is not a cons cell) 1448Each car of each element of ALIST (or each element if it is not a cons cell)
1443is tested to see if it begins with STRING. 1449is tested to see if it begins with STRING. The possible matches may be
1450strings or symbols. Symbols are converted to strings before testing,
1451see `symbol-name'.
1444The value is a list of all the strings from ALIST that match. 1452The value is a list of all the strings from ALIST that match.
1445 1453
1446If ALIST is a hash-table, all the string keys are the possible matches. 1454If ALIST is a hash-table, all the string and symbol keys are the
1455possible matches.
1447If ALIST is an obarray, the names of all symbols in the obarray 1456If ALIST is an obarray, the names of all symbols in the obarray
1448are the possible matches. 1457are the possible matches.
1449 1458
@@ -1512,7 +1521,7 @@ are ignored unless STRING itself starts with a space. */)
1512 if (!EQ (bucket, zero)) 1521 if (!EQ (bucket, zero))
1513 { 1522 {
1514 elt = bucket; 1523 elt = bucket;
1515 eltstring = Fsymbol_name (elt); 1524 eltstring = elt;
1516 if (XSYMBOL (bucket)->next) 1525 if (XSYMBOL (bucket)->next)
1517 XSETSYMBOL (bucket, XSYMBOL (bucket)->next); 1526 XSETSYMBOL (bucket, XSYMBOL (bucket)->next);
1518 else 1527 else
@@ -1539,6 +1548,9 @@ are ignored unless STRING itself starts with a space. */)
1539 1548
1540 /* Is this element a possible completion? */ 1549 /* Is this element a possible completion? */
1541 1550
1551 if (SYMBOLP (eltstring))
1552 eltstring = Fsymbol_name (eltstring);
1553
1542 if (STRINGP (eltstring) 1554 if (STRINGP (eltstring)
1543 && SCHARS (string) <= SCHARS (eltstring) 1555 && SCHARS (string) <= SCHARS (eltstring)
1544 /* If HIDE_SPACES, reject alternatives that start with space 1556 /* If HIDE_SPACES, reject alternatives that start with space
diff --git a/src/window.c b/src/window.c
index 370251882ba..be0f47da8d4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -4763,6 +4763,7 @@ window_scroll_pixel_based (window, n, whole, noerror)
4763 else if (n < 0) 4763 else if (n < 0)
4764 { 4764 {
4765 int charpos, bytepos; 4765 int charpos, bytepos;
4766 int partial_p;
4766 4767
4767 /* Save our position, for the preserve_y case. */ 4768 /* Save our position, for the preserve_y case. */
4768 charpos = IT_CHARPOS (it); 4769 charpos = IT_CHARPOS (it);
@@ -4774,7 +4775,20 @@ window_scroll_pixel_based (window, n, whole, noerror)
4774 it.last_visible_y - this_scroll_margin - 1, -1, 4775 it.last_visible_y - this_scroll_margin - 1, -1,
4775 MOVE_TO_POS | MOVE_TO_Y); 4776 MOVE_TO_POS | MOVE_TO_Y);
4776 4777
4777 if (IT_CHARPOS (it) == PT) 4778 /* Save our position, in case it's correct. */
4779 charpos = IT_CHARPOS (it);
4780 bytepos = IT_BYTEPOS (it);
4781
4782 /* See if point is on a partially visible line at the end. */
4783 if (it.what == IT_EOB)
4784 partial_p = it.current_y + it.ascent + it.descent > it.last_visible_y;
4785 else
4786 {
4787 move_it_by_lines (&it, 1, 1);
4788 partial_p = it.current_y > it.last_visible_y;
4789 }
4790
4791 if (charpos == PT && !partial_p)
4778 /* We found PT before we found the display margin, so PT is ok. */ 4792 /* We found PT before we found the display margin, so PT is ok. */
4779 ; 4793 ;
4780 else if (preserve_y >= 0) 4794 else if (preserve_y >= 0)
@@ -4795,14 +4809,7 @@ window_scroll_pixel_based (window, n, whole, noerror)
4795 } 4809 }
4796 else 4810 else
4797 { 4811 {
4798 /* Save our position, in case it's correct. */ 4812 if (partial_p)
4799 charpos = IT_CHARPOS (it);
4800 bytepos = IT_BYTEPOS (it);
4801
4802 /* See if point is on a partially visible line at the end. */
4803 move_it_by_lines (&it, 1, 1);
4804
4805 if (it.current_y > it.last_visible_y)
4806 /* The last line was only partially visible, so back up two 4813 /* The last line was only partially visible, so back up two
4807 lines to make sure we're on a fully visible line. */ 4814 lines to make sure we're on a fully visible line. */
4808 { 4815 {
diff --git a/src/xdisp.c b/src/xdisp.c
index 9aefcf5c9a5..3d3225a6762 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -866,7 +866,7 @@ static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *,
866 Lisp_Object)); 866 Lisp_Object));
867static void extend_face_to_end_of_line P_ ((struct it *)); 867static void extend_face_to_end_of_line P_ ((struct it *));
868static int append_space_for_newline P_ ((struct it *, int)); 868static int append_space_for_newline P_ ((struct it *, int));
869static int make_cursor_line_fully_visible P_ ((struct window *, int)); 869static int cursor_row_fully_visible_p P_ ((struct window *, int, int));
870static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int)); 870static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int));
871static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *)); 871static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *));
872static int trailing_whitespace_p P_ ((int)); 872static int trailing_whitespace_p P_ ((int));
@@ -1288,8 +1288,8 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
1288 } 1288 }
1289 1289
1290 start_display (&it, w, top); 1290 start_display (&it, w, top);
1291 move_it_to (&it, charpos, 0, it.last_visible_y, -1, 1291 move_it_to (&it, charpos, -1, it.last_visible_y, -1,
1292 MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); 1292 MOVE_TO_POS | MOVE_TO_Y);
1293 1293
1294 /* Note that we may overshoot because of invisible text. */ 1294 /* Note that we may overshoot because of invisible text. */
1295 if (IT_CHARPOS (it) >= charpos) 1295 if (IT_CHARPOS (it) >= charpos)
@@ -1313,12 +1313,13 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
1313 } 1313 }
1314 } 1314 }
1315 } 1315 }
1316 else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y) 1316 else
1317 { 1317 {
1318 struct it it2; 1318 struct it it2;
1319 1319
1320 it2 = it; 1320 it2 = it;
1321 move_it_by_lines (&it, 1, 0); 1321 if (IT_CHARPOS (it) < ZV && FETCH_BYTE (IT_BYTEPOS (it)) != '\n')
1322 move_it_by_lines (&it, 1, 0);
1322 if (charpos < IT_CHARPOS (it)) 1323 if (charpos < IT_CHARPOS (it))
1323 { 1324 {
1324 visible_p = 1; 1325 visible_p = 1;
@@ -1329,8 +1330,9 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, exact_mode_line_heights_p)
1329 *y = it2.current_y + it2.max_ascent - it2.ascent; 1330 *y = it2.current_y + it2.max_ascent - it2.ascent;
1330 if (rtop) 1331 if (rtop)
1331 { 1332 {
1332 *rtop = 0; 1333 *rtop = max (0, -it2.current_y);
1333 *rbot = max (0, (it2.current_y + it2.max_ascent + it2.max_descent) - it.last_visible_y); 1334 *rbot = max (0, ((it2.current_y + it2.max_ascent + it2.max_descent)
1335 - it.last_visible_y));
1334 } 1336 }
1335 } 1337 }
1336 } 1338 }
@@ -4793,27 +4795,31 @@ back_to_previous_visible_line_start (it)
4793 /* If newline has a display property that replaces the newline with something 4795 /* If newline has a display property that replaces the newline with something
4794 else (image or text), find start of overlay or interval and continue search 4796 else (image or text), find start of overlay or interval and continue search
4795 from that point. */ 4797 from that point. */
4796 { 4798 if (IT_CHARPOS (*it) > BEGV)
4797 struct it it2 = *it; 4799 {
4798 int pos = IT_CHARPOS (*it); 4800 struct it it2 = *it;
4799 int beg, end; 4801 int pos;
4800 Lisp_Object val, overlay; 4802 int beg, end;
4801 4803 Lisp_Object val, overlay;
4802 it2.sp = 0; 4804
4803 if (handle_display_prop (&it2) == HANDLED_RETURN 4805 pos = --IT_CHARPOS (it2);
4804 && !NILP (val = get_char_property_and_overlay 4806 --IT_BYTEPOS (it2);
4805 (make_number (pos), Qdisplay, Qnil, &overlay)) 4807 it2.sp = 0;
4806 && (OVERLAYP (overlay) 4808 if (handle_display_prop (&it2) == HANDLED_RETURN
4807 ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay))) 4809 && !NILP (val = get_char_property_and_overlay
4808 : get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil))) 4810 (make_number (pos), Qdisplay, Qnil, &overlay))
4809 { 4811 && (OVERLAYP (overlay)
4810 if (beg < BEGV) 4812 ? (beg = OVERLAY_POSITION (OVERLAY_START (overlay)))
4811 beg = BEGV; 4813 : get_property_and_range (pos, Qdisplay, &val, &beg, &end, Qnil)))
4812 IT_CHARPOS (*it) = beg; 4814 {
4813 IT_BYTEPOS (*it) = buf_charpos_to_bytepos (current_buffer, beg); 4815 if (beg < BEGV)
4814 continue; 4816 beg = BEGV;
4815 } 4817 IT_CHARPOS (*it) = beg;
4816 } 4818 IT_BYTEPOS (*it) = buf_charpos_to_bytepos (current_buffer, beg);
4819 continue;
4820 }
4821 }
4822
4817 break; 4823 break;
4818 } 4824 }
4819 4825
@@ -6424,7 +6430,11 @@ move_it_vertically_backward (it, dy)
6424 value of nlines is > 0 if continuation lines were involved. */ 6430 value of nlines is > 0 if continuation lines were involved. */
6425 if (nlines > 0) 6431 if (nlines > 0)
6426 move_it_by_lines (it, nlines, 1); 6432 move_it_by_lines (it, nlines, 1);
6433#if 0
6434 /* I think this assert is bogus if buffer contains
6435 invisible text or images. KFS. */
6427 xassert (IT_CHARPOS (*it) <= start_pos); 6436 xassert (IT_CHARPOS (*it) <= start_pos);
6437#endif
6428 } 6438 }
6429 else 6439 else
6430 { 6440 {
@@ -6442,7 +6452,8 @@ move_it_vertically_backward (it, dy)
6442 a line height of 13 pixels each, recentering with point 6452 a line height of 13 pixels each, recentering with point
6443 on the bottom line will try to move -39/2 = 19 pixels 6453 on the bottom line will try to move -39/2 = 19 pixels
6444 backward. Try to avoid moving into the first line. */ 6454 backward. Try to avoid moving into the first line. */
6445 && it->current_y - target_y > line_height * 2 / 3 6455 && (it->current_y - target_y
6456 > min (window_box_height (it->w), line_height * 2 / 3))
6446 && IT_CHARPOS (*it) > BEGV) 6457 && IT_CHARPOS (*it) > BEGV)
6447 { 6458 {
6448 TRACE_MOVE ((stderr, " not far enough -> move_vert %d\n", 6459 TRACE_MOVE ((stderr, " not far enough -> move_vert %d\n",
@@ -6472,7 +6483,11 @@ move_it_vertically_backward (it, dy)
6472 while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV); 6483 while (target_y >= line_bottom_y (it) && IT_CHARPOS (*it) < ZV);
6473 } 6484 }
6474 6485
6486#if 0
6487 /* I think this assert is bogus if buffer contains
6488 invisible text or images. KFS. */
6475 xassert (IT_CHARPOS (*it) >= BEGV); 6489 xassert (IT_CHARPOS (*it) >= BEGV);
6490#endif
6476 } 6491 }
6477 } 6492 }
6478} 6493}
@@ -11191,7 +11206,7 @@ run_window_scroll_functions (window, startp)
11191 as if point had gone off the screen. */ 11206 as if point had gone off the screen. */
11192 11207
11193static int 11208static int
11194make_cursor_line_fully_visible (w, force_p) 11209cursor_row_fully_visible_p (w, force_p, current_matrix_p)
11195 struct window *w; 11210 struct window *w;
11196 int force_p; 11211 int force_p;
11197{ 11212{
@@ -11207,7 +11222,7 @@ make_cursor_line_fully_visible (w, force_p)
11207 if (w->cursor.vpos < 0) 11222 if (w->cursor.vpos < 0)
11208 return 1; 11223 return 1;
11209 11224
11210 matrix = w->desired_matrix; 11225 matrix = current_matrix_p ? w->current_matrix : w->desired_matrix;
11211 row = MATRIX_ROW (matrix, w->cursor.vpos); 11226 row = MATRIX_ROW (matrix, w->cursor.vpos);
11212 11227
11213 /* If the cursor row is not partially visible, there's nothing to do. */ 11228 /* If the cursor row is not partially visible, there's nothing to do. */
@@ -11512,7 +11527,7 @@ try_scrolling (window, just_this_one_p, scroll_conservatively,
11512 11527
11513 /* If cursor ends up on a partially visible line, 11528 /* If cursor ends up on a partially visible line,
11514 treat that as being off the bottom of the screen. */ 11529 treat that as being off the bottom of the screen. */
11515 if (! make_cursor_line_fully_visible (w, extra_scroll_margin_lines <= 1)) 11530 if (! cursor_row_fully_visible_p (w, extra_scroll_margin_lines <= 1, 0))
11516 { 11531 {
11517 clear_glyph_matrix (w->desired_matrix); 11532 clear_glyph_matrix (w->desired_matrix);
11518 ++extra_scroll_margin_lines; 11533 ++extra_scroll_margin_lines;
@@ -11782,6 +11797,12 @@ try_cursor_movement (window, startp, scroll_step)
11782 && CHARPOS (startp) != BEGV) 11797 && CHARPOS (startp) != BEGV)
11783 scroll_p = 1; 11798 scroll_p = 1;
11784 } 11799 }
11800 else
11801 {
11802 /* Cursor did not move. So don't scroll even if cursor line
11803 is partially visible, as it was so before. */
11804 rc = CURSOR_MOVEMENT_SUCCESS;
11805 }
11785 11806
11786 if (PT < MATRIX_ROW_START_CHARPOS (row) 11807 if (PT < MATRIX_ROW_START_CHARPOS (row)
11787 || PT > MATRIX_ROW_END_CHARPOS (row)) 11808 || PT > MATRIX_ROW_END_CHARPOS (row))
@@ -11789,7 +11810,8 @@ try_cursor_movement (window, startp, scroll_step)
11789 /* if PT is not in the glyph row, give up. */ 11810 /* if PT is not in the glyph row, give up. */
11790 rc = CURSOR_MOVEMENT_MUST_SCROLL; 11811 rc = CURSOR_MOVEMENT_MUST_SCROLL;
11791 } 11812 }
11792 else if (MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row) 11813 else if (rc != CURSOR_MOVEMENT_SUCCESS
11814 && MATRIX_ROW_PARTIALLY_VISIBLE_P (w, row)
11793 && make_cursor_line_fully_visible_p) 11815 && make_cursor_line_fully_visible_p)
11794 { 11816 {
11795 if (PT == MATRIX_ROW_END_CHARPOS (row) 11817 if (PT == MATRIX_ROW_END_CHARPOS (row)
@@ -11808,7 +11830,7 @@ try_cursor_movement (window, startp, scroll_step)
11808 else 11830 else
11809 { 11831 {
11810 set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); 11832 set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0);
11811 if (!make_cursor_line_fully_visible (w, 0)) 11833 if (!cursor_row_fully_visible_p (w, 0, 1))
11812 rc = CURSOR_MOVEMENT_MUST_SCROLL; 11834 rc = CURSOR_MOVEMENT_MUST_SCROLL;
11813 else 11835 else
11814 rc = CURSOR_MOVEMENT_SUCCESS; 11836 rc = CURSOR_MOVEMENT_SUCCESS;
@@ -11893,7 +11915,7 @@ redisplay_window (window, just_this_one_p)
11893 int temp_scroll_step = 0; 11915 int temp_scroll_step = 0;
11894 int count = SPECPDL_INDEX (); 11916 int count = SPECPDL_INDEX ();
11895 int rc; 11917 int rc;
11896 int centering_position; 11918 int centering_position = -1;
11897 int last_line_misfit = 0; 11919 int last_line_misfit = 0;
11898 11920
11899 SET_TEXT_POS (lpoint, PT, PT_BYTE); 11921 SET_TEXT_POS (lpoint, PT, PT_BYTE);
@@ -12139,7 +12161,7 @@ redisplay_window (window, just_this_one_p)
12139 new_vpos = window_box_height (w) / 2; 12161 new_vpos = window_box_height (w) / 2;
12140 } 12162 }
12141 12163
12142 if (!make_cursor_line_fully_visible (w, 0)) 12164 if (!cursor_row_fully_visible_p (w, 0, 0))
12143 { 12165 {
12144 /* Point does appear, but on a line partly visible at end of window. 12166 /* Point does appear, but on a line partly visible at end of window.
12145 Move it back to a fully-visible line. */ 12167 Move it back to a fully-visible line. */
@@ -12276,7 +12298,7 @@ redisplay_window (window, just_this_one_p)
12276 /* Forget any recorded base line for line number display. */ 12298 /* Forget any recorded base line for line number display. */
12277 w->base_line_number = Qnil; 12299 w->base_line_number = Qnil;
12278 12300
12279 if (!make_cursor_line_fully_visible (w, 1)) 12301 if (!cursor_row_fully_visible_p (w, 1, 0))
12280 { 12302 {
12281 clear_glyph_matrix (w->desired_matrix); 12303 clear_glyph_matrix (w->desired_matrix);
12282 last_line_misfit = 1; 12304 last_line_misfit = 1;
@@ -12336,10 +12358,8 @@ redisplay_window (window, just_this_one_p)
12336 /* Finally, just choose place to start which centers point */ 12358 /* Finally, just choose place to start which centers point */
12337 12359
12338 recenter: 12360 recenter:
12339 centering_position = window_box_height (w) / 2; 12361 if (centering_position < 0)
12340 12362 centering_position = window_box_height (w) / 2;
12341 point_at_top:
12342 /* Jump here with centering_position already set to 0. */
12343 12363
12344#if GLYPH_DEBUG 12364#if GLYPH_DEBUG
12345 debug_method_add (w, "recenter"); 12365 debug_method_add (w, "recenter");
@@ -12436,7 +12456,7 @@ redisplay_window (window, just_this_one_p)
12436 set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0); 12456 set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0);
12437 } 12457 }
12438 12458
12439 if (!make_cursor_line_fully_visible (w, centering_position > 0)) 12459 if (!cursor_row_fully_visible_p (w, 0, 0))
12440 { 12460 {
12441 /* If vscroll is enabled, disable it and try again. */ 12461 /* If vscroll is enabled, disable it and try again. */
12442 if (w->vscroll) 12462 if (w->vscroll)
@@ -12451,9 +12471,10 @@ redisplay_window (window, just_this_one_p)
12451 visible, if it can be done. */ 12471 visible, if it can be done. */
12452 if (centering_position == 0) 12472 if (centering_position == 0)
12453 goto done; 12473 goto done;
12474
12454 clear_glyph_matrix (w->desired_matrix); 12475 clear_glyph_matrix (w->desired_matrix);
12455 centering_position = 0; 12476 centering_position = 0;
12456 goto point_at_top; 12477 goto recenter;
12457 } 12478 }
12458 12479
12459 done: 12480 done:
@@ -13238,8 +13259,10 @@ find_first_unchanged_at_end_row (w, delta, delta_bytes)
13238 starts at a minimum position >= last_unchanged_pos_old. */ 13259 starts at a minimum position >= last_unchanged_pos_old. */
13239 for (; row > first_text_row; --row) 13260 for (; row > first_text_row; --row)
13240 { 13261 {
13262 /* This used to abort, but it can happen.
13263 It is ok to just stop the search instead here. KFS. */
13241 if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row)) 13264 if (!row->enabled_p || !MATRIX_ROW_DISPLAYS_TEXT_P (row))
13242 abort (); 13265 break;
13243 13266
13244 if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old) 13267 if (MATRIX_ROW_START_CHARPOS (row) >= last_unchanged_pos_old)
13245 row_found = row; 13268 row_found = row;
@@ -20901,7 +20924,7 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop)
20901 have a STOP object and previous row's end glyph came from STOP. */ 20924 have a STOP object and previous row's end glyph came from STOP. */
20902 if (!NILP (stop)) 20925 if (!NILP (stop))
20903 { 20926 {
20904 struct glyph_row *prev = row-1; 20927 struct glyph_row *prev;
20905 while ((prev = row - 1, prev >= first) 20928 while ((prev = row - 1, prev >= first)
20906 && MATRIX_ROW_END_CHARPOS (prev) == charpos 20929 && MATRIX_ROW_END_CHARPOS (prev) == charpos
20907 && prev->used[TEXT_AREA] > 0) 20930 && prev->used[TEXT_AREA] > 0)
@@ -20910,8 +20933,8 @@ fast_find_position (w, charpos, hpos, vpos, x, y, stop)
20910 glyph = end + prev->used[TEXT_AREA]; 20933 glyph = end + prev->used[TEXT_AREA];
20911 while (--glyph >= end 20934 while (--glyph >= end
20912 && INTEGERP (glyph->object)); 20935 && INTEGERP (glyph->object));
20913 if (glyph >= end 20936 if (glyph < end
20914 && !EQ (stop, glyph->object)) 20937 || !EQ (stop, glyph->object))
20915 break; 20938 break;
20916 row = prev; 20939 row = prev;
20917 } 20940 }
diff --git a/src/xfaces.c b/src/xfaces.c
index 29b342a8f1e..d9c2185e767 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -4227,7 +4227,7 @@ FRAME 0 means change the face on all frames, and change the default
4227 } 4227 }
4228 else if (EQ (k, QCcolor)) 4228 else if (EQ (k, QCcolor))
4229 { 4229 {
4230 if (!STRINGP (v) || SCHARS (v) == 0) 4230 if (!NILP (v) && (!STRINGP (v) || SCHARS (v) == 0))
4231 break; 4231 break;
4232 } 4232 }
4233 else if (EQ (k, QCstyle)) 4233 else if (EQ (k, QCstyle))