aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit20
-rw-r--r--src/ChangeLog183
-rw-r--r--src/Makefile.in2
-rw-r--r--src/callproc.c16
-rw-r--r--src/config.in15
-rw-r--r--src/dispextern.h6
-rw-r--r--src/doc.c6
-rw-r--r--src/fringe.c45
-rw-r--r--src/keyboard.c35
-rw-r--r--src/keyboard.h2
-rw-r--r--src/keymap.c3
-rw-r--r--src/mac.c48
-rw-r--r--src/macfns.c41
-rw-r--r--src/macgui.h2
-rw-r--r--src/macmenu.c4
-rw-r--r--src/macterm.c337
-rw-r--r--src/textprop.c6
-rw-r--r--src/unexmacosx.c5
-rw-r--r--src/w32term.c5
-rw-r--r--src/window.c15
-rw-r--r--src/xdisp.c19
-rw-r--r--src/xfns.c2
-rw-r--r--src/xterm.c53
-rw-r--r--src/xterm.h2
24 files changed, 585 insertions, 287 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 943481d419..adf2ccbf5f 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -60,6 +60,16 @@ Print the emacs s-expression which is $.
Works only when an inferior emacs is executing.
end
+# Print out s-expressions
+define pp
+ set $tmp = $arg0
+ set debug_print ($tmp)
+end
+document pp
+Print the argument as an emacs s-expression
+Works only when an inferior emacs is executing.
+end
+
define xtype
xgettype $
output $type
@@ -452,6 +462,16 @@ document xreload
end
xreload
+# Flush display (X only)
+define ff
+ set x_flush (0)
+end
+document ff
+Flush pending X window display updates to screen.
+Works only when an inferior emacs is executing.
+end
+
+
define hook-run
xreload
end
diff --git a/src/ChangeLog b/src/ChangeLog
index e58ddb7428..9fedb52f42 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,157 @@
+2004-10-14 Kim F. Storm <[email protected]>
+
+ * xterm.h: Include Xutil.h after keysym.h to work around bug
+ (incorrectly recognising AltGr key) in some X versions.
+
+2004-10-13 Stefan Monnier <[email protected]>
+
+ * keymap.c (get_keymap): An autoload form is not a keymap.
+
+ * textprop.c (syms_of_textprop): Make `syntax-table' nonsticky.
+
+2004-10-13 Kim F. Storm <[email protected]>
+
+ * callproc.c (Fcall_process): Simplify handling of display arg.
+ Resume `display_on_the_fly' once a coding system is determined.
+
+ * xdisp.c (redisplay_preserve_echo_area): Fix last change.
+
+2004-10-12 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_preserve_echo_area): Flush display in case
+ caller, such as call-process, is not going to poll for input.
+ (calc_line_height_property): Handle case where it->object is nil.
+
+ * xterm.c (x_redisplay_interface): Fix flush_display_optional.
+
+2004-10-12 Kenichi Handa <[email protected]>
+
+ * xdisp.c (get_next_display_element):
+ If unibyte_display_via_language_environment is zero, display 8-bit
+ chars in octal in unibyte buffer.
+
+2004-10-12 Kim F. Storm <[email protected]>
+
+ * doc.c (Fsubstitute_command_keys): Ignore remappings unless there
+ are no ordinary bindings.
+
+2004-10-11 Jan Dj,Ad(Brv <[email protected]>
+
+ * xfns.c (syms_of_xfns): Defsubr x-file-dialog for GTK also.
+
+2004-10-10 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macterm.c (x_raise_frame): Add BLOCK_INPUT around SelectWindow.
+ (x_lower_frame): Add BLOCK_INPUT around SendBehind.
+ (make_mac_frame): Add BLOCK_INPUT around the making of a
+ terminal frame.
+ (mac_initialize): Add BLOCK_INPUT around carbon initialization.
+ * macgui.h (mktime): Use emacs_mktime.
+ * macfns.c (Fx_file_dialog): Add BLOCK_INPUT around more code.
+ Make a cancel file-open dialog be like C-g.
+ * mac.c (mktime): Use emacs_mktime.
+ (Fdo_applescript): Add BLOCK_INPUT around do_applescript.
+ (Fmac_paste_function): Add better error handling for carbon cut/paste.
+
+2004-10-10 Kim F. Storm <[email protected]>
+
+ * keyboard.c (timer_resume_idle): New function to resume idle
+ timer without resetting timers on the idle list.
+ (read_char): Use timer_resume_idle. Remove local var last_idle_start.
+ (timer_start_idle, timer_stop_idle): Declare static.
+ (read_key_sequence): Use timer_resume_idle instead of timer_start_idle.
+
+ * keyboard.h (timer_start_idle, timer_stop_idle): Remove prototypes.
+
+2004-10-08 Steven Tamm <[email protected]>
+
+ * config.in (HAVE_MALLOC_MALLOC_H): Regenerate.
+ * macterm.c (mac_check_for_quit_char): Remove warning for using
+ NULL where 0 should be used.
+ * unexmacosx.c: Use malloc/malloc.h on Tiger instead of
+ objc/malloc.h
+ * mac.c: Include time.h for Tiger compatibility.
+
+2004-10-07 Kim F. Storm <[email protected]>
+
+ * xdisp.c (redisplay_window): Fix flicker on vertical line between
+ windows. Update vertical line after drawing window fringes, but
+ only if actually drawing any bitmaps--or there is no fringe.
+
+ * xterm.c (x_update_window_end): Likewise.
+ * macterm.c (x_update_window_end): Likewise.
+ * w32term.c (x_update_window_end): Likewise.
+
+ * fringe.c (draw_window_fringes): Return value now indicates if
+ any fringe bitmaps were redrawn (or there are no fringes).
+
+ * dispextern.h (draw_window_fringes): Update prototype.
+
+2004-10-06 YAMAMOTO Mitsuharu <[email protected]>
+
+ * macfns.c (mac_get_window_bounds): Add extern.
+ (x_real_positions): Use mac_get_window_bounds.
+
+ * macmenu.c (update_submenu_strings): Apply 2004-09-07 change for
+ xmenu.c (YAILOM).
+
+ * macterm.c [!MAC_OSX]: Include Windows.h.
+ (front_emacs_window): Rename from mac_front_window. All uses
+ changed. Return the frontmost non-tooltip emacs window.
+ (mac_get_window_bounds): New function.
+ (x_calc_absolute_position): Use the difference of width and height
+ between the inner and outer window.
+ (x_set_offset): Specify window position by the coordinae of the
+ outer window. Adjust the position if the title bar is completely
+ outside the screen.
+ (app_is_suspended, app_sleep_time): Remove unused variables.
+ (do_app_resume, do_app_suspend): Remove their contents because
+ window-activate/deactivate events will do the job.
+ (do_zoom_window): Remove unused variables. Make compliant to the
+ standard way of zooming. Set f->left_pos and f->top_pos.
+ (XTread_socket): Don't use argument `expected'. Don't use
+ FrontWindow to determine the clicked window. Exclude unprocessed
+ mouseUp cases in the early stage. Add parentheses to fix operator
+ precedence.
+ (XTread_socket) [TARGET_API_MAC_CARBON]: Don't specify drag area.
+
+
+2004-10-05 Jan Dj,Ad(Brv. <[email protected]>
+
+ * config.in: Regenerate.
+
+ * Makefile.in (RUN_TEMACS): Check HAVE_RANDOM_HEAPSTART instead of
+ HAVE_EXECSHIELD.
+
+2004-10-05 Jan Dj,Ad(Brv <[email protected]>
+
+ * xterm.c (x_find_modifier_meanings): Ignore any Super or Hyper for
+ a row if Alt or Meta has been found for that row. Also stop scanning
+ for Keysyms for that row.
+
+2004-10-04 Kim F. Storm <[email protected]>
+
+ * fringe.c (Ffringe_bitmaps_at_pos): Change return value from cons
+ to list. Include overlay arrow bitmap in return value.
+
+ * xterm.c (XTset_vertical_scroll_bar): Improve handling of scroll
+ bars with fractional column width. If scroll bar separates two
+ windows, move it towards the window it belongs to. Only update
+ the padding area below the scroll bar widget when necessary,
+ i.e. when scroll bar widget is created, moved, or resized.
+
+ * xdisp.c (define_frame_cursor1): Do not change frame cursor
+ while tracking/dragging mouse.
+ (x_draw_vertical_border): Do not draw line if frame has scroll bars.
+
+ * window.c (coordinates_in_window): Relax check for cursor
+ on vertial border between mode lines.
+ (Fset_window_fringes): Do not allow negative widths.
+ (Fset_window_scroll_bars): Likewise.
+
+ * .gdbinit (pp): Shorthand for p ARG + pr.
+ (ff): New command: flush frame updates (X only).
+
2004-10-03 Michael Albinus <[email protected]>
* fileio.c (auto_save_1) Call Ffile_modes for remote files.
@@ -62,8 +216,8 @@
Change arg to Lisp_Object and fail if not an integer.
(get_fringe_bitmap_name, resolve_fringe_bitmap)
(destroy_fringe_bitmap): New functions.
- (Fdestroy_fringe_bitmap): Change arg to bitmap symbol. Use
- destroy_fringe_bitmap. Remove symbol from Vfringe_bitmaps and
+ (Fdestroy_fringe_bitmap): Change arg to bitmap symbol.
+ Use destroy_fringe_bitmap. Remove symbol from Vfringe_bitmaps and
clear its fringe property.
(init_fringe_bitmap): Use destroy_fringe_bitmap instead of
Fdestroy_fringe_bitmap.
@@ -88,7 +242,7 @@
2004-09-25 Jan Dj,Ad(Brv <[email protected]>
- * config.in: Rebuild
+ * config.in: Rebuild.
2004-09-24 Jan Dj,Ad(Brv <[email protected]>
@@ -108,7 +262,7 @@
Handle the case where we reach the old displayed text,
out of sync with the old line boundary.
-2004-09-14 Stefan <[email protected]>
+2004-09-14 Stefan Monnier <[email protected]>
* fileio.c (Finsert_file_contents): Fix case of replacement in a
narrowed buffer.
@@ -130,7 +284,7 @@
(Fbyte_code): Remove dead code after `wrong_type_argument'.
* alloc.c (Fgarbage_collect): Mark keyboards, gtk data, and specpdl
- before doing the mark_stack_check_gcpros since they are not on the stack.
+ before doing the mark_stack_check_gcpros since they're not on the stack.
2004-09-12 Kim F. Storm <[email protected]>
@@ -149,8 +303,7 @@
blockinput.h.
(dosfns.o): Depend on blockinput.h, window.h, dispextern.h,
charset.h, and coding.h
- (w16select.o): Depend on buffer.h, charset.h, coding.h, and
- composite.h.
+ (w16select.o): Depend on buffer.h, charset.h, coding.h, and composite.h.
(term.o): Depend on window.h and keymap.h.
(abbrev.o): Depend on syntax.h.
(callint.o): Depend on keymap.h.
@@ -183,8 +336,8 @@
(lread.o): Depend on $(INTERVALS_SRC), termhooks.h, and coding.h.
(intervals.o): Depend on keymap.h.
- * msdos.c (msdos_set_cursor_shape, IT_display_cursor): Add
- debugging print-out to termscript.
+ * msdos.c (msdos_set_cursor_shape, IT_display_cursor):
+ Add debugging print-out to termscript.
2004-09-09 Richard M. Stallman <[email protected]>
@@ -210,8 +363,8 @@
2004-09-07 Luc Teirlinck <[email protected]>
* buffer.h (struct buffer): Add auto_save_file_format field.
- * buffer.c (reset_buffer, init_buffer_once): Handle
- auto_save_file_format field.
+ * buffer.c (reset_buffer, init_buffer_once):
+ Handle auto_save_file_format field.
(syms_of_buffer): Add DEFVAR_PER_BUFFER for
`buffer-auto-save-file-format'.
* fileio.c: Delete declaration for removed Vauto_save_file_format.
@@ -224,15 +377,15 @@
* w32term.h (AppendMenuW_Proc): Move declaration from w32menu.c.
- * w32fns.c (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
- Unicode menu titles.
+ * w32fns.c (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]:
+ Handle Unicode menu titles.
2004-09-07 Kim F. Storm <[email protected]>
* xdisp.c (set_cursor_from_row): Fix last change. Only use 'cursor'
property from text property or overlay strings at point.
-2004-09-07 Stefan <[email protected]>
+2004-09-07 Stefan Monnier <[email protected]>
* xmenu.c (update_submenu_strings): YAILOM.
(set_frame_menubar): Make sure last_i is initialized.
@@ -721,7 +874,7 @@
* w32select.c (Fw32_set_clipboard_data): Update `nbytes' correctly
after getting a new string by pre-write-conversion.
-2004-06-30 Stefan <[email protected]>
+2004-06-30 Stefan Monnier <[email protected]>
* xterm.c (x_detect_focus_change): Remove unused var `nr_events'.
(x_calc_absolute_position): Remove unused var `child'.
diff --git a/src/Makefile.in b/src/Makefile.in
index 950564f8fa..08504dcf72 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -887,7 +887,7 @@ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \
#define OBJECTS_MACHINE
#endif
-#ifdef HAVE_EXECSHIELD
+#ifdef HAVE_RANDOM_HEAPSTART
#undef i386
RUN_TEMACS = @SETARCH@ i386 ./temacs
#else
diff --git a/src/callproc.c b/src/callproc.c
index 7632d49194..d9f9a34257 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -216,7 +216,8 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
int nargs;
register Lisp_Object *args;
{
- Lisp_Object infile, buffer, current_dir, display, path;
+ Lisp_Object infile, buffer, current_dir, path;
+ int display_p;
int fd[2];
int filefd;
register int pid;
@@ -372,7 +373,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
UNGCPRO;
}
- display = nargs >= 4 ? args[3] : Qnil;
+ display_p = INTERACTIVE && nargs >= 4 && !NILP (args[3]);
filefd = emacs_open (SDATA (infile), O_RDONLY, 0);
if (filefd < 0)
@@ -739,7 +740,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
int first = 1;
int total_read = 0;
int carryover = 0;
- int display_on_the_fly = !NILP (display) && INTERACTIVE;
+ int display_on_the_fly = display_p;
struct coding_system saved_coding;
saved_coding = process_coding;
@@ -803,6 +804,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
display_on_the_fly = 0;
process_coding = saved_coding;
carryover = nread;
+ /* This is to make the above condition always
+ fails in the future. */
+ saved_coding.type = coding_type_no_conversion;
continue;
}
@@ -832,12 +836,16 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
bufptr = tempptr;
}
- if (!NILP (display) && INTERACTIVE)
+ if (display_p)
{
if (first)
prepare_menu_bars ();
first = 0;
redisplay_preserve_echo_area (1);
+ /* This variable might have been set to 0 for code
+ detection. In that case, we set it back to 1 because
+ we should have already detected a coding system. */
+ display_on_the_fly = 1;
}
immediate_quit = 1;
QUIT;
diff --git a/src/config.in b/src/config.in
index d87d235fe5..49095ca4e5 100644
--- a/src/config.in
+++ b/src/config.in
@@ -136,9 +136,6 @@ Boston, MA 02111-1307, USA. */
/* Define to 1 if you have the `euidaccess' function. */
#undef HAVE_EUIDACCESS
-/* Define to 1 if this OS has exec shield and we can handle it. */
-#undef HAVE_EXECSHIELD
-
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
@@ -355,6 +352,9 @@ Boston, MA 02111-1307, USA. */
/* Define to 1 if you have the <maillock.h> header file. */
#undef HAVE_MAILLOCK_H
+/* Define to 1 if you have the <malloc/malloc.h> header file. */
+#undef HAVE_MALLOC_MALLOC_H
+
/* Define to 1 if you have the `mblen' function. */
#undef HAVE_MBLEN
@@ -432,6 +432,9 @@ Boston, MA 02111-1307, USA. */
/* Define to 1 if you have the `random' function. */
#undef HAVE_RANDOM
+/* Define to 1 if this OS randomizes the start address of the heap. */
+#undef HAVE_RANDOM_HEAPSTART
+
/* Define to 1 if you have the `recvfrom' function. */
#undef HAVE_RECVFROM
@@ -754,9 +757,9 @@ Boston, MA 02111-1307, USA. */
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown */
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
#undef STACK_DIRECTION
/* Define to 1 if you have the ANSI C header files. */
diff --git a/src/dispextern.h b/src/dispextern.h
index f28b39f0c6..a87a38ce46 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -1961,8 +1961,8 @@ struct it
/* Object and position where the current display element came from.
Object can be a Lisp string in case the current display element
- comes from an overlay string, or it is buffer. Position is
- a position in object. */
+ comes from an overlay string, or it is buffer. It may also be nil
+ during mode-line update. Position is a position in object. */
Lisp_Object object;
struct text_pos position;
@@ -2637,7 +2637,7 @@ extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *,
int lookup_fringe_bitmap (Lisp_Object);
void draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, int));
void draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *));
-void draw_window_fringes P_ ((struct window *));
+int draw_window_fringes P_ ((struct window *, int));
int update_window_fringes P_ ((struct window *, int));
void compute_fringe_widths P_ ((struct frame *, int));
diff --git a/src/doc.c b/src/doc.c
index 8c116210cd..9a787e002d 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -776,9 +776,13 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int
idx = strp - SDATA (string);
tem = Fintern (make_string (start, length_byte), Qnil);
+ /* Ignore remappings unless there are no ordinary bindings. */
+ tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qt);
+ if (NILP (tem))
+ tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil);
+
/* Note the Fwhere_is_internal can GC, so we have to take
relocation of string contents into account. */
- tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil);
strp = SDATA (string) + idx;
start = SDATA (string) + start_idx;
diff --git a/src/fringe.c b/src/fringe.c
index 0bf830cbd8..ef4c7631e0 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -722,19 +722,35 @@ draw_row_fringe_bitmaps (w, row)
}
/* Draw the fringes of window W. Only fringes for rows marked for
- update in redraw_fringe_bitmaps_p are drawn. */
+ update in redraw_fringe_bitmaps_p are drawn.
-void
-draw_window_fringes (w)
+ Return >0 if left or right fringe was redrawn in any way.
+
+ If NO_FRINGE is non-zero, also return >0 if either fringe has zero width.
+
+ A return value >0 indicates that the vertical line between windows
+ needs update (as it may be drawn in the fringe).
+*/
+
+int
+draw_window_fringes (w, no_fringe)
struct window *w;
+ int no_fringe;
{
struct glyph_row *row;
int yb = window_text_bottom_y (w);
int nrows = w->current_matrix->nrows;
int y = 0, rn;
+ int updated = 0;
if (w->pseudo_window_p)
- return;
+ return 0;
+
+ /* Must draw line if no fringe */
+ if (no_fringe
+ && (WINDOW_LEFT_FRINGE_WIDTH (w) == 0
+ || WINDOW_RIGHT_FRINGE_WIDTH (w) == 0))
+ updated++;
for (y = 0, rn = 0, row = w->current_matrix->rows;
y < yb && rn < nrows;
@@ -744,7 +760,10 @@ draw_window_fringes (w)
continue;
draw_row_fringe_bitmaps (w, row);
row->redraw_fringe_bitmaps_p = 0;
+ updated++;
}
+
+ return updated;
}
@@ -950,11 +969,7 @@ update_window_fringes (w, force_p)
Typically, we add an equal amount (+/- 1 pixel) to each fringe,
but a negative width value is taken literally (after negating it).
- We never make the fringes narrower than specified. It is planned
- to make fringe bitmaps customizable and expandable, and at that
- time, the user will typically specify the minimum number of pixels
- needed for his bitmaps, so we shouldn't select anything less than
- what is specified.
+ We never make the fringes narrower than specified.
*/
void
@@ -1343,9 +1358,10 @@ DEFUN ("fringe-bitmaps-at-pos", Ffringe_bitmaps_at_pos, Sfringe_bitmaps_at_pos,
0, 2, 0,
doc: /* Return fringe bitmaps of row containing position POS in window WINDOW.
If WINDOW is nil, use selected window. If POS is nil, use value of point
-in that window. Return value is a cons (LEFT . RIGHT) where LEFT and RIGHT
-are the fringe bitmap numbers for the bitmaps in the left and right fringe,
-resp. If left or right fringe is empty, the corresponding element is nil.
+in that window. Return value is a list (LEFT RIGHT OV), where LEFT
+is the symbol for the bitmap in the left fringe (or nil if no bitmap),
+RIGHT is similar for the right fringe, and OV is non-nil if there is an
+overlay arrow in the left fringe.
Return nil if POS is not visible in WINDOW. */)
(pos, window)
Lisp_Object pos, window;
@@ -1373,8 +1389,9 @@ Return nil if POS is not visible in WINDOW. */)
row = MATRIX_FIRST_TEXT_ROW (w->current_matrix);
row = row_containing_pos (w, textpos, row, NULL, 0);
if (row)
- return Fcons (get_fringe_bitmap_name (row->left_fringe_bitmap),
- get_fringe_bitmap_name (row->right_fringe_bitmap));
+ return list3 (get_fringe_bitmap_name (row->left_fringe_bitmap),
+ get_fringe_bitmap_name (row->right_fringe_bitmap),
+ (row->overlay_arrow_p ? Qt : Qnil));
else
return Qnil;
}
diff --git a/src/keyboard.c b/src/keyboard.c
index 378350710b..3360b11850 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -676,6 +676,9 @@ static Lisp_Object apply_modifiers P_ ((int, Lisp_Object));
static void clear_event P_ ((struct input_event *));
static void any_kboard_state P_ ((void));
static SIGTYPE interrupt_signal P_ ((int signalnum));
+static void timer_start_idle P_ ((void));
+static void timer_stop_idle P_ ((void));
+static void timer_resume_idle P_ ((void));
/* Nonzero means don't try to suspend even if the operating system seems
to support it. */
@@ -2387,7 +2390,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
volatile Lisp_Object also_record;
volatile int reread;
struct gcpro gcpro1, gcpro2;
- EMACS_TIME last_idle_start;
int polling_stopped_here = 0;
also_record = Qnil;
@@ -2894,9 +2896,6 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
non_reread:
- /* Record the last idle start time so that we can reset it
- should the next event read be a help-echo. */
- last_idle_start = timer_idleness_start_time;
timer_stop_idle ();
RESUME_POLLING;
@@ -2936,7 +2935,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
prevents automatic window selection (under
mouse_autoselect_window from acting as a real input event, for
example banishing the mouse under mouse-avoidance-mode. */
- timer_idleness_start_time = last_idle_start;
+ timer_resume_idle ();
/* Resume allowing input from any kboard, if that was true before. */
if (!was_locked)
@@ -3134,7 +3133,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
show_help_echo (help, window, object, position, 0);
/* We stopped being idle for this event; undo that. */
- timer_idleness_start_time = last_idle_start;
+ timer_resume_idle ();
goto retry;
}
@@ -4251,7 +4250,7 @@ swallow_events (do_display)
/* Record the start of when Emacs is idle,
for the sake of running idle-time timers. */
-void
+static void
timer_start_idle ()
{
Lisp_Object timers;
@@ -4279,12 +4278,23 @@ timer_start_idle ()
/* Record that Emacs is no longer idle, so stop running idle-time timers. */
-void
+static void
timer_stop_idle ()
{
EMACS_SET_SECS_USECS (timer_idleness_start_time, -1, -1);
}
+/* Resume idle timer from last idle start time. */
+
+static void
+timer_resume_idle ()
+{
+ if (! EMACS_TIME_NEG_P (timer_idleness_start_time))
+ return;
+
+ timer_idleness_start_time = timer_last_idleness_start_time;
+}
+
/* This is only for debugging. */
struct input_event last_timer_event;
@@ -8846,14 +8856,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
keymap may have changed, so replay the sequence. */
if (BUFFERP (key))
{
- EMACS_TIME initial_idleness_start_time;
- EMACS_SET_SECS_USECS (initial_idleness_start_time,
- EMACS_SECS (timer_last_idleness_start_time),
- EMACS_USECS (timer_last_idleness_start_time));
-
- /* Resume idle state, using the same start-time as before. */
- timer_start_idle ();
- timer_idleness_start_time = initial_idleness_start_time;
+ timer_resume_idle ();
mock_input = t;
/* Reset the current buffer from the selected window
diff --git a/src/keyboard.h b/src/keyboard.h
index 4e14257359..08cb934d3f 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -326,8 +326,6 @@ extern void swallow_events P_ ((int));
extern int help_char_p P_ ((Lisp_Object));
extern void quit_throw_to_read_char P_ ((void)) NO_RETURN;
extern void cmd_error_internal P_ ((Lisp_Object, char *));
-extern void timer_start_idle P_ ((void));
-extern void timer_stop_idle P_ ((void));
extern int lucid_event_type_list_p P_ ((Lisp_Object));
extern void kbd_buffer_store_event P_ ((struct input_event *));
extern void kbd_buffer_store_event_hold P_ ((struct input_event *,
diff --git a/src/keymap.c b/src/keymap.c
index 5177ccfbf8..1711e7fbc3 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -268,7 +268,8 @@ get_keymap (object, error, autoload)
/* Should we do an autoload? Autoload forms for keymaps have
Qkeymap as their fifth element. */
- if ((autoload || !error) && EQ (XCAR (tem), Qautoload))
+ if ((autoload || !error) && EQ (XCAR (tem), Qautoload)
+ && SYMBOLP (object))
{
Lisp_Object tail;
diff --git a/src/mac.c b/src/mac.c
index 9740b3bf3f..91d0737257 100644
--- a/src/mac.c
+++ b/src/mac.c
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <errno.h>
+#include <time.h>
#include <utime.h>
#include <dirent.h>
#include <sys/types.h>
@@ -46,6 +47,8 @@ Boston, MA 02111-1307, USA. */
#undef realloc
#undef init_process
#include <Carbon/Carbon.h>
+#undef mktime
+#define mktime emacs_mktime
#undef free
#define free unexec_free
#undef malloc
@@ -72,6 +75,7 @@ Boston, MA 02111-1307, USA. */
#include "process.h"
#include "sysselect.h"
#include "systime.h"
+#include "blockinput.h"
Lisp_Object QCLIPBOARD;
@@ -2547,7 +2551,9 @@ component. */)
CHECK_STRING (script);
+ BLOCK_INPUT;
status = do_applescript (SDATA (script), &result);
+ UNBLOCK_INPUT;
if (status)
{
if (!result)
@@ -2617,26 +2623,23 @@ DEFUN ("mac-paste-function", Fmac_paste_function, Smac_paste_function, 0, 0, 0,
()
{
#if TARGET_API_MAC_CARBON
+ OSStatus err;
ScrapRef scrap;
ScrapFlavorFlags sff;
Size s;
int i;
char *data;
- if (GetCurrentScrap (&scrap) != noErr)
- return Qnil;
-
- if (GetScrapFlavorFlags (scrap, kScrapFlavorTypeText, &sff) != noErr)
- return Qnil;
-
- if (GetScrapFlavorSize (scrap, kScrapFlavorTypeText, &s) != noErr)
- return Qnil;
-
- if ((data = (char*) alloca (s)) == NULL)
- return Qnil;
-
- if (GetScrapFlavorData (scrap, kScrapFlavorTypeText, &s, data) != noErr
- || s == 0)
+ BLOCK_INPUT;
+ err = GetCurrentScrap (&scrap);
+ if (err == noErr)
+ err = GetScrapFlavorFlags (scrap, kScrapFlavorTypeText, &sff);
+ if (err == noErr)
+ err = GetScrapFlavorSize (scrap, kScrapFlavorTypeText, &s);
+ if (err == noErr && (data = (char*) alloca (s)))
+ err = GetScrapFlavorData (scrap, kScrapFlavorTypeText, &s, data);
+ UNBLOCK_INPUT;
+ if (err != noErr || s == 0)
return Qnil;
/* Emacs expects clipboard contents have Unix-style eol's */
@@ -2701,13 +2704,22 @@ DEFUN ("mac-cut-function", Fmac_cut_function, Smac_cut_function, 1, 2, 0,
#if TARGET_API_MAC_CARBON
{
ScrapRef scrap;
+
+ BLOCK_INPUT;
ClearCurrentScrap ();
if (GetCurrentScrap (&scrap) != noErr)
- error ("cannot get current scrap");
+ {
+ UNBLOCK_INPUT;
+ error ("cannot get current scrap");
+ }
if (PutScrapFlavor (scrap, kScrapFlavorTypeText, kScrapFlavorMaskNone, len,
buf) != noErr)
- error ("cannot put to scrap");
+ {
+ UNBLOCK_INPUT;
+ error ("cannot put to scrap");
+ }
+ UNBLOCK_INPUT;
}
#else /* not TARGET_API_MAC_CARBON */
ZeroScrap ();
@@ -2742,9 +2754,11 @@ and t is the same as `SECONDARY'. */)
ScrapRef scrap;
ScrapFlavorFlags sff;
+ BLOCK_INPUT;
if (GetCurrentScrap (&scrap) == noErr)
if (GetScrapFlavorFlags (scrap, kScrapFlavorTypeText, &sff) == noErr)
val = Qt;
+ UNBLOCK_INPUT;
#else /* not TARGET_API_MAC_CARBON */
Handle my_handle;
long rc, scrap_offset;
@@ -2769,8 +2783,6 @@ and t is the same as `SECONDARY'. */)
extern int inhibit_window_system;
extern int noninteractive;
-#include "blockinput.h"
-
/* When Emacs is started from the Finder, SELECT always immediately
returns as if input is present when file descriptor 0 is polled for
input. Strangely, when Emacs is run as a GUI application from the
diff --git a/src/macfns.c b/src/macfns.c
index 3b09b344a5..88f975a65c 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -312,6 +312,9 @@ static Lisp_Object x_default_scroll_bar_color_parameter P_ ((struct frame *,
Lisp_Object,
char *, char *,
int));
+
+extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
+
/* Store the screen positions of frame F into XPTR and YPTR.
These are the positions of the containing window manager window,
not Emacs's own window. */
@@ -321,33 +324,15 @@ x_real_positions (f, xptr, yptr)
FRAME_PTR f;
int *xptr, *yptr;
{
- Point pt;
- GrafPtr oldport;
+ Rect inner, outer;
- GetPort (&oldport);
- SetPortWindowPort (FRAME_MAC_WINDOW (f));
+ mac_get_window_bounds (f, &inner, &outer);
-#if TARGET_API_MAC_CARBON
- {
- Rect r;
+ f->x_pixels_diff = inner.left - outer.left;
+ f->y_pixels_diff = inner.top - outer.top;
- GetWindowPortBounds (FRAME_MAC_WINDOW (f), &r);
- SetPt (&pt, r.left, r.top);
- }
-#else /* not TARGET_API_MAC_CARBON */
- SetPt (&pt,
- FRAME_MAC_WINDOW (f)->portRect.left,
- FRAME_MAC_WINDOW (f)->portRect.top);
-#endif /* not TARGET_API_MAC_CARBON */
- LocalToGlobal (&pt);
- SetPort (oldport);
-
- /* MAC has no frame pixel diff. */
- f->x_pixels_diff = 0;
- f->y_pixels_diff = 0;
-
- *xptr = pt.h;
- *yptr = pt.v;
+ *xptr = outer.left;
+ *yptr = outer.top;
}
@@ -4262,6 +4247,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
NavUserAction userAction;
CFStringRef message=NULL, client=NULL, saveName = NULL;
+ BLOCK_INPUT;
/* No need for a callback function because we are modal */
NavGetDefaultDialogCreationOptions(&options);
options.modality = kWindowModalityAppModal;
@@ -4332,9 +4318,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
AEDisposeDesc(&defLocAed);
}
- BLOCK_INPUT;
status = NavDialogRun(dialogRef);
- UNBLOCK_INPUT;
}
if (saveName) CFRelease(saveName);
@@ -4347,9 +4331,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
{
case kNavUserActionNone:
case kNavUserActionCancel:
- NavDialogDispose(dialogRef);
- Fsignal (Qquit, Qnil); /* Treat cancel like C-g */
- return;
+ break; /* Treat cancel like C-g */
case kNavUserActionOpen:
case kNavUserActionChoose:
case kNavUserActionSaveAs:
@@ -4384,6 +4366,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */)
dir, mustmatch, dir, Qfile_name_history,
default_filename, Qnil);
}
+ UNBLOCK_INPUT;
}
UNGCPRO;
diff --git a/src/macgui.h b/src/macgui.h
index 58081df52b..e5ea665ac1 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -42,6 +42,8 @@ typedef unsigned long Time;
#undef min
#undef init_process
#include <Carbon/Carbon.h>
+#undef mktime
+#define mktime emacs_mktime
#undef Z
#define Z (current_buffer->text->z)
#undef free
diff --git a/src/macmenu.c b/src/macmenu.c
index 740bda261d..007fab15ea 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1322,7 +1322,7 @@ update_submenu_strings (first_wv)
for (wv = first_wv; wv; wv = wv->next)
{
- if (wv->lname && ! NILP (wv->lname))
+ if (STRINGP (wv->lname))
{
wv->name = SDATA (wv->lname);
@@ -1336,7 +1336,7 @@ update_submenu_strings (first_wv)
}
}
- if (wv->lkey && ! NILP (wv->lkey))
+ if (STRINGP (wv->lkey))
wv->key = SDATA (wv->lkey);
if (wv->contents)
diff --git a/src/macterm.c b/src/macterm.c
index e1b8d49ddf..2d09a2e93e 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -50,6 +50,7 @@ Boston, MA 02111-1307, USA. */
#include <TextUtils.h>
#include <LowMem.h>
#include <Controls.h>
+#include <Windows.h>
#if defined (__MRC__) || (__MSL__ >= 0x6000)
#include <ControlDefinitions.h>
#endif
@@ -1292,9 +1293,8 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
output_cursor.vpos,
output_cursor.x, output_cursor.y);
- x_draw_vertical_border (w);
-
- draw_window_fringes (w);
+ if (draw_window_fringes (w, 1))
+ x_draw_vertical_border (w);
UNBLOCK_INPUT;
}
@@ -3893,18 +3893,21 @@ remember_mouse_glyph (f1, gx, gy)
static WindowPtr
-mac_front_window ()
+front_emacs_window ()
{
#if TARGET_API_MAC_CARBON
- return GetFrontWindowOfClass (kDocumentWindowClass, true);
+ WindowPtr wp = GetFrontWindowOfClass (kDocumentWindowClass, true);
+
+ while (wp && !is_emacs_window (wp))
+ wp = GetNextWindowOfClass (wp, kDocumentWindowClass, true);
#else
- WindowPtr front_window = FrontWindow ();
+ WindowPtr wp = FrontWindow ();
- if (tip_window && front_window == tip_window)
- return GetNextWindow (front_window);
- else
- return front_window;
+ while (wp && (wp == tip_window || !is_emacs_window (wp)))
+ wp = GetNextWindow (wp);
#endif
+
+ return wp;
}
#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP)
@@ -3940,7 +3943,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
{
Point mouse_pos;
int ignore1, ignore2;
- WindowPtr wp = mac_front_window ();
+ WindowPtr wp = front_emacs_window ();
struct frame *f;
Lisp_Object frame, tail;
@@ -4557,7 +4560,7 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
unsigned long *time;
{
struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar);
- WindowPtr wp = mac_front_window ();
+ WindowPtr wp = front_emacs_window ();
Point mouse_pos;
struct frame *f = mac_window_to_frame (wp);
int win_y, top_range;
@@ -5053,6 +5056,26 @@ xim_close_dpy (dpyinfo)
*/
+void
+mac_get_window_bounds (f, inner, outer)
+ struct frame *f;
+ Rect *inner, *outer;
+{
+#if TARGET_API_MAC_CARBON
+ GetWindowBounds (FRAME_MAC_WINDOW (f), kWindowContentRgn, inner);
+ GetWindowBounds (FRAME_MAC_WINDOW (f), kWindowStructureRgn, outer);
+#else /* not TARGET_API_MAC_CARBON */
+ RgnHandle region = NewRgn ();
+
+ GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowContentRgn, region);
+ *inner = (*region)->rgnBBox;
+ GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowStructureRgn, region);
+ *outer = (*region)->rgnBBox;
+ DisposeRgn (region);
+#endif /* not TARGET_API_MAC_CARBON */
+}
+
+
/* Calculate the absolute position in frame F
from its current recorded position values and gravity. */
@@ -5060,47 +5083,36 @@ void
x_calc_absolute_position (f)
struct frame *f;
{
- Point pt;
+ int width_diff = 0, height_diff = 0;
int flags = f->size_hint_flags;
+ Rect inner, outer;
- pt.h = pt.v = 0;
+ /* We have nothing to do if the current position
+ is already for the top-left corner. */
+ if (! ((flags & XNegative) || (flags & YNegative)))
+ return;
- /* Find the position of the outside upper-left corner of
+ /* Find the offsets of the outside upper-left corner of
the inner window, with respect to the outer window. */
- if (f->output_data.mac->parent_desc != FRAME_MAC_DISPLAY_INFO (f)->root_window)
- {
- GrafPtr savePort;
- GetPort (&savePort);
+ mac_get_window_bounds (f, &inner, &outer);
- SetPortWindowPort (FRAME_MAC_WINDOW (f));
-
-#if TARGET_API_MAC_CARBON
- {
- Rect r;
-
- GetWindowPortBounds (FRAME_MAC_WINDOW (f), &r);
- SetPt(&pt, r.left, r.top);
- }
-#else /* not TARGET_API_MAC_CARBON */
- SetPt(&pt, FRAME_MAC_WINDOW (f)->portRect.left, FRAME_MAC_WINDOW (f)->portRect.top);
-#endif /* not TARGET_API_MAC_CARBON */
- LocalToGlobal (&pt);
- SetPort (savePort);
- }
+ width_diff = (outer.right - outer.left) - (inner.right - inner.left);
+ height_diff = (outer.bottom - outer.top) - (inner.bottom - inner.top);
/* Treat negative positions as relative to the leftmost bottommost
position that fits on the screen. */
if (flags & XNegative)
f->left_pos = (FRAME_MAC_DISPLAY_INFO (f)->width
- - 2 * f->border_width - pt.h
+ - width_diff
- FRAME_PIXEL_WIDTH (f)
+ f->left_pos);
- /* NTEMACS_TODO: Subtract menubar height? */
+
if (flags & YNegative)
f->top_pos = (FRAME_MAC_DISPLAY_INFO (f)->height
- - 2 * f->border_width - pt.v
+ - height_diff
- FRAME_PIXEL_HEIGHT (f)
+ f->top_pos);
+
/* The left_pos and top_pos
are now relative to the top and left screen edges,
so the flags should correspond. */
@@ -5119,8 +5131,6 @@ x_set_offset (f, xoff, yoff, change_gravity)
register int xoff, yoff;
int change_gravity;
{
- int modified_top, modified_left;
-
if (change_gravity > 0)
{
f->top_pos = yoff;
@@ -5137,11 +5147,55 @@ x_set_offset (f, xoff, yoff, change_gravity)
BLOCK_INPUT;
x_wm_set_size_hint (f, (long) 0, 0);
- modified_left = f->left_pos;
- modified_top = f->top_pos;
-
- MoveWindow (FRAME_MAC_WINDOW (f), modified_left + 6,
- modified_top + 42, false);
+#if TARGET_API_MAC_CARBON
+ MoveWindowStructure (FRAME_MAC_WINDOW (f), f->left_pos, f->top_pos);
+ /* If the title bar is completely outside the screen, adjust the
+ position. */
+ ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn,
+ kWindowConstrainMoveRegardlessOfFit
+ | kWindowConstrainAllowPartial, NULL, NULL);
+ x_real_positions (f, &f->left_pos, &f->top_pos);
+#else
+ {
+ Rect inner, outer, screen_rect, dummy;
+ RgnHandle region = NewRgn ();
+
+ mac_get_window_bounds (f, &inner, &outer);
+ f->x_pixels_diff = inner.left - outer.left;
+ f->y_pixels_diff = inner.top - outer.top;
+ MoveWindow (FRAME_MAC_WINDOW (f), f->left_pos + f->x_pixels_diff,
+ f->top_pos + f->y_pixels_diff, false);
+
+ /* If the title bar is completely outside the screen, adjust the
+ position. The variable `outer' holds the title bar rectangle.
+ The variable `inner' holds slightly smaller one than `outer',
+ so that the calculation of overlapping may not become too
+ strict. */
+ GetWindowRegion (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn, region);
+ outer = (*region)->rgnBBox;
+ DisposeRgn (region);
+ inner = outer;
+ InsetRect (&inner, 8, 8);
+ screen_rect = qd.screenBits.bounds;
+ screen_rect.top += GetMBarHeight ();
+
+ if (!SectRect (&inner, &screen_rect, &dummy))
+ {
+ if (inner.right <= screen_rect.left)
+ f->left_pos = screen_rect.left;
+ else if (inner.left >= screen_rect.right)
+ f->left_pos = screen_rect.right - (outer.right - outer.left);
+
+ if (inner.bottom <= screen_rect.top)
+ f->top_pos = screen_rect.top;
+ else if (inner.top >= screen_rect.bottom)
+ f->top_pos = screen_rect.bottom - (outer.bottom - outer.top);
+
+ MoveWindow (FRAME_MAC_WINDOW (f), f->left_pos + f->x_pixels_diff,
+ f->top_pos + f->y_pixels_diff, false);
+ }
+ }
+#endif
UNBLOCK_INPUT;
}
@@ -5280,7 +5334,11 @@ x_raise_frame (f)
struct frame *f;
{
if (f->async_visible)
- SelectWindow (FRAME_MAC_WINDOW (f));
+ {
+ BLOCK_INPUT;
+ SelectWindow (FRAME_MAC_WINDOW (f));
+ UNBLOCK_INPUT;
+ }
}
/* Lower frame F. */
@@ -5289,7 +5347,11 @@ x_lower_frame (f)
struct frame *f;
{
if (f->async_visible)
- SendBehind (FRAME_MAC_WINDOW (f), nil);
+ {
+ BLOCK_INPUT;
+ SendBehind (FRAME_MAC_WINDOW (f), nil);
+ UNBLOCK_INPUT;
+ }
}
static void
@@ -6926,6 +6988,7 @@ x_find_ccl_program (fontp)
/* true when cannot handle any Mac OS events */
static int handling_window_update = 0;
+#if 0
/* the flag appl_is_suspended is used both for determining the sleep
time to be passed to WaitNextEvent and whether the cursor should be
drawn when updating the display. The cursor is turned off when
@@ -6935,6 +6998,7 @@ static int handling_window_update = 0;
suspended. */
static Boolean app_is_suspended = false;
static long app_sleep_time = WNE_SLEEP_AT_RESUME;
+#endif
#define EXTRA_STACK_ALLOC (256 * 1024)
@@ -7261,11 +7325,13 @@ is_emacs_window (WindowPtr win)
static void
do_app_resume ()
{
+ /* Window-activate events will do the job. */
+#if 0
WindowPtr wp;
struct frame *f;
- wp = mac_front_window ();
- if (is_emacs_window (wp))
+ wp = front_emacs_window ();
+ if (wp)
{
f = mac_window_to_frame (wp);
@@ -7278,16 +7344,19 @@ do_app_resume ()
app_is_suspended = false;
app_sleep_time = WNE_SLEEP_AT_RESUME;
+#endif
}
static void
do_app_suspend ()
{
+ /* Window-deactivate events will do the job. */
+#if 0
WindowPtr wp;
struct frame *f;
- wp = mac_front_window ();
- if (is_emacs_window (wp))
+ wp = front_emacs_window ();
+ if (wp)
{
f = mac_window_to_frame (wp);
@@ -7300,6 +7369,7 @@ do_app_suspend ()
app_is_suspended = true;
app_sleep_time = WNE_SLEEP_AT_SUSPEND;
+#endif
}
@@ -7308,10 +7378,10 @@ do_mouse_moved (mouse_pos, f)
Point mouse_pos;
FRAME_PTR *f;
{
- WindowPtr wp = mac_front_window ();
+ WindowPtr wp = front_emacs_window ();
struct x_display_info *dpyinfo;
- if (is_emacs_window (wp))
+ if (wp)
{
*f = mac_window_to_frame (wp);
dpyinfo = FRAME_MAC_DISPLAY_INFO (*f);
@@ -7373,7 +7443,7 @@ do_menu_choice (SInt32 menu_choice)
default:
{
- struct frame *f = mac_window_to_frame (mac_front_window ());
+ struct frame *f = mac_window_to_frame (front_emacs_window ());
MenuHandle menu = GetMenuHandle (menu_id);
if (menu)
{
@@ -7426,41 +7496,43 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
GrafPtr save_port;
Rect zoom_rect, port_rect;
Point top_left;
- int w_title_height, columns, rows, width, height, dummy, x, y;
+ int w_title_height, columns, rows;
struct frame *f = mac_window_to_frame (w);
- GetPort (&save_port);
-
- SetPortWindowPort (w);
-
- /* Clear window to avoid flicker. */
#if TARGET_API_MAC_CARBON
{
- Rect r;
- BitMap bm;
+ Point standard_size;
- GetWindowPortBounds (w, &r);
- EraseRect (&r);
+ standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
+ standard_size.v = FRAME_MAC_DISPLAY_INFO (f)->height;
- if (zoom_in_or_out == inZoomOut)
+ if (IsWindowInStandardState (w, &standard_size, &zoom_rect))
+ zoom_in_or_out = inZoomIn;
+ else
{
- /* calculate height of window's title bar (hard card it for now). */
- w_title_height = 20 + GetMBarHeight ();
-
- /* get maximum height of window into zoom_rect.bottom -
- zoom_rect.top */
- GetQDGlobalsScreenBits (&bm);
- zoom_rect = bm.bounds;
- zoom_rect.top += w_title_height;
- InsetRect (&zoom_rect, 8, 4); /* not too tight */
-
- zoom_rect.right = zoom_rect.left
- + FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
-
- SetWindowStandardState (w, &zoom_rect);
+ /* Adjust the standard size according to character boundaries. */
+
+ columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left);
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
+ standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
+ standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
+ GetWindowBounds (w, kWindowContentRgn, &port_rect);
+ if (IsWindowInStandardState (w, &standard_size, &zoom_rect)
+ && port_rect.left == zoom_rect.left
+ && port_rect.top == zoom_rect.top)
+ zoom_in_or_out = inZoomIn;
+ else
+ zoom_in_or_out = inZoomOut;
}
+
+ ZoomWindowIdeal (w, zoom_in_or_out, &standard_size);
}
#else /* not TARGET_API_MAC_CARBON */
+ GetPort (&save_port);
+
+ SetPortWindowPort (w);
+
+ /* Clear window to avoid flicker. */
EraseRect (&(w->portRect));
if (zoom_in_or_out == inZoomOut)
{
@@ -7479,12 +7551,19 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
zoom_rect.right = zoom_rect.left
+ FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
+ /* Adjust the standard size according to character boundaries. */
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
+ zoom_rect.bottom =
+ zoom_rect.top + FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
+
(**((WStateDataHandle) ((WindowPeek) w)->dataHandle)).stdState
= zoom_rect;
}
-#endif /* not TARGET_API_MAC_CARBON */
- ZoomWindow (w, zoom_in_or_out, w == mac_front_window ());
+ ZoomWindow (w, zoom_in_or_out, w == front_emacs_window ());
+
+ SetPort (save_port);
+#endif /* not TARGET_API_MAC_CARBON */
/* retrieve window size and update application values */
#if TARGET_API_MAC_CARBON
@@ -7495,8 +7574,7 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out)
rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, port_rect.bottom - port_rect.top);
columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, port_rect.right - port_rect.left);
x_set_window_size (f, 0, columns, rows);
-
- SetPort (save_port);
+ x_real_positions (f, &f->left_pos, &f->top_pos);
}
/* Initialize Drag And Drop to allow files to be dropped onto emacs frames */
@@ -8046,19 +8124,15 @@ XTread_socket (sd, expected, hold_quit)
if (NILP (Fboundp (Qmac_ready_for_drag_n_drop)))
event_mask -= highLevelEventMask;
- while (WaitNextEvent (event_mask, &er,
- (expected ? app_sleep_time : 0L), NULL))
-#else
- while (!ReceiveNextEvent (0, NULL,
- (expected ? TicksToEventTime (app_sleep_time) : 0),
+ while (WaitNextEvent (event_mask, &er, 0L, NULL))
+#else /* USE_CARBON_EVENTS */
+ while (!ReceiveNextEvent (0, NULL, kEventDurationNoWait,
kEventRemoveFromQueue, &eventRef))
-#endif /* !USE_CARBON_EVENTS */
+#endif /* USE_CARBON_EVENTS */
{
int do_help = 0;
struct frame *f;
- expected = 0;
-
/* It is necessary to set this (additional) argument slot of an
event to nil because keyboard.c protects incompletely
processed event from being garbage collected by placing them
@@ -8073,7 +8147,7 @@ XTread_socket (sd, expected, hold_quit)
switch (GetEventClass (eventRef))
{
case kEventClassWindow:
- if (GetEventKind (eventRef) == kEventWindowBoundsChanged)
+ if (GetEventKind (eventRef) == kEventWindowBoundsChanged)
{
WindowPtr window_ptr;
GetEventParameter(eventRef, kEventParamDirectObject,
@@ -8081,13 +8155,7 @@ XTread_socket (sd, expected, hold_quit)
NULL, &window_ptr);
f = mac_window_to_frame (window_ptr);
if (f && !f->async_iconified)
- {
- int x, y;
-
- x_real_positions (f, &x, &y);
- f->left_pos = x;
- f->top_pos = y;
- }
+ x_real_positions (f, &f->left_pos, &f->top_pos);
SendEventToEventTarget (eventRef, toolbox_dispatcher);
}
break;
@@ -8096,7 +8164,7 @@ XTread_socket (sd, expected, hold_quit)
{
SInt32 delta;
Point point;
- WindowPtr window_ptr = mac_front_window ();
+ WindowPtr window_ptr = front_emacs_window ();
if (!IsValidWindowPtr (window_ptr))
{
@@ -8158,33 +8226,28 @@ XTread_socket (sd, expected, hold_quit)
}
else
{
- window_ptr = FrontWindow ();
+ part_code = FindWindow (er.where, &window_ptr);
if (tip_window && window_ptr == tip_window)
{
HideWindow (tip_window);
- window_ptr = FrontWindow ();
+ part_code = FindWindow (er.where, &window_ptr);
}
-
- if (!is_emacs_window (window_ptr))
- break;
-
- part_code = FindWindow (er.where, &window_ptr);
}
+ if (er.what != mouseDown && part_code != inContent)
+ break;
+
switch (part_code)
{
case inMenuBar:
- if (er.what == mouseDown)
- {
- f = mac_window_to_frame (mac_front_window ());
- saved_menu_event_location = er.where;
- inev.kind = MENU_BAR_ACTIVATE_EVENT;
- XSETFRAME (inev.frame_or_window, f);
- }
+ f = mac_window_to_frame (front_emacs_window ());
+ saved_menu_event_location = er.where;
+ inev.kind = MENU_BAR_ACTIVATE_EVENT;
+ XSETFRAME (inev.frame_or_window, f);
break;
case inContent:
- if (window_ptr != mac_front_window ())
+ if (window_ptr != front_emacs_window ())
SelectWindow (window_ptr);
else
{
@@ -8281,7 +8344,7 @@ XTread_socket (sd, expected, hold_quit)
}
else
{
- if (dpyinfo->grabbed & (1 << inev.code) == 0)
+ if ((dpyinfo->grabbed & (1 << inev.code)) == 0)
/* If a button is released though it was not
previously pressed, that would be because
of multi-button emulation. */
@@ -8304,27 +8367,16 @@ XTread_socket (sd, expected, hold_quit)
case inDrag:
#if TARGET_API_MAC_CARBON
- if (er.what == mouseDown)
- {
- BitMap bm;
-
- GetQDGlobalsScreenBits (&bm);
- DragWindow (window_ptr, er.where, &bm.bounds);
- }
+ DragWindow (window_ptr, er.where, NULL);
#else /* not TARGET_API_MAC_CARBON */
DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
#endif /* not TARGET_API_MAC_CARBON */
/* Update the frame parameters. */
{
struct frame *f = mac_window_to_frame (window_ptr);
+
if (f && !f->async_iconified)
- {
- int x, y;
-
- x_real_positions (f, &x, &y);
- f->left_pos = x;
- f->top_pos = y;
- }
+ x_real_positions (f, &f->left_pos, &f->top_pos);
}
break;
@@ -8339,11 +8391,8 @@ XTread_socket (sd, expected, hold_quit)
/* window resize handling added --ben */
case inGrow:
- if (er.what == mouseDown)
- {
- do_grow_window(window_ptr, &er);
- break;
- }
+ do_grow_window (window_ptr, &er);
+ break;
/* window zoom handling added --ben */
case inZoomIn:
@@ -8415,7 +8464,7 @@ XTread_socket (sd, expected, hold_quit)
if (!is_emacs_window (window_ptr))
break;
-
+
f = mac_window_to_frame (window_ptr);
if ((er.modifiers & activeFlag) != 0)
@@ -8486,7 +8535,7 @@ XTread_socket (sd, expected, hold_quit)
#endif
#if TARGET_API_MAC_CARBON
- if (!IsValidWindowPtr (mac_front_window ()))
+ if (!IsValidWindowPtr (front_emacs_window ()))
{
SysBeep (1);
break;
@@ -8590,7 +8639,7 @@ XTread_socket (sd, expected, hold_quit)
inev.modifiers = mac_to_emacs_modifiers (er.modifiers);
#endif
XSETFRAME (inev.frame_or_window,
- mac_window_to_frame (mac_front_window ()));
+ mac_window_to_frame (front_emacs_window ()));
inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */
break;
@@ -8607,16 +8656,16 @@ XTread_socket (sd, expected, hold_quit)
WindowPtr wp;
Lisp_Object frame;
- wp = mac_front_window ();
+ wp = front_emacs_window ();
if (!wp)
{
struct frame *f = XFRAME (XCAR (Vframe_list));
CollapseWindow (FRAME_MAC_WINDOW (f), false);
- wp = mac_front_window ();
+ wp = front_emacs_window ();
}
- if (wp && is_emacs_window (wp))
+ if (wp)
f = mac_window_to_frame (wp);
inev.kind = DRAG_N_DROP_EVENT;
@@ -8742,6 +8791,7 @@ make_mac_frame (FRAME_PTR fp)
mwp = fp->output_data.mac;
+ BLOCK_INPUT;
if (making_terminal_window)
{
if (!(mwp->mWP = GetNewCWindow (TERM_WINDOW_RESOURCE, NULL,
@@ -8769,9 +8819,8 @@ make_mac_frame (FRAME_PTR fp)
/* so that update events can find this mac_output struct */
mwp->mFP = fp; /* point back to emacs frame */
- SetPortWindowPort (mwp->mWP);
-
SizeWindow (mwp->mWP, FRAME_PIXEL_WIDTH (fp), FRAME_PIXEL_HEIGHT (fp), false);
+ UNBLOCK_INPUT;
}
@@ -9073,7 +9122,7 @@ mac_check_for_quit_char ()
e.arg = Qnil;
e.modifiers = NULL;
e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60);
- XSETFRAME (e.frame_or_window, mac_window_to_frame (mac_front_window ()));
+ XSETFRAME (e.frame_or_window, mac_window_to_frame (front_emacs_window ()));
/* Remove event from queue to prevent looping. */
RemoveEventFromQueue (GetMainEventQueue (), event);
ReleaseEvent (event);
@@ -9194,6 +9243,7 @@ mac_initialize ()
signal (SIGPIPE, x_connection_signal);
#endif
+ BLOCK_INPUT;
mac_initialize_display_info ();
#if TARGET_API_MAC_CARBON
@@ -9212,6 +9262,7 @@ mac_initialize ()
if (!inhibit_window_system)
MakeMeTheFrontProcess ();
#endif
+ UNBLOCK_INPUT;
}
diff --git a/src/textprop.c b/src/textprop.c
index c8ec008dcb..317f8fa6aa 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -1,5 +1,5 @@
/* Interface code for dealing with text properties.
- Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003
+ Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -2233,7 +2233,9 @@ If a character in a buffer has PROPERTY, new text inserted adjacent to
the character doesn't inherit PROPERTY if NONSTICKINESS is non-nil,
inherits it if NONSTICKINESS is nil. The front-sticky and
rear-nonsticky properties of the character overrides NONSTICKINESS. */);
- Vtext_property_default_nonsticky = Qnil;
+ /* Text property `syntax-table' should be nonsticky by default. */
+ Vtext_property_default_nonsticky
+ = Fcons (Fcons (intern ("syntax-table"), Qt), Qnil);
staticpro (&interval_insert_behind_hooks);
staticpro (&interval_insert_in_front_hooks);
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index b41c586d2e..1f2b4c9662 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -99,7 +99,12 @@ Boston, MA 02111-1307, USA. */
#if defined (__ppc__)
#include <mach-o/ppc/reloc.h>
#endif
+#if defined (HAVE_MALLOC_MALLOC_H)
+#include <malloc/malloc.h>
+#else
#include <objc/malloc.h>
+#endif
+
#define VERBOSE 1
diff --git a/src/w32term.c b/src/w32term.c
index 1d6b4ec753..574457f727 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -567,9 +567,8 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
output_cursor.vpos,
output_cursor.x, output_cursor.y);
- x_draw_vertical_border (w);
-
- draw_window_fringes (w);
+ if (draw_window_fringes (w, 1))
+ x_draw_vertical_border (w);
UNBLOCK_INPUT;
}
diff --git a/src/window.c b/src/window.c
index e7246b7c65..55d7d7d279 100644
--- a/src/window.c
+++ b/src/window.c
@@ -607,9 +607,6 @@ coordinates_in_window (w, x, y)
int grabbable_width = ux;
int lmargin_width, rmargin_width, text_left, text_right;
- if (*x < x0 || *x >= x1)
- return ON_NOTHING;
-
/* In what's below, we subtract 1 when computing right_x because we
want the rightmost pixel, which is given by left_pixel+width-1. */
if (w->pseudo_window_p)
@@ -659,6 +656,9 @@ coordinates_in_window (w, x, y)
return ON_VERTICAL_BORDER;
}
+ if (*x < x0 || *x >= x1)
+ return ON_NOTHING;
+
/* Convert X and Y to window relative coordinates.
Mode line starts at left edge of window. */
*x -= x0;
@@ -673,6 +673,9 @@ coordinates_in_window (w, x, y)
goto header_vertical_border_check;
}
+ if (*x < x0 || *x >= x1)
+ return ON_NOTHING;
+
/* Outside any interesting column? */
if (*x < left_x || *x > right_x)
return ON_SCROLL_BAR;
@@ -6034,9 +6037,9 @@ display marginal areas and the text area. */)
struct window *w = decode_window (window);
if (!NILP (left))
- CHECK_NUMBER (left);
+ CHECK_NATNUM (left);
if (!NILP (right))
- CHECK_NUMBER (right);
+ CHECK_NATNUM (right);
if (!EQ (w->left_fringe_width, left)
|| !EQ (w->right_fringe_width, right)
@@ -6096,7 +6099,7 @@ If TYPE is t, use the frame's scroll-bar type. */)
struct window *w = decode_window (window);
if (!NILP (width))
- CHECK_NUMBER (width);
+ CHECK_NATNUM (width);
if (XINT (width) == 0)
vertical_type = Qnil;
diff --git a/src/xdisp.c b/src/xdisp.c
index 04c313ef18..008195eba7 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -216,6 +216,8 @@ extern int pending_menu_activation;
extern int interrupt_input;
extern int command_loop_level;
+extern Lisp_Object do_mouse_tracking;
+
extern int minibuffer_auto_raise;
extern Lisp_Object Vminibuffer_list;
@@ -10517,6 +10519,9 @@ redisplay_preserve_echo_area (from_where)
}
else
redisplay_internal (1);
+
+ if (rif != NULL && rif->flush_display_optional)
+ rif->flush_display_optional (NULL);
}
@@ -12320,7 +12325,8 @@ redisplay_window (window, just_this_one_p)
{
update_begin (f);
BLOCK_INPUT;
- draw_window_fringes (w);
+ if (draw_window_fringes (w, 1))
+ x_draw_vertical_border (w);
UNBLOCK_INPUT;
update_end (f);
}
@@ -18800,8 +18806,10 @@ calc_line_height_property (it, prop, font, boff, total)
if (STRINGP (it->object))
position = make_number (IT_STRING_CHARPOS (*it));
- else
+ else if (BUFFERP (it->object))
position = make_number (IT_CHARPOS (*it));
+ else
+ return Qnil;
val = Fget_char_property (position, prop, it->object);
@@ -20912,6 +20920,10 @@ define_frame_cursor1 (f, cursor, pointer)
Cursor cursor;
Lisp_Object pointer;
{
+ /* Do not change cursor shape while dragging mouse. */
+ if (!NILP (do_mouse_tracking))
+ return;
+
if (!NILP (pointer))
{
if (EQ (pointer, Qarrow))
@@ -21773,6 +21785,9 @@ x_draw_vertical_border (w)
do it for frames with vertical scroll bars because either the
right scroll bar of a window, or the left scroll bar of its
neighbor will suffice as a border. */
+ if (FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (w->frame)))
+ return;
+
if (!WINDOW_RIGHTMOST_P (w)
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
{
diff --git a/src/xfns.c b/src/xfns.c
index b0864cbdff..e41540a994 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -5551,7 +5551,7 @@ Chinese, Japanese, and Korean. */);
last_show_tip_args = Qnil;
staticpro (&last_show_tip_args);
-#ifdef USE_MOTIF
+#if defined (USE_MOTIF) || defined (USE_GTK)
defsubr (&Sx_file_dialog);
#endif
}
diff --git a/src/xterm.c b/src/xterm.c
index cf7ec09cf4..ef469a2b82 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -572,9 +572,8 @@ x_update_window_end (w, cursor_on_p, mouse_face_overwritten_p)
output_cursor.vpos,
output_cursor.x, output_cursor.y);
- x_draw_vertical_border (w);
-
- draw_window_fringes (w);
+ if (draw_window_fringes (w, 1))
+ x_draw_vertical_border (w);
UNBLOCK_INPUT;
}
@@ -3389,12 +3388,14 @@ x_find_modifier_meanings (dpyinfo)
Alt keysyms are on. */
{
int row, col; /* The row and column in the modifier table. */
+ int found_alt_or_meta;
for (row = 3; row < 8; row++)
+ {
+ found_alt_or_meta = 0;
for (col = 0; col < mods->max_keypermod; col++)
{
- KeyCode code
- = mods->modifiermap[(row * mods->max_keypermod) + col];
+ KeyCode code = mods->modifiermap[(row * mods->max_keypermod) + col];
/* Zeroes are used for filler. Skip them. */
if (code == 0)
@@ -3412,33 +3413,44 @@ x_find_modifier_meanings (dpyinfo)
{
case XK_Meta_L:
case XK_Meta_R:
+ found_alt_or_meta = 1;
dpyinfo->meta_mod_mask |= (1 << row);
break;
case XK_Alt_L:
case XK_Alt_R:
+ found_alt_or_meta = 1;
dpyinfo->alt_mod_mask |= (1 << row);
break;
case XK_Hyper_L:
case XK_Hyper_R:
- dpyinfo->hyper_mod_mask |= (1 << row);
+ if (!found_alt_or_meta)
+ dpyinfo->hyper_mod_mask |= (1 << row);
+ code_col = syms_per_code;
+ col = mods->max_keypermod;
break;
case XK_Super_L:
case XK_Super_R:
- dpyinfo->super_mod_mask |= (1 << row);
+ if (!found_alt_or_meta)
+ dpyinfo->super_mod_mask |= (1 << row);
+ code_col = syms_per_code;
+ col = mods->max_keypermod;
break;
case XK_Shift_Lock:
/* Ignore this if it's not on the lock modifier. */
- if ((1 << row) == LockMask)
+ if (!found_alt_or_meta && ((1 << row) == LockMask))
dpyinfo->shift_lock_mask = LockMask;
+ code_col = syms_per_code;
+ col = mods->max_keypermod;
break;
}
}
}
}
+ }
}
/* If we couldn't find any meta keys, accept any alt keys as meta keys. */
@@ -5052,9 +5064,15 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
/* Compute the left edge of the scroll bar. */
#ifdef USE_TOOLKIT_SCROLL_BARS
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
- sb_left = left + width - sb_width - (width - sb_width) / 2;
+ sb_left = (left +
+ (WINDOW_RIGHTMOST_P (w)
+ ? width - sb_width - (width - sb_width) / 2
+ : 0));
else
- sb_left = left + (width - sb_width) / 2;
+ sb_left = (left +
+ (WINDOW_LEFTMOST_P (w)
+ ? (width - sb_width) / 2
+ : width - sb_width));
#else
if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
sb_left = left + width - sb_width;
@@ -5107,19 +5125,20 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
width);
#else /* not USE_GTK */
- /* Since toolkit scroll bars are smaller than the space reserved
- for them on the frame, we have to clear "under" them. */
- if (width > 0 && height > 0)
- x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
- left, top, width, height, False);
/* Move/size the scroll bar widget. */
if (mask)
+ {
+ /* Since toolkit scroll bars are smaller than the space reserved
+ for them on the frame, we have to clear "under" them. */
+ if (width > 0 && height > 0)
+ x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
+ left, top, width, height, False);
XtConfigureWidget (SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar),
sb_left + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
top,
sb_width - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
max (height, 1), 0);
-
+ }
#endif /* not USE_GTK */
#else /* not USE_TOOLKIT_SCROLL_BARS */
@@ -10918,7 +10937,7 @@ static struct redisplay_interface x_redisplay_interface =
x_update_window_end,
x_cursor_to,
x_flush,
-#ifndef XFlush
+#ifdef XFlush
x_flush,
#else
0, /* flush_display_optional */
diff --git a/src/xterm.h b/src/xterm.h
index d87135e8bf..76cba8a251 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -21,8 +21,8 @@ Boston, MA 02111-1307, USA. */
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
-#include <X11/Xutil.h>
#include <X11/keysym.h>
+#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/Xresource.h>