From 4dbdb9eb939fffaa7dcf1b39053913ff1f799c7f Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 28 Jul 2006 11:11:51 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 79271fe23fa..2f51ce899f5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-07-28 Kim F. Storm + + * alloc.c (valid_pointer_p): New function (from valid_lisp_object_p). + (valid_lisp_object_p): Use it to check for valid SUBRP obj. + 2006-07-26 Chong Yidong * keyboard.c (read_char): New arg END_TIME specifying timeout. -- cgit v1.2.1 From 7ffb6955ce67ed159ae2386b053df929d6220725 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 28 Jul 2006 11:12:23 +0000 Subject: (valid_pointer_p): New function (from valid_lisp_object_p). (valid_lisp_object_p): Use it to check for valid SUBRP obj. --- src/alloc.c | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/alloc.c b/src/alloc.c index b058b29c697..a861504ab89 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4606,6 +4606,27 @@ mark_stack () #endif /* GC_MARK_STACK != 0 */ +/* Determine whether it is safe to access memory at address P. */ +int valid_pointer_p (p) + void *p; +{ + int fd; + + /* Obviously, we cannot just access it (we would SEGV trying), so we + trick the o/s to tell us whether p is a valid pointer. + Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may + not validate p in that case. */ + + if ((fd = emacs_open ("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0) + { + int valid = (emacs_write (fd, (char *)p, 16) == 16); + emacs_close (fd); + unlink ("__Valid__Lisp__Object__"); + return valid; + } + + return -1; +} /* Return 1 if OBJ is a valid lisp object. Return 0 if OBJ is NOT a valid lisp object. @@ -4618,9 +4639,7 @@ valid_lisp_object_p (obj) Lisp_Object obj; { void *p; -#if !GC_MARK_STACK - int fd; -#else +#if GC_MARK_STACK struct mem_node *m; #endif @@ -4632,26 +4651,22 @@ valid_lisp_object_p (obj) return 1; #if !GC_MARK_STACK - /* We need to determine whether it is safe to access memory at - address P. Obviously, we cannot just access it (we would SEGV - trying), so we trick the o/s to tell us whether p is a valid - pointer. Unfortunately, we cannot use NULL_DEVICE here, as - emacs_write may not validate p in that case. */ - if ((fd = emacs_open ("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0) - { - int valid = (emacs_write (fd, (char *)p, 16) == 16); - emacs_close (fd); - unlink ("__Valid__Lisp__Object__"); - return valid; - } - - return -1; + return valid_pointer_p (p); #else m = mem_find (p); if (m == MEM_NIL) - return 0; + { + int valid = valid_pointer_p (p); + if (valid <= 0) + return valid; + + if (SUBRP (obj)) + return 1; + + return 0; + } switch (m->type) { -- cgit v1.2.1 From 69b9efaa09b5fe495b5520af1a44f7f84dfd6b90 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sat, 29 Jul 2006 01:53:31 +0000 Subject: Whitespace change. --- src/alloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/alloc.c b/src/alloc.c index a861504ab89..4c1a81e7c92 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -4607,7 +4607,8 @@ mark_stack () /* Determine whether it is safe to access memory at address P. */ -int valid_pointer_p (p) +int +valid_pointer_p (p) void *p; { int fd; -- cgit v1.2.1 From 5e093f4432b787ddf421b96abfe5f4c04554188a Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sat, 29 Jul 2006 01:54:16 +0000 Subject: (safe_run_hooks_1): Don't crash if Vrun_hooks is nil. --- src/keyboard.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index 23e10aefac1..95d880d1209 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2032,6 +2032,8 @@ static Lisp_Object safe_run_hooks_1 (hook) Lisp_Object hook; { + if (NILP (Vrun_hooks)) + return Qnil; return call1 (Vrun_hooks, Vinhibit_quit); } -- cgit v1.2.1 From 9e62c96292a11f1905fb45881c3996832f6265d1 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sat, 29 Jul 2006 01:56:35 +0000 Subject: (update_menu_bar): New arg HOOKS_RUN. Callers changed. Used to avoid running the hooks over and over for each frame. (prepare_menu_bars): Pass value from update_menu_bar as HOOKS_RUN of next call. --- src/xdisp.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 22be60f7eb8..9911f47c2a4 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -900,7 +900,7 @@ static void redisplay_window P_ ((Lisp_Object, int)); static Lisp_Object redisplay_window_error (); static Lisp_Object redisplay_window_0 P_ ((Lisp_Object)); static Lisp_Object redisplay_window_1 P_ ((Lisp_Object)); -static void update_menu_bar P_ ((struct frame *, int)); +static int update_menu_bar P_ ((struct frame *, int, int)); static int try_window_reusing_current_matrix P_ ((struct window *)); static int try_window_id P_ ((struct window *)); static int display_line P_ ((struct it *)); @@ -9036,6 +9036,9 @@ prepare_menu_bars () { Lisp_Object tail, frame; int count = SPECPDL_INDEX (); + /* 1 means that update_menu_bar has run its hooks + so any further calls to update_menu_bar shouldn't do so again. */ + int menu_bar_hooks_run = 0; record_unwind_save_match_data (); @@ -9067,7 +9070,7 @@ prepare_menu_bars () } GCPRO1 (tail); - update_menu_bar (f, 0); + menu_bar_hooks_run = update_menu_bar (f, 0, menu_bar_hooks_run); #ifdef HAVE_WINDOW_SYSTEM update_tool_bar (f, 0); #ifdef MAC_OS @@ -9082,7 +9085,7 @@ prepare_menu_bars () else { struct frame *sf = SELECTED_FRAME (); - update_menu_bar (sf, 1); + update_menu_bar (sf, 1, 0); #ifdef HAVE_WINDOW_SYSTEM update_tool_bar (sf, 1); #ifdef MAC_OS @@ -9103,12 +9106,18 @@ prepare_menu_bars () before we start to fill in any display lines, because it can call eval. - If SAVE_MATCH_DATA is non-zero, we must save and restore it here. */ + If SAVE_MATCH_DATA is non-zero, we must save and restore it here. -static void -update_menu_bar (f, save_match_data) + If HOOKS_RUN is 1, that means a previous call to update_menu_bar + already ran the menu bar hooks for this redisplay, so there + is no need to run them again. The return value is the + updated value of this flag, to pass to the next call. */ + +static int +update_menu_bar (f, save_match_data, hooks_run) struct frame *f; int save_match_data; + int hooks_run; { Lisp_Object window; register struct window *w; @@ -9173,15 +9182,21 @@ update_menu_bar (f, save_match_data) specbind (Qoverriding_local_map, Qnil); } - /* Run the Lucid hook. */ - safe_run_hooks (Qactivate_menubar_hook); + if (!hooks_run) + { + /* Run the Lucid hook. */ + safe_run_hooks (Qactivate_menubar_hook); + + /* If it has changed current-menubar from previous value, + really recompute the menu-bar from the value. */ + if (! NILP (Vlucid_menu_bar_dirty_flag)) + call0 (Qrecompute_lucid_menubar); + + safe_run_hooks (Qmenu_bar_update_hook); - /* If it has changed current-menubar from previous value, - really recompute the menu-bar from the value. */ - if (! NILP (Vlucid_menu_bar_dirty_flag)) - call0 (Qrecompute_lucid_menubar); + hooks_run = 1; + } - safe_run_hooks (Qmenu_bar_update_hook); FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); /* Redisplay the menu bar in case we changed it. */ @@ -9210,6 +9225,8 @@ update_menu_bar (f, save_match_data) set_buffer_internal_1 (prev); } } + + return hooks_run; } -- cgit v1.2.1 From 418ca4d22a6bb3aa5bd4584f21ed4c7da12e0b80 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sat, 29 Jul 2006 01:57:38 +0000 Subject: (lookup_named_face, Fdisplay_supports_face_attributes_p): Add conditional aborts for clarity. --- src/xfaces.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/xfaces.c b/src/xfaces.c index f67ea61b37a..99355cca6af 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5717,6 +5717,8 @@ lookup_named_face (f, symbol, c, signal_p) if (!realize_basic_faces (f)) return -1; default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); + if (default_face == NULL) + abort (); /* realize_basic_faces must have set it up */ } if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p)) @@ -6221,6 +6223,8 @@ face for italic. */) if (! realize_basic_faces (f)) error ("Cannot realize default face"); def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); + if (def_face == NULL) + abort (); /* realize_basic_faces must have set it up */ } /* Dispatch to the appropriate handler. */ -- cgit v1.2.1 From 0de8dcc97732834702d25e2be92f62d4b9ae4e35 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sat, 29 Jul 2006 02:27:00 +0000 Subject: *** empty log message *** --- src/ChangeLog | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 2f51ce899f5..029b7368be1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2006-07-28 Richard Stallman + + * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p): + Add conditional aborts for clarity. + + * xdisp.c (update_menu_bar): New arg HOOKS_RUN. Callers changed. + Used to avoid running the hooks over and over for each frame. + (prepare_menu_bars): Pass value from update_menu_bar + as HOOKS_RUN of next call. + + * keyboard.c (safe_run_hooks_1): Don't crash if Vrun_hooks is nil. + 2006-07-28 Kim F. Storm * alloc.c (valid_pointer_p): New function (from valid_lisp_object_p). @@ -182,6 +194,14 @@ (mac_initialize_display_info) [MAC_OSX]: Use CGDisplaySamplesPerPixel. (x_delete_display): Apply 2006-07-04 change for xterm.c. +2006-07-17 Richard Stallman + + * keyboard.c (Vcommand_error_function): New variable. + (syms_of_keyboard): Defvar it. + (cmd_error_internal): Simplify, and handle Vcommand_error_function. + + * dispnew.c (init_display): Mention DISPLAY as well as TERM in err msg. + 2006-07-17 Kim F. Storm * xdisp.c (handle_single_display_spec): Ensure the right value of -- cgit v1.2.1 From 69666f776a28c398808c3a6c8004a5c831f84b7d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 29 Jul 2006 10:18:48 +0000 Subject: [WINDOWSNT]: Include fcntl.h, to fix last change. --- src/ChangeLog | 4 ++++ src/alloc.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 029b7368be1..7b7c1747aad 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-07-29 Eli Zaretskii + + * alloc.c [WINDOWSNT]: Include fcntl.h, to fix last change. + 2006-07-28 Richard Stallman * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p): diff --git a/src/alloc.c b/src/alloc.c index 4c1a81e7c92..e5735e03fd9 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -78,6 +78,10 @@ extern POINTER_TYPE *sbrk (); #define O_WRONLY 1 #endif +#ifdef WINDOWSNT +#include +#endif + #ifdef DOUG_LEA_MALLOC #include -- cgit v1.2.1 From 0ef973bb131f5a622162a1b1053521f6ed0d6f60 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 29 Jul 2006 10:59:50 +0000 Subject: (Ffind_operation_coding_system): Revert the change from 2006-05-29. --- src/coding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/coding.c b/src/coding.c index a3fd8f91284..f0b3cb74acd 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7539,7 +7539,7 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) return Fcons (val, val); if (! NILP (Ffboundp (val))) { - val = safe_call1 (val, Flist (nargs, args)); + val = call1 (val, Flist (nargs, args)); if (CONSP (val)) return val; if (SYMBOLP (val) && ! NILP (Fcoding_system_p (val))) -- cgit v1.2.1 From cfb37af8b15a302aacf7be22daa5980f00fe93d6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 29 Jul 2006 11:20:42 +0000 Subject: *** empty log message *** --- src/ChangeLog | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 7b7c1747aad..9f293bc1025 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2006-07-29 Eli Zaretskii + * coding.c (Ffind_operation_coding_system): Revert the change from + 2006-05-29. + * alloc.c [WINDOWSNT]: Include fcntl.h, to fix last change. 2006-07-28 Richard Stallman -- cgit v1.2.1 From 4f213bd48da55b1be08892b3c77a705b2a122546 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sat, 29 Jul 2006 22:03:14 +0000 Subject: Comment change. --- src/coding.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/coding.c b/src/coding.c index f0b3cb74acd..1af7b4c0d52 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7539,6 +7539,9 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) return Fcons (val, val); if (! NILP (Ffboundp (val))) { + /* We use call1 rather than safe_call1 + so as to get bug reports about functions called here + which don't handle the current interface. */ val = call1 (val, Flist (nargs, args)); if (CONSP (val)) return val; -- cgit v1.2.1 From f554db0f9656259e14ba65667db567d68c16dc3c Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 30 Jul 2006 12:43:09 +0000 Subject: Undo 2006-06-28 change. --- src/editfns.c | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/editfns.c b/src/editfns.c index aea044db068..e692204c702 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -629,10 +629,7 @@ find_field (pos, merge_at_boundary, beg_limit, beg, end_limit, end) DEFUN ("delete-field", Fdelete_field, Sdelete_field, 0, 1, 0, doc: /* Delete the field surrounding POS. A field is a region of text with the same `field' property. -If POS is nil, the value of point is used for POS. - -An `args-out-of-range' error is signaled if POS is outside the -buffer's accessible portion. */) +If POS is nil, the value of point is used for POS. */) (pos) Lisp_Object pos; { @@ -646,10 +643,7 @@ buffer's accessible portion. */) DEFUN ("field-string", Ffield_string, Sfield_string, 0, 1, 0, doc: /* Return the contents of the field surrounding POS as a string. A field is a region of text with the same `field' property. -If POS is nil, the value of point is used for POS. - -An `args-out-of-range' error is signaled if POS is outside the -buffer's accessible portion. */) +If POS is nil, the value of point is used for POS. */) (pos) Lisp_Object pos; { @@ -661,10 +655,7 @@ buffer's accessible portion. */) DEFUN ("field-string-no-properties", Ffield_string_no_properties, Sfield_string_no_properties, 0, 1, 0, doc: /* Return the contents of the field around POS, without text-properties. A field is a region of text with the same `field' property. -If POS is nil, the value of point is used for POS. - -An `args-out-of-range' error is signaled if POS is outside the -buffer's accessible portion. */) +If POS is nil, the value of point is used for POS. */) (pos) Lisp_Object pos; { @@ -680,10 +671,7 @@ If POS is nil, the value of point is used for POS. If ESCAPE-FROM-EDGE is non-nil and POS is at the beginning of its field, then the beginning of the *previous* field is returned. If LIMIT is non-nil, it is a buffer position; if the beginning of the field -is before LIMIT, then LIMIT will be returned instead. - -An `args-out-of-range' error is signaled if POS is outside the -buffer's accessible portion. */) +is before LIMIT, then LIMIT will be returned instead. */) (pos, escape_from_edge, limit) Lisp_Object pos, escape_from_edge, limit; { @@ -699,10 +687,7 @@ If POS is nil, the value of point is used for POS. If ESCAPE-FROM-EDGE is non-nil and POS is at the end of its field, then the end of the *following* field is returned. If LIMIT is non-nil, it is a buffer position; if the end of the field -is after LIMIT, then LIMIT will be returned instead. - -An `args-out-of-range' error is signaled if POS is outside the -buffer's accessible portion. */) +is after LIMIT, then LIMIT will be returned instead. */) (pos, escape_from_edge, limit) Lisp_Object pos, escape_from_edge, limit; { -- cgit v1.2.1 From 0f42ea765f6efc819b38e28343ed35f81022d37b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 30 Jul 2006 12:45:36 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 9f293bc1025..7f62aebf9e6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-07-30 Thien-Thi Nguyen + + * editfns.c: Undo 2006-06-27 change. + 2006-07-29 Eli Zaretskii * coding.c (Ffind_operation_coding_system): Revert the change from @@ -7,7 +11,7 @@ 2006-07-28 Richard Stallman - * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p): + * xfaces.c (lookup_named_face, Fdisplay_supports_face_attributes_p): Add conditional aborts for clarity. * xdisp.c (update_menu_bar): New arg HOOKS_RUN. Callers changed. -- cgit v1.2.1 From 0885202f7213195d276ad9d4fa9db3b2c97efba0 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 1 Aug 2006 00:12:55 +0000 Subject: *** empty log message *** --- src/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 7f62aebf9e6..08590d793da 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2006-08-01 Kim F. Storm + + * process.c (wait_reading_process_output_unwind): New function. + Restores waiting_for_user_input_p to saved value. + (wait_reading_process_output): Unwind protect waiting_for_user_input_p + instead of save/restore old value on stack. + 2006-07-30 Thien-Thi Nguyen * editfns.c: Undo 2006-06-27 change. -- cgit v1.2.1 From 2beb96f9ccc60babc90159ea1508966d93d2c0db Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 1 Aug 2006 00:13:08 +0000 Subject: (wait_reading_process_output_unwind): New function. Restores waiting_for_user_input_p to saved value. (wait_reading_process_output): Unwind protect waiting_for_user_input_p instead of save/restore old value on stack. --- src/process.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/process.c b/src/process.c index 857d7494c69..b24dee002c6 100644 --- a/src/process.c +++ b/src/process.c @@ -4158,6 +4158,14 @@ server_accept_connection (server, channel) when not inside wait_reading_process_output. */ static int waiting_for_user_input_p; +static Lisp_Object +wait_reading_process_output_unwind (data) + Lisp_Object data; +{ + waiting_for_user_input_p = XINT (data); + return Qnil; +} + /* This is here so breakpoints can be put on it. */ static void wait_reading_process_output_1 () @@ -4240,9 +4248,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, EMACS_TIME timeout, end_time; int wait_channel = -1; int got_some_input = 0; - /* Either nil or a cons cell, the car of which is of interest and - may be changed outside of this routine. */ - int saved_waiting_for_user_input_p = waiting_for_user_input_p; + int count = SPECPDL_INDEX (); FD_ZERO (&Available); #ifdef NON_BLOCKING_CONNECT @@ -4253,6 +4259,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, if (wait_proc != NULL) wait_channel = XINT (wait_proc->infd); + record_unwind_protect (wait_reading_process_output_unwind, + make_number (waiting_for_user_input_p)); waiting_for_user_input_p = read_kbd; /* Since we may need to wait several times, @@ -4879,7 +4887,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, } /* end for each file descriptor */ } /* end while exit conditions not met */ - waiting_for_user_input_p = saved_waiting_for_user_input_p; + unbind_to (count, Qnil); /* If calling from keyboard input, do not quit since we want to return C-g as an input character. -- cgit v1.2.1 From d634a67054364f0a1d1ddad6791fe69186505fbe Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 3 Aug 2006 15:19:20 +0000 Subject: * process.c: Revert last change. --- src/ChangeLog | 4 ++++ src/process.c | 18 ++++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 08590d793da..78cfea5dff2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-03 Chong Yidong + + * process.c: Revert last change. + 2006-08-01 Kim F. Storm * process.c (wait_reading_process_output_unwind): New function. diff --git a/src/process.c b/src/process.c index b24dee002c6..dc70ef37761 100644 --- a/src/process.c +++ b/src/process.c @@ -4158,14 +4158,6 @@ server_accept_connection (server, channel) when not inside wait_reading_process_output. */ static int waiting_for_user_input_p; -static Lisp_Object -wait_reading_process_output_unwind (data) - Lisp_Object data; -{ - waiting_for_user_input_p = XINT (data); - return Qnil; -} - /* This is here so breakpoints can be put on it. */ static void wait_reading_process_output_1 () @@ -4248,7 +4240,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, EMACS_TIME timeout, end_time; int wait_channel = -1; int got_some_input = 0; - int count = SPECPDL_INDEX (); + /* We can't record_unwind_protect here because after the + set_waiting_for_input call, C-g (interrupt_signal) would run + throw_to_read_char instead of Fsignal, which means unbind_to + doesn't get called. */ + int saved_waiting_for_user_input_p = waiting_for_user_input_p; FD_ZERO (&Available); #ifdef NON_BLOCKING_CONNECT @@ -4259,8 +4255,6 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, if (wait_proc != NULL) wait_channel = XINT (wait_proc->infd); - record_unwind_protect (wait_reading_process_output_unwind, - make_number (waiting_for_user_input_p)); waiting_for_user_input_p = read_kbd; /* Since we may need to wait several times, @@ -4887,7 +4881,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, } /* end for each file descriptor */ } /* end while exit conditions not met */ - unbind_to (count, Qnil); + waiting_for_user_input_p = saved_waiting_for_user_input_p; /* If calling from keyboard input, do not quit since we want to return C-g as an input character. -- cgit v1.2.1 From f3e0a6de08025d4f77a55b74a28760cc9a5e30e7 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Thu, 3 Aug 2006 22:08:09 +0000 Subject: (w32_menu_show, w32_dialog_show): Call Fsignal to quit when no option selected except when for_click. --- src/ChangeLog | 5 +++++ src/w32menu.c | 6 ++++++ 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 78cfea5dff2..1a70edd2a07 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-03 Jason Rumney + + * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit + when no option selected. + 2006-08-03 Chong Yidong * process.c: Revert last change. diff --git a/src/w32menu.c b/src/w32menu.c index 389e6c5b856..11af1d66b6f 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1994,6 +1994,9 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) } } } + else if (!for_click) + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); return Qnil; } @@ -2186,6 +2189,9 @@ w32_dialog_show (f, keymaps, title, header, error) } } } + else + /* Make "Cancel" equivalent to C-g. */ + Fsignal (Qquit, Qnil); return Qnil; } -- cgit v1.2.1 From dc3ca1078f41aaf51d84fe06f9cdf22672b8a85e Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 4 Aug 2006 01:41:14 +0000 Subject: (x_query_font): Compare names by ignoring case. --- src/xterm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xterm.c b/src/xterm.c index 5e4eeb3bb64..4203411e888 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10056,8 +10056,8 @@ x_query_font (f, fontname) for (i = 0; i < dpyinfo->n_fonts; i++) if (dpyinfo->font_table[i].name - && (!strcmp (dpyinfo->font_table[i].name, fontname) - || !strcmp (dpyinfo->font_table[i].full_name, fontname))) + && (!strcasecmp (dpyinfo->font_table[i].name, fontname) + || !strcasecmp (dpyinfo->font_table[i].full_name, fontname))) return (dpyinfo->font_table + i); return NULL; } -- cgit v1.2.1 From ef8f7cddb377a5fd5b8ec6549ded05bb9aa3da81 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 4 Aug 2006 01:49:05 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1a70edd2a07..b81ffed78b1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-04 Kenichi Handa + + * xterm.c (x_query_font): Compare names by ignoring case. + 2006-08-03 Jason Rumney * w32menu.c (w32_menu_show, w32_dialog_show): Call Fsignal to quit -- cgit v1.2.1 From 6f64cebf164a4a613f445aa32e70e95ba6a50d45 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 4 Aug 2006 02:50:10 +0000 Subject: (w32_query_font): Compare names by ignoring case. --- src/ChangeLog | 2 ++ src/w32fns.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b81ffed78b1..faa7db9b206 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2006-08-04 Kenichi Handa + * w32fns.c (w32_query_font): Compare names by ignoring case. + * xterm.c (x_query_font): Compare names by ignoring case. 2006-08-03 Jason Rumney diff --git a/src/w32fns.c b/src/w32fns.c index 68fcced88c2..a3df8de5338 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6207,7 +6207,7 @@ w32_query_font (struct frame *f, char *fontname) for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) { - if (strcmp(pfi->name, fontname) == 0) return pfi; + if (strcasecmp(pfi->name, fontname) == 0) return pfi; } return NULL; -- cgit v1.2.1 From df70725f7a2437a7c1edc39b4119a30016c84690 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Aug 2006 11:36:02 +0000 Subject: (w32_createwindow): Handle -geometry command line option and the geometry settings in the Registry. --- src/w32fns.c | 39 ++++++++++++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/w32fns.c b/src/w32fns.c index a3df8de5338..4c933f0631e 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -2066,7 +2066,8 @@ w32_createwindow (f) { HWND hwnd; RECT rect; - Lisp_Object top, left; + Lisp_Object top = Qunbound; + Lisp_Object left = Qunbound; rect.left = rect.top = 0; rect.right = FRAME_PIXEL_WIDTH (f); @@ -2079,13 +2080,41 @@ w32_createwindow (f) if (!hprevinst) { + Lisp_Object ifa; + w32_init_class (hinst); + + /* Handle the -geometry command line option and the geometry + settings in the registry. They are decoded and put into + initial-frame-alist by w32-win.el:x-handle-geometry. */ + ifa = Fsymbol_value (intern ("initial-frame-alist")); + if (CONSP (ifa)) + { + Lisp_Object lt = Fassq (Qleft, ifa); + Lisp_Object tp = Fassq (Qtop, ifa); + + if (!NILP (lt)) + { + lt = XCDR (lt); + if (INTEGERP (lt)) + left = lt; + } + if (!NILP (tp)) + { + tp = XCDR (tp); + if (INTEGERP (tp)) + top = tp; + } + } } - /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero - for anything that is not a number and is not Qunbound. */ - left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); - top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + if (EQ (left, Qunbound) && EQ (top, Qunbound)) + { + /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero + for anything that is not a number and is not Qunbound. */ + left = w32_get_arg (Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER); + top = w32_get_arg (Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER); + } FRAME_W32_WINDOW (f) = hwnd = CreateWindow (EMACS_CLASS, -- cgit v1.2.1 From 316a275a1e626f7689affcf96f4e98953a6b5c97 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Aug 2006 11:43:45 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index faa7db9b206..52847a7fe1f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-04 Ralf Angeli + + * w32fns.c (w32_createwindow): Handle -geometry command line option + and the geometry settings in the Registry. + 2006-08-04 Kenichi Handa * w32fns.c (w32_query_font): Compare names by ignoring case. -- cgit v1.2.1 From 0f2e2a3bbc74a84038de18603e5d734f38fa9db4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 4 Aug 2006 15:22:09 +0000 Subject: (Fsubst_char_in_region): Redo the setup work after running the before-change-functions since they may have altered the buffer. --- src/ChangeLog | 5 +++++ src/editfns.c | 24 +++++++++++++++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 52847a7fe1f..49c4649d144 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-04 Stefan Monnier + + * editfns.c (Fsubst_char_in_region): Redo the setup work after running + the before-change-functions since they may have altered the buffer. + 2006-08-04 Ralf Angeli * w32fns.c (w32_createwindow): Handle -geometry command line option diff --git a/src/editfns.c b/src/editfns.c index e692204c702..8ac61f3d006 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2691,6 +2691,10 @@ Both characters must have the same length of multi-byte form. */) Lisp_Object start, end, fromchar, tochar, noundo; { register int pos, pos_byte, stop, i, len, end_byte; + /* Keep track of the first change in the buffer: + if 0 we haven't found it yet. + if < 0 we've found it and we've run the before-change-function. + if > 0 we've actually performed it and the value is its position. */ int changed = 0; unsigned char fromstr[MAX_MULTIBYTE_LENGTH], tostr[MAX_MULTIBYTE_LENGTH]; unsigned char *p; @@ -2703,6 +2707,8 @@ Both characters must have the same length of multi-byte form. */) int last_changed = 0; int multibyte_p = !NILP (current_buffer->enable_multibyte_characters); + restart: + validate_region (&start, &end); CHECK_NUMBER (fromchar); CHECK_NUMBER (tochar); @@ -2740,7 +2746,7 @@ Both characters must have the same length of multi-byte form. */) That's faster than getting rid of things, and it prevents even the entry for a first change. Also inhibit locking the file. */ - if (!NILP (noundo)) + if (!changed && !NILP (noundo)) { record_unwind_protect (subst_char_in_region_unwind, current_buffer->undo_list); @@ -2774,10 +2780,14 @@ Both characters must have the same length of multi-byte form. */) && (len == 2 || (p[2] == fromstr[2] && (len == 3 || p[3] == fromstr[3])))))) { - if (! changed) + if (changed < 0) + /* We've already seen this and run the before-change-function; + this time we only need to record the actual position. */ + changed = pos; + else if (!changed) { - changed = pos; - modify_region (current_buffer, changed, XINT (end)); + changed = -1; + modify_region (current_buffer, pos, XINT (end)); if (! NILP (noundo)) { @@ -2786,6 +2796,10 @@ Both characters must have the same length of multi-byte form. */) if (MODIFF - 1 == current_buffer->auto_save_modified) current_buffer->auto_save_modified++; } + + /* The before-change-function may have moved the gap + or even modified the buffer so we should start over. */ + goto restart; } /* Take care of the case where the new character @@ -2838,7 +2852,7 @@ Both characters must have the same length of multi-byte form. */) pos++; } - if (changed) + if (changed > 0) { signal_after_change (changed, last_changed - changed, last_changed - changed); -- cgit v1.2.1 From 3046c3f9246fde1c93c30bce6c011204333de29f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 4 Aug 2006 17:22:18 +0000 Subject: (w32_query_font): Fix last change: use stricmp. --- src/ChangeLog | 4 ++++ src/w32fns.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 49c4649d144..59be848bf58 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-04 Eli Zaretskii + + * w32fns.c (w32_query_font): Fix last change: use stricmp. + 2006-08-04 Stefan Monnier * editfns.c (Fsubst_char_in_region): Redo the setup work after running diff --git a/src/w32fns.c b/src/w32fns.c index 4c933f0631e..e1cae4f3eb4 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6236,7 +6236,7 @@ w32_query_font (struct frame *f, char *fontname) for (i = 0; i < one_w32_display_info.n_fonts ;i++, pfi++) { - if (strcasecmp(pfi->name, fontname) == 0) return pfi; + if (stricmp(pfi->name, fontname) == 0) return pfi; } return NULL; -- cgit v1.2.1 From 092869b9735590049a4be576970c95dc4b53af75 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 5 Aug 2006 01:38:21 +0000 Subject: * keyboard.c (read_char): Rebalance specpdl after receiving jump. --- src/ChangeLog | 6 ++++++ src/keyboard.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 59be848bf58..aa025125067 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-08-04 Chong Yidong + + * keyboard.c (read_char): Rebalance specpdl after receiving jump. + + * process.c: Reapply 2006-08-01 change. + 2006-08-04 Eli Zaretskii * w32fns.c (w32_query_font): Fix last change: use stricmp. diff --git a/src/keyboard.c b/src/keyboard.c index 95d880d1209..a4e1c98c013 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2403,7 +2403,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) EMACS_TIME *end_time; { volatile Lisp_Object c; - int count; + int count, jmpcount; jmp_buf local_getcjmp; jmp_buf save_jump; volatile int key_already_recorded = 0; @@ -2629,11 +2629,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) around any call to sit_for or kbd_buffer_get_event; it *must not* be in effect when we call redisplay. */ + jmpcount = SPECPDL_INDEX (); if (_setjmp (local_getcjmp)) { /* We must have saved the outer value of getcjmp here, so restore it now. */ restore_getcjmp (save_jump); + unbind_to (jmpcount, Qnil); XSETINT (c, quit_char); internal_last_event_frame = selected_frame; Vlast_event_frame = internal_last_event_frame; -- cgit v1.2.1 From 42ec1561cfb550dc580dd3e163b21289780a2a72 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 5 Aug 2006 01:38:42 +0000 Subject: * process.c: Reapply 2006-08-01 change. --- src/process.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/process.c b/src/process.c index dc70ef37761..b24dee002c6 100644 --- a/src/process.c +++ b/src/process.c @@ -4158,6 +4158,14 @@ server_accept_connection (server, channel) when not inside wait_reading_process_output. */ static int waiting_for_user_input_p; +static Lisp_Object +wait_reading_process_output_unwind (data) + Lisp_Object data; +{ + waiting_for_user_input_p = XINT (data); + return Qnil; +} + /* This is here so breakpoints can be put on it. */ static void wait_reading_process_output_1 () @@ -4240,11 +4248,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, EMACS_TIME timeout, end_time; int wait_channel = -1; int got_some_input = 0; - /* We can't record_unwind_protect here because after the - set_waiting_for_input call, C-g (interrupt_signal) would run - throw_to_read_char instead of Fsignal, which means unbind_to - doesn't get called. */ - int saved_waiting_for_user_input_p = waiting_for_user_input_p; + int count = SPECPDL_INDEX (); FD_ZERO (&Available); #ifdef NON_BLOCKING_CONNECT @@ -4255,6 +4259,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, if (wait_proc != NULL) wait_channel = XINT (wait_proc->infd); + record_unwind_protect (wait_reading_process_output_unwind, + make_number (waiting_for_user_input_p)); waiting_for_user_input_p = read_kbd; /* Since we may need to wait several times, @@ -4881,7 +4887,7 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, } /* end for each file descriptor */ } /* end while exit conditions not met */ - waiting_for_user_input_p = saved_waiting_for_user_input_p; + unbind_to (count, Qnil); /* If calling from keyboard input, do not quit since we want to return C-g as an input character. -- cgit v1.2.1 From 6b657e423e2e10e4d9f7061e76cd3f8f3fcff7b7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 12:00:32 +0000 Subject: (kbd_buffer_get_event): Return Qnil when current time is exactly equal to end_time, not only when it is past that. --- src/ChangeLog | 5 +++++ src/keyboard.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index aa025125067..28109540800 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-05 Eli Zaretskii + + * keyboard.c (kbd_buffer_get_event): Return Qnil when current time + is exactly equal to end_time, not only when it is past that. + 2006-08-04 Chong Yidong * keyboard.c (read_char): Rebalance specpdl after receiving jump. diff --git a/src/keyboard.c b/src/keyboard.c index a4e1c98c013..6f12994a1b8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3954,13 +3954,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time) { EMACS_TIME duration; EMACS_GET_TIME (duration); - EMACS_SUB_TIME (duration, *end_time, duration); - if (EMACS_TIME_NEG_P (duration)) - return Qnil; + if (EMACS_TIME_GE (duration, *end_time)) + return Qnil; /* finished waiting */ else - wait_reading_process_output (EMACS_SECS (duration), - EMACS_USECS (duration), - -1, 1, Qnil, NULL, 0); + { + EMACS_SUB_TIME (duration, *end_time, duration); + wait_reading_process_output (EMACS_SECS (duration), + EMACS_USECS (duration), + -1, 1, Qnil, NULL, 0); + } } else wait_reading_process_output (0, 0, -1, 1, Qnil, NULL, 0); -- cgit v1.2.1 From ed91b2add33be7f813979c8c64e5cd92758d75fc Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:01:10 +0000 Subject: (w32_valid_pointer_p): New function. --- src/w32.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src') diff --git a/src/w32.c b/src/w32.c index c093eab599e..0da908ff932 100644 --- a/src/w32.c +++ b/src/w32.c @@ -323,6 +323,28 @@ w32_strerror (int error_no) return buf; } +/* Return 1 if P is a valid pointer to an object of size SIZE. Return + 0 if P is NOT a valid pointer. Return -1 if we cannot validate P. + + This is called from alloc.c:valid_pointer_p. */ +int +w32_valid_pointer_p (void *p, int size) +{ + SIZE_T done; + HANDLE h = OpenProcess (PROCESS_VM_READ, FALSE, GetCurrentProcessId ()); + + if (h) + { + unsigned char *buf = alloca (size); + int retval = ReadProcessMemory (h, p, buf, size, &done); + + CloseHandle (h); + return retval; + } + else + return -1; +} + static char startup_dir[MAXPATHLEN]; /* Get the current working directory. */ -- cgit v1.2.1 From 0c5c0e3dfe9396982d70d155430ec441867b3629 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:01:25 +0000 Subject: Add prototype for w32_valid_pointer_p. --- src/w32.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/w32.h b/src/w32.h index 1d5dbee6d40..6ba25a42403 100644 --- a/src/w32.h +++ b/src/w32.h @@ -110,6 +110,9 @@ extern void delete_child (child_process *cp); /* Equivalent of strerror for W32 error codes. */ extern char * w32_strerror (int error_no); +/* Validate a pointer. */ +extern int w32_valid_pointer_p (void *, int); + /* Get long (aka "true") form of file name, if it exists. */ extern BOOL w32_get_long_filename (char * name, char * buf, int size); -- cgit v1.2.1 From f892cf9c9d14e5920ad5c8ce236bd660f18c0816 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:01:50 +0000 Subject: Include w32.h. (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do the job. --- src/alloc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/alloc.c b/src/alloc.c index e5735e03fd9..eb7acfd649f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -80,6 +80,7 @@ extern POINTER_TYPE *sbrk (); #ifdef WINDOWSNT #include +#include "w32.h" #endif #ifdef DOUG_LEA_MALLOC @@ -4615,6 +4616,9 @@ int valid_pointer_p (p) void *p; { +#ifdef WINDOWSNT + return w32_valid_pointer_p (p, 16); +#else int fd; /* Obviously, we cannot just access it (we would SEGV trying), so we @@ -4631,6 +4635,7 @@ valid_pointer_p (p) } return -1; +#endif } /* Return 1 if OBJ is a valid lisp object. -- cgit v1.2.1 From 0a3297f7bbfced678d4cd242d5c5eeb59fa57878 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 5 Aug 2006 13:31:11 +0000 Subject: *** empty log message *** --- src/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 28109540800..80d99505c44 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2006-08-05 Eli Zaretskii + * w32.c (w32_valid_pointer_p): New function. + + * w32.h: Add prototype for w32_valid_pointer_p. + + * alloc.c: Include w32.h. + (valid_lisp_object_p) [WINDOWSNT]: Call w32_valid_pointer_p to do + the job. + * keyboard.c (kbd_buffer_get_event): Return Qnil when current time is exactly equal to end_time, not only when it is past that. -- cgit v1.2.1 From 43ed3b8da0c563a5fec8708cada2ee39411062ec Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 6 Aug 2006 14:22:24 +0000 Subject: * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. (Fkill_all_local_variables): Use it. (syms_of_buffer): Defvar it. --- src/ChangeLog | 6 ++++++ src/buffer.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 80d99505c44..2e0563e44a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-08-06 Chong Yidong + + * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. + (Fkill_all_local_variables): Use it. + (syms_of_buffer): Defvar it. + 2006-08-05 Eli Zaretskii * w32.c (w32_valid_pointer_p): New function. diff --git a/src/buffer.c b/src/buffer.c index fcb842de83c..3502afc9bf0 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -146,6 +146,9 @@ Lisp_Object Vinhibit_read_only; Lisp_Object Vkill_buffer_query_functions; Lisp_Object Qkill_buffer_query_functions; +/* Hook run before changing a major mode. */ +Lisp_Object Vchange_major_mode_hook, Qchange_major_mode_hook; + /* List of functions to call before changing an unmodified buffer. */ Lisp_Object Vfirst_change_hook; @@ -2386,7 +2389,7 @@ the normal hook `change-major-mode-hook'. */) Lisp_Object oalist; if (!NILP (Vrun_hooks)) - call1 (Vrun_hooks, intern ("change-major-mode-hook")); + call1 (Vrun_hooks, Qchange_major_mode_hook); oalist = current_buffer->local_var_alist; /* Make sure none of the bindings in oalist @@ -5998,6 +6001,13 @@ t means to use hollow box cursor. See `cursor-type' for other values. */); doc: /* List of functions called with no args to query before killing a buffer. */); Vkill_buffer_query_functions = Qnil; + DEFVAR_LISP ("change-major-mode-hook", &Vchange_major_mode_hook, + doc: /* Normal hook run before changing the major mode of a buffer. +The function `kill-all-local-variables' runs this before doing anything else. */); + Vchange_major_mode_hook = Qnil; + Qchange_major_mode_hook = intern ("change-major-mode-hook"); + staticpro (&Qchange_major_mode_hook); + defsubr (&Sbuffer_live_p); defsubr (&Sbuffer_list); defsubr (&Sget_buffer); -- cgit v1.2.1 From 614869993024153d5c7167ca78a9013cb0f95fc4 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 7 Aug 2006 16:39:36 +0000 Subject: (BASE_PURESIZE): Increase to 1120000. --- src/ChangeLog | 4 ++++ src/puresize.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 2e0563e44a7..7c0408196aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-07 Andreas Schwab + + * puresize.h (BASE_PURESIZE): Increase to 1120000. + 2006-08-06 Chong Yidong * buffer.c (Vchange_major_mode_hook, Qchange_major_mode_hook): New vars. diff --git a/src/puresize.h b/src/puresize.h index bae7cbb6d6a..5dd374af207 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA. */ #endif #ifndef BASE_PURESIZE -#define BASE_PURESIZE (1102000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) +#define BASE_PURESIZE (1120000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) #endif /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ -- cgit v1.2.1 From 2c53e699a1a9705755ca239da5acfdf32fd77ac9 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 9 Aug 2006 01:25:03 +0000 Subject: (syms_of_coding): Improve the docstring file-coding-system-alist. --- src/coding.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/coding.c b/src/coding.c index 1af7b4c0d52..ae9f6749792 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7968,8 +7968,9 @@ the file contents. If VAL is a cons of coding systems, the car part is used for decoding, and the cdr part is used for encoding. If VAL is a function symbol, the function must return a coding system -or a cons of coding systems which are used as above. The function gets -the arguments with which `find-operation-coding-system' was called. +or a cons of coding systems which are used as above. The function is +called with an argument that is a list of the arguments with which +`find-operation-coding-system' was called. See also the function `find-operation-coding-system' and the variable `auto-coding-alist'. */); -- cgit v1.2.1 From bb0825cb7d70a290d61946d53f2a665ce8a4a14c Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 9 Aug 2006 01:25:59 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 7c0408196aa..9d23a23e6a5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-09 Kenichi Handa + + * coding.c (syms_of_coding): Improve the docstring + file-coding-system-alist. + 2006-08-07 Andreas Schwab * puresize.h (BASE_PURESIZE): Increase to 1120000. -- cgit v1.2.1 From c2028ac64fab925570fa9ef7e1ed564f4aa3eb2c Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 9 Aug 2006 04:55:10 +0000 Subject: (keyremap_step): No-op if fkey->parent = nil. (read_key_sequence): Always start fkey.start and fkey.end at 0, and likewise for keytran. --- src/ChangeLog | 6 ++++++ src/keyboard.c | 25 ++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 9d23a23e6a5..678078d3781 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-08-09 Richard Stallman + + * keyboard.c (keyremap_step): No-op if fkey->parent = nil. + (read_key_sequence): Always start fkey.start and fkey.end at 0, + and likewise for keytran. + 2006-08-09 Kenichi Handa * coding.c (syms_of_coding): Improve the docstring diff --git a/src/keyboard.c b/src/keyboard.c index 6f12994a1b8..ae3b78b04d2 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8385,7 +8385,15 @@ follow_key (key, nmaps, current, defs, next) such as Vfunction_key_map and Vkey_translation_map. */ typedef struct keyremap { - Lisp_Object map, parent; + /* This is the map originally specified for this use. */ + Lisp_Object parent; + /* This is a submap reached by looking up, in PARENT, + the events from START to END. */ + Lisp_Object map; + /* Positions [START, END) in the key sequence buffer + are the key that we have scanned so far. + Those events are the ones that we will replace + if PAREHT maps them into a key sequence. */ int start, end; } keyremap; @@ -8458,7 +8466,11 @@ keyremap_step (keybuf, bufsize, fkey, input, doit, diff, prompt) Lisp_Object next, key; key = keybuf[fkey->end++]; - next = access_keymap_keyremap (fkey->map, key, prompt, doit); + + if (KEYMAPP (fkey->parent)) + next = access_keymap_keyremap (fkey->map, key, prompt, doit); + else + next = Qnil; /* If keybuf[fkey->start..fkey->end] is bound in the map and we're in a position to do the key remapping, replace it with @@ -8656,9 +8668,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, delayed_switch_frame = Qnil; fkey.map = fkey.parent = Vfunction_key_map; keytran.map = keytran.parent = Vkey_translation_map; - /* If there is no translation-map, turn off scanning. */ - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; if (INTERACTIVE) { @@ -9486,8 +9497,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, keybuf[t - 1] = new_key; mock_input = max (t, mock_input); - fkey.start = fkey.end = KEYMAPP (fkey.map) ? 0 : bufsize + 1; - keytran.start = keytran.end = KEYMAPP (keytran.map) ? 0 : bufsize + 1; + fkey.start = fkey.end = 0; + keytran.start = keytran.end = 0; goto replay_sequence; } -- cgit v1.2.1 From 0e94a24a871c7032b29bb971abdd0353d5ace084 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Thu, 10 Aug 2006 06:06:48 +0000 Subject: * keyboard.h: Declare in_sighandler. --- src/keyboard.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/keyboard.h b/src/keyboard.h index 96ac7d2e856..f8d8f789c08 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -190,6 +190,9 @@ extern EMACS_INT num_nonmacro_input_events; /* Nonzero means polling for input is temporarily suppressed. */ extern int poll_suppress_count; +/* Nonzero if we are executing from the SIGIO signal handler. */ +extern int in_sighandler; + /* Keymap mapping ASCII function key sequences onto their preferred forms. Initialized by the terminal-specific lisp files. */ extern Lisp_Object Vfunction_key_map; -- cgit v1.2.1 From 90b03d58966b9bb4f8de4f4b5fcbb24cec70b45a Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Thu, 10 Aug 2006 06:07:15 +0000 Subject: * keyboard.c: Define in_sighandler. (input_available_signal): Set in_sighandler. --- src/keyboard.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index ae3b78b04d2..c715eadeb80 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -100,6 +100,9 @@ int interrupt_input_pending; /* File descriptor to use for input. */ extern int input_fd; +/* Nonzero if we are executing from the SIGIO signal handler. */ +int in_sighandler; + #ifdef HAVE_WINDOW_SYSTEM /* Make all keyboard buffers much bigger when using X windows. */ #ifdef MAC_OS8 @@ -6924,6 +6927,8 @@ input_available_signal (signo) SIGNAL_THREAD_CHECK (signo); #endif + in_sighandler = 1; + if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); @@ -6935,6 +6940,7 @@ input_available_signal (signo) sigfree (); #endif errno = old_errno; + in_sighandler = 0; } #endif /* SIGIO */ @@ -10802,6 +10808,7 @@ init_keyboard () do_mouse_tracking = Qnil; #endif input_pending = 0; + in_sighandler = 0; /* This means that command_loop_1 won't try to select anything the first time through. */ -- cgit v1.2.1 From 0d3e774694d20e3cf496204fad3447bac9f13d55 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Thu, 10 Aug 2006 06:09:30 +0000 Subject: * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler to check if mutex should be locked or not. --- src/alloc.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/alloc.c b/src/alloc.c index eb7acfd649f..192b974196f 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -130,17 +130,27 @@ static pthread_mutex_t alloc_mutex; #define BLOCK_INPUT_ALLOC \ do \ { \ - pthread_mutex_lock (&alloc_mutex); \ - if (pthread_self () == main_thread) \ - BLOCK_INPUT; \ + if (!in_sighandler) \ + { \ + pthread_mutex_lock (&alloc_mutex); \ + if (pthread_self () == main_thread) \ + BLOCK_INPUT; \ + else \ + sigblock (sigmask (SIGIO)); \ + } \ } \ while (0) #define UNBLOCK_INPUT_ALLOC \ do \ { \ - if (pthread_self () == main_thread) \ - UNBLOCK_INPUT; \ - pthread_mutex_unlock (&alloc_mutex); \ + if (!in_sighandler) \ + { \ + pthread_mutex_unlock (&alloc_mutex); \ + if (pthread_self () == main_thread) \ + UNBLOCK_INPUT; \ + else \ + sigunblock (sigmask (SIGIO)); \ + } \ } \ while (0) -- cgit v1.2.1 From abef1dd799261ccb87282c30ad61b87e31b4dadc Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Thu, 10 Aug 2006 06:09:57 +0000 Subject: * keyboard.c: Define in_sighandler. (input_available_signal): Set in_sighandler. (init_keyboard): Initialize in_sighandler. * keyboard.h: Declare in_sighandler. * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler to check if mutex should be locked or not. --- src/ChangeLog | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 678078d3781..abd06ed521c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2006-08-10 Jan Dj,Ad(Brv + + * keyboard.c: Define in_sighandler. + (input_available_signal): Set in_sighandler. + (init_keyboard): Initialize in_sighandler. + + * keyboard.h: Declare in_sighandler. + + * alloc.c (UNBLOCK_INPUT_ALLOC, BLOCK_INPUT_ALLOC): Use in_sighandler + to check if mutex should be locked or not. + 2006-08-09 Richard Stallman * keyboard.c (keyremap_step): No-op if fkey->parent = nil. -- cgit v1.2.1 From 9fc68699c62e1efe177e4dcce268ef74eef4dde9 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Fri, 11 Aug 2006 07:30:14 +0000 Subject: * xselect.c (Fx_register_dnd_atom): New function. (syms_of_xselect): Defsubr it. (x_handle_dnd_message): Check that message_type is in dpyinfo->x_dnd_atoms before generating lisp event. --- src/xselect.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xselect.c b/src/xselect.c index fcac2860359..013a52dbdb1 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2677,8 +2677,48 @@ If the value is 0 or the atom is not known, return the empty string. */) return ret; } -/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. - TODO: Check if this client event really is a DND event? */ +DEFUN ("x-register-dnd-atom", Fx_register_dnd_atom, + Sx_register_dnd_atom, 1, 2, 0, + doc: /* Request that dnd events are made for ClientMessages with ATOM. +ATOM can be a symbol or a string. The ATOM is interned on the display that +FRAME is on. If FRAME is nil, the selected frame is used. */) + (atom, frame) + Lisp_Object atom, frame; +{ + Atom x_atom; + struct frame *f = check_x_frame (frame); + size_t i; + struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + + + if (SYMBOLP (atom)) + x_atom = symbol_to_x_atom (dpyinfo, FRAME_X_DISPLAY (f), atom); + else if (STRINGP (atom)) + { + BLOCK_INPUT; + x_atom = XInternAtom (FRAME_X_DISPLAY (f), (char *) SDATA (atom), False); + UNBLOCK_INPUT; + } + else + error ("ATOM must be a symbol or a string"); + + for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) + if (dpyinfo->x_dnd_atoms[i] == x_atom) + return Qnil; + + if (dpyinfo->x_dnd_atoms_length == dpyinfo->x_dnd_atoms_size) + { + dpyinfo->x_dnd_atoms_size *= 2; + dpyinfo->x_dnd_atoms = xrealloc (dpyinfo->x_dnd_atoms, + sizeof (*dpyinfo->x_dnd_atoms) + * dpyinfo->x_dnd_atoms_size); + } + + dpyinfo->x_dnd_atoms[dpyinfo->x_dnd_atoms_length++] = x_atom; + return Qnil; +} + +/* Convert an XClientMessageEvent to a Lisp event of type DRAG_N_DROP_EVENT. */ int x_handle_dnd_message (f, event, dpyinfo, bufp) @@ -2694,6 +2734,12 @@ x_handle_dnd_message (f, event, dpyinfo, bufp) int x, y; unsigned char *data = (unsigned char *) event->data.b; int idata[5]; + size_t i; + + for (i = 0; i < dpyinfo->x_dnd_atoms_length; ++i) + if (dpyinfo->x_dnd_atoms[i] == event->message_type) break; + + if (i == dpyinfo->x_dnd_atoms_length) return 0; XSETFRAME (frame, f); @@ -2867,6 +2913,7 @@ syms_of_xselect () defsubr (&Sx_get_atom_name); defsubr (&Sx_send_client_message); + defsubr (&Sx_register_dnd_atom); reading_selection_reply = Fcons (Qnil, Qnil); staticpro (&reading_selection_reply); -- cgit v1.2.1 From 9f562c51d616d1e534771600368e16705269c625 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Fri, 11 Aug 2006 07:30:36 +0000 Subject: * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track of drag and drop Atoms. --- src/xterm.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/xterm.h b/src/xterm.h index 10a9aaa2961..9aa1d8fcacb 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -389,6 +389,12 @@ struct x_display_info X_WMTYPE_A, X_WMTYPE_B } wm_type; + + + /* Atoms that are drag and drop atoms */ + Atom *x_dnd_atoms; + size_t x_dnd_atoms_size; + size_t x_dnd_atoms_length; }; #ifdef HAVE_X_I18N -- cgit v1.2.1 From 93acf8f34d3cdbe9e23f0207ff6285c759c67bef Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Fri, 11 Aug 2006 07:30:56 +0000 Subject: * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms* --- src/xterm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/xterm.c b/src/xterm.c index 4203411e888..6fb9ee28f42 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10584,6 +10584,11 @@ x_term_init (display_name, xrm_option, resource_name) dpyinfo->cut_buffers_initialized = 0; + dpyinfo->x_dnd_atoms_size = 8; + dpyinfo->x_dnd_atoms_length = 0; + dpyinfo->x_dnd_atoms = xmalloc (sizeof (*dpyinfo->x_dnd_atoms) + * dpyinfo->x_dnd_atoms_size); + connection = ConnectionNumber (dpyinfo->display); dpyinfo->connection = connection; -- cgit v1.2.1 From 0c584069b6212a25be12aa9edf2f713b03f54f5b Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Fri, 11 Aug 2006 07:31:14 +0000 Subject: * xselect.c (Fx_register_dnd_atom): New function. (syms_of_xselect): Defsubr it. (x_handle_dnd_message): Check that message_type is in dpyinfo->x_dnd_atoms before generating lisp event. * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track of drag and drop Atoms. * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms* --- src/ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index abd06ed521c..b4016b546c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2006-08-11 Jan Dj,Ad(Brv + + * xselect.c (Fx_register_dnd_atom): New function. + (syms_of_xselect): Defsubr it. + (x_handle_dnd_message): Check that message_type is in + dpyinfo->x_dnd_atoms before generating lisp event. + + * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track + of drag and drop Atoms. + + * xterm.c (x_term_init): Initialize dpyinfo->x_dnd_atoms* + + 2006-08-10 Jan Dj,Ad(Brv * keyboard.c: Define in_sighandler. -- cgit v1.2.1 From d0cd961e58fb5e421377fad88b1037546e9bec93 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 11:36:15 +0000 Subject: (Fmouse_position, Fmouse_pixel_position) (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix. --- src/frame.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/frame.c b/src/frame.c index 1fdeb129f89..82a016be69e 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1429,7 +1429,8 @@ The functions are run with one arg, the frame to be deleted. */) DEFUN ("mouse-position", Fmouse_position, Smouse_position, 0, 0, 0, doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. The position is given in character cells, where (0, 0) is the -upper-left corner. +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. If Emacs is running on a mouseless terminal or hasn't been programmed to read the mouse position, it returns the selected frame for FRAME and nil for X and Y. @@ -1477,7 +1478,8 @@ DEFUN ("mouse-pixel-position", Fmouse_pixel_position, Smouse_pixel_position, 0, 0, 0, doc: /* Return a list (FRAME X . Y) giving the current mouse frame and position. The position is given in pixel units, where (0, 0) is the -upper-left corner. +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. If Emacs is running on a mouseless terminal or hasn't been programmed to read the mouse position, it returns the selected frame for FRAME and nil for X and Y. */) @@ -1510,6 +1512,10 @@ Coordinates are relative to the frame, not a window, so the coordinates of the top left character in the frame may be nonzero due to left-hand scroll bars or the menu bar. +The position is given in character cells, where (0, 0) is the +upper-left corner of the frame, X is the horizontal offset, and Y is +the vertical offset. + This function is a no-op for an X frame that is not visible. If you have just created a frame, you must wait for it to become visible before calling this function on it, like this. @@ -1542,6 +1548,9 @@ before calling this function on it, like this. DEFUN ("set-mouse-pixel-position", Fset_mouse_pixel_position, Sset_mouse_pixel_position, 3, 3, 0, doc: /* Move the mouse pointer to pixel position (X,Y) in FRAME. +The position is given in pixels, where (0, 0) is the upper-left corner +of the frame, X is the horizontal offset, and Y is the vertical offset. + Note, this is a no-op for an X frame that is not visible. If you have just created a frame, you must wait for it to become visible before calling this function on it, like this. -- cgit v1.2.1 From e6b8d6628244c1978544b016006b9eac0310ef1f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 12 Aug 2006 12:34:47 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b4016b546c0..7f0932a4206 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-12 Eli Zaretskii + + * frame.c (Fmouse_position, Fmouse_pixel_position) + (Fset_mouse_position, Fset_mouse_pixel_position): Doc fix. + 2006-08-11 Jan Dj,Ad(Brv * xselect.c (Fx_register_dnd_atom): New function. -- cgit v1.2.1 From 9bdc2a5d70f1373b914d94cc8afb9fa82f320890 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 14 Aug 2006 09:58:03 +0000 Subject: *** empty log message *** --- src/ChangeLog | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 7f0932a4206..7bfc9a88967 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-14 Kim F. Storm + + * .gdbinit (pitx): Print iterator position. + Limit stack dump in case iterator is not initialized. + 2006-08-12 Eli Zaretskii * frame.c (Fmouse_position, Fmouse_pixel_position) @@ -7,7 +12,7 @@ * xselect.c (Fx_register_dnd_atom): New function. (syms_of_xselect): Defsubr it. - (x_handle_dnd_message): Check that message_type is in + (x_handle_dnd_message): Check that message_type is in dpyinfo->x_dnd_atoms before generating lisp event. * xterm.h (struct x_display_info): Add x_dnd_atoms* to keep track -- cgit v1.2.1 From 82d59cb0cabac3a51a23fe06b59a22bc14fa2000 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 14 Aug 2006 09:58:12 +0000 Subject: (pitx): Print iterator position. Limit stack dump in case iterator is not initialized. --- src/.gdbinit | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/.gdbinit b/src/.gdbinit index 564b3762bd7..a99b17e16fb 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -164,6 +164,10 @@ define pitx if ($it->current.pos.charpos != $it->current.pos.bytepos) printf "[%d]", $it->current.pos.bytepos end + printf " pos=%d", $it->position.charpos + if ($it->position.charpos != $it->position.bytepos) + printf "[%d]", $it->position.bytepos + end printf " start=%d", $it->start.pos.charpos if ($it->start.pos.charpos != $it->start.pos.bytepos) printf "[%d]", $it->start.pos.bytepos @@ -218,7 +222,7 @@ define pitx printf " max=%d+%d=%d", $it->max_ascent, $it->max_descent, $it->max_ascent+$it->max_descent printf "\n" set $i = 0 - while ($i < $it->sp) + while ($i < $it->sp && $i < 4) set $e = $it->stack[$i] printf "stack[%d]: ", $i output $e->method -- cgit v1.2.1 From 70282fce62e13117947dfb4151e93eeb60251d65 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 14 Aug 2006 18:32:23 +0000 Subject: * keyboard.c (read_char): Don't reset idle timers if a time limit is supplied. --- src/ChangeLog | 5 +++++ src/keyboard.c | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 7bfc9a88967..e97b91cf42e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-14 Chong Yidong + + * keyboard.c (read_char): Don't reset idle timers if a time limit + is supplied. + 2006-08-14 Kim F. Storm * .gdbinit (pitx): Print iterator position. diff --git a/src/keyboard.c b/src/keyboard.c index c715eadeb80..bea35a05731 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2679,7 +2679,14 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) goto non_reread; } - timer_start_idle (); + /* Start idle timers. If a time limit is supplied, we don't reset + idle timers. This avoids an infinite recursion in case an idle + timer calls `sit-for'. */ + + if (end_time) + timer_resume_idle (); + else + timer_start_idle (); /* If in middle of key sequence and minibuffer not active, start echoing if enough time elapses. */ @@ -2879,7 +2886,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* Actually read a character, waiting if necessary. */ save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); - timer_start_idle (); + if (end_time) + timer_resume_idle (); + else + timer_start_idle (); c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); restore_getcjmp (save_jump); -- cgit v1.2.1 From 8db1f9fa0c11f5c2e1f4e5eb94911b573f61fd6f Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 15 Aug 2006 02:42:21 +0000 Subject: (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC is exhausted, return with RET. (detect_coding_emacs_mule, detect_coding_iso2022) (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above change. --- src/ChangeLog | 9 +++++++++ src/coding.c | 61 ++++++++++++++++++++++++----------------------------------- 2 files changed, 34 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index e97b91cf42e..5026f4f10f8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2006-08-15 Kenichi Handa + + * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC + is exhausted, return with RET. + (detect_coding_emacs_mule, detect_coding_iso2022) + (detect_coding_sjis, detect_coding_big5, detect_coding_utf_8) + (detect_coding_utf_16, detect_coding_ccl): Adjusted for the above + change. + 2006-08-14 Chong Yidong * keyboard.c (read_char): Don't reset idle timers if a time limit diff --git a/src/coding.c b/src/coding.c index ae9f6749792..28e7a3fafc1 100644 --- a/src/coding.c +++ b/src/coding.c @@ -219,14 +219,15 @@ encode_coding_XXX (coding, source, destination, src_bytes, dst_bytes) /* Like ONE_MORE_BYTE, but 8-bit bytes of data at SRC are in multibyte - form if MULTIBYTEP is nonzero. */ + form if MULTIBYTEP is nonzero. In addition, if SRC is not less + than SRC_END, return with RET. */ -#define ONE_MORE_BYTE_CHECK_MULTIBYTE(c1, multibytep) \ +#define ONE_MORE_BYTE_CHECK_MULTIBYTE(c1, multibytep, ret) \ do { \ if (src >= src_end) \ { \ coding->result = CODING_FINISH_INSUFFICIENT_SRC; \ - goto label_end_of_loop; \ + return ret; \ } \ c1 = *src++; \ if (multibytep && c1 == LEADING_CODE_8_BIT_CONTROL) \ @@ -632,15 +633,15 @@ detect_coding_emacs_mule (src, src_end, multibytep) while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); - + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, + CODING_CATEGORY_MASK_EMACS_MULE); if (composing) { if (c < 0xA0) composing = 0; else if (c == 0xA0) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); c &= 0x7F; } else @@ -669,8 +670,6 @@ detect_coding_emacs_mule (src, src_end, multibytep) } } } - label_end_of_loop: - return CODING_CATEGORY_MASK_EMACS_MULE; } @@ -1425,9 +1424,9 @@ detect_coding_iso2022 (src, src_end, multibytep) Lisp_Object safe_chars; reg[0] = CHARSET_ASCII, reg[1] = reg[2] = reg[3] = -1; - while (mask && src < src_end) + while (mask) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); retry: switch (c) { @@ -1435,11 +1434,11 @@ detect_coding_iso2022 (src, src_end, multibytep) if (inhibit_iso_escape_detection) break; single_shifting = 0; - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); if (c >= '(' && c <= '/') { /* Designation sequence for a charset of dimension 1. */ - ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, mask & mask_found); if (c1 < ' ' || c1 >= 0x80 || (charset = iso_charset_table[0][c >= ','][c1]) < 0) /* Invalid designation sequence. Just ignore. */ @@ -1449,13 +1448,14 @@ detect_coding_iso2022 (src, src_end, multibytep) else if (c == '$') { /* Designation sequence for a charset of dimension 2. */ - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, mask & mask_found); if (c >= '@' && c <= 'B') /* Designation for JISX0208.1978, GB2312, or JISX0208. */ reg[0] = charset = iso_charset_table[1][0][c]; else if (c >= '(' && c <= '/') { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, + mask & mask_found); if (c1 < ' ' || c1 >= 0x80 || (charset = iso_charset_table[1][c >= ','][c1]) < 0) /* Invalid designation sequence. Just ignore. */ @@ -1630,7 +1630,8 @@ detect_coding_iso2022 (src, src_end, multibytep) c = -1; while (src < src_end) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, + mask & mask_found); if (c < 0xA0) break; i++; @@ -1648,7 +1649,6 @@ detect_coding_iso2022 (src, src_end, multibytep) break; } } - label_end_of_loop: return (mask & mask_found); } @@ -2919,20 +2919,18 @@ detect_coding_sjis (src, src_end, multibytep) while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_SJIS); if (c < 0x80) continue; if (c == 0x80 || c == 0xA0 || c > 0xEF) return 0; if (c <= 0x9F || c >= 0xE0) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); if (c < 0x40 || c == 0x7F || c > 0xFC) return 0; } } - label_end_of_loop: - return CODING_CATEGORY_MASK_SJIS; } /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". @@ -2951,17 +2949,15 @@ detect_coding_big5 (src, src_end, multibytep) while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_BIG5); if (c < 0x80) continue; if (c < 0xA1 || c > 0xFE) return 0; - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); if (c < 0x40 || (c > 0x7F && c < 0xA1) || c > 0xFE) return 0; } - label_end_of_loop: - return CODING_CATEGORY_MASK_BIG5; } /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". @@ -2989,7 +2985,7 @@ detect_coding_utf_8 (src, src_end, multibytep) while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_UTF_8); if (UTF_8_1_OCTET_P (c)) continue; else if (UTF_8_2_OCTET_LEADING_P (c)) @@ -3007,16 +3003,13 @@ detect_coding_utf_8 (src, src_end, multibytep) do { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, 0); if (!UTF_8_EXTRA_OCTET_P (c)) return 0; seq_maybe_bytes--; } while (seq_maybe_bytes > 0); } - - label_end_of_loop: - return CODING_CATEGORY_MASK_UTF_8; } /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". @@ -3045,15 +3038,13 @@ detect_coding_utf_16 (src, src_end, multibytep) struct coding_system dummy_coding; struct coding_system *coding = &dummy_coding; - ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep); - ONE_MORE_BYTE_CHECK_MULTIBYTE (c2, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c1, multibytep, 0); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c2, multibytep, 0); if ((c1 == 0xFF) && (c2 == 0xFE)) return CODING_CATEGORY_MASK_UTF_16_LE; else if ((c1 == 0xFE) && (c2 == 0xFF)) return CODING_CATEGORY_MASK_UTF_16_BE; - - label_end_of_loop: return 0; } @@ -3322,12 +3313,10 @@ detect_coding_ccl (src, src_end, multibytep) valid = coding_system_table[CODING_CATEGORY_IDX_CCL]->spec.ccl.valid_codes; while (1) { - ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep); + ONE_MORE_BYTE_CHECK_MULTIBYTE (c, multibytep, CODING_CATEGORY_MASK_CCL); if (! valid[c]) return 0; } - label_end_of_loop: - return CODING_CATEGORY_MASK_CCL; } -- cgit v1.2.1 From 3236e6b849ab228d0e0d466343f10b1202e1cf9d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 15 Aug 2006 17:39:21 +0000 Subject: * keyboard.c (read_char): Don't change idle timer state at all if end_time is supplied. --- src/ChangeLog | 5 +++++ src/keyboard.c | 25 ++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 5026f4f10f8..936f8a2546c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-15 Chong Yidong + + * keyboard.c (read_char): Don't change idle timer state at all if + end_time is supplied. + 2006-08-15 Kenichi Handa * coding.c (ONE_MORE_BYTE_CHECK_MULTIBYTE): New arg RET. If SRC diff --git a/src/keyboard.c b/src/keyboard.c index bea35a05731..fed6fbc79dd 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2679,13 +2679,11 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) goto non_reread; } - /* Start idle timers. If a time limit is supplied, we don't reset - idle timers. This avoids an infinite recursion in case an idle - timer calls `sit-for'. */ + /* Start idle timers if no time limit is supplied. We don't do it + if a time limit is supplied to avoid an infinite recursion in the + situation where an idle timer calls `sit-for'. */ - if (end_time) - timer_resume_idle (); - else + if (!end_time) timer_start_idle (); /* If in middle of key sequence and minibuffer not active, @@ -2756,7 +2754,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); /* Now that we have read an event, Emacs is not idle. */ - timer_stop_idle (); + if (!end_time) + timer_stop_idle (); goto exit; } @@ -2886,9 +2885,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) /* Actually read a character, waiting if necessary. */ save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); - if (end_time) - timer_resume_idle (); - else + if (!end_time) timer_start_idle (); c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); restore_getcjmp (save_jump); @@ -2941,7 +2938,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) non_reread: - timer_stop_idle (); + if (!end_time) + timer_stop_idle (); RESUME_POLLING; if (NILP (c)) @@ -2975,7 +2973,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) last_input_char = c; Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt); - if (CONSP (c) && EQ (XCAR (c), Qselect_window)) + if (CONSP (c) && EQ (XCAR (c), Qselect_window) && !end_time) /* We stopped being idle for this event; undo that. This prevents automatic window selection (under mouse_autoselect_window from acting as a real input event, for @@ -3181,7 +3179,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) show_help_echo (help, window, object, position, 0); /* We stopped being idle for this event; undo that. */ - timer_resume_idle (); + if (!end_time) + timer_resume_idle (); goto retry; } -- cgit v1.2.1 From 29cbc4829462914df43038b05711b71aad6e570a Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Wed, 16 Aug 2006 00:20:53 +0000 Subject: (choose_write_coding_system): Use LF for end-of-line in auto-saving. --- src/ChangeLog | 5 +++++ src/fileio.c | 2 ++ 2 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 936f8a2546c..58929cc40d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-16 Kenichi Handa + + * fileio.c (choose_write_coding_system): Use LF for end-of-line + in auto-saving. + 2006-08-15 Chong Yidong * keyboard.c (read_char): Don't change idle timer state at all if diff --git a/src/fileio.c b/src/fileio.c index d26b2808726..4a39e7ffa19 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4845,6 +4845,8 @@ choose_write_coding_system (start, end, filename, /* ... but with the special flag to indicate not to strip off leading code of eight-bit-control chars. */ coding->flags = 1; + /* We force LF for end-of-line because that is faster. */ + coding->eol_type = CODING_EOL_LF; goto done_setup_coding; } else if (!NILP (Vcoding_system_for_write)) -- cgit v1.2.1 From c33f8948974b2c8614bec80860c6ec01a2a11d5f Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 16 Aug 2006 05:15:25 +0000 Subject: (debug_output_compilation_hack): New function. --- src/print.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/print.c b/src/print.c index c36b9476f82..ac8736d2aa4 100644 --- a/src/print.c +++ b/src/print.c @@ -924,6 +924,15 @@ to make it write to the debugging output. */) return character; } +/* This function is never called. Its purpose is to prevent + print_output_debug_flag from being optimized away. */ + +int +debug_output_compilation_hack (x) + int x; +{ + print_output_debug_flag = x; +} #if defined(GNU_LINUX) -- cgit v1.2.1 From 3cb74cd1277590da7137297c1f2e6db95d9403a0 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 16 Aug 2006 05:17:30 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 58929cc40d2..b3242619d7f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-16 Richard Stallman + + * print.c (debug_output_compilation_hack): New function. + 2006-08-16 Kenichi Handa * fileio.c (choose_write_coding_system): Use LF for end-of-line -- cgit v1.2.1 From dae581bf8d1eb6b08fac90505e38244db2a3f3da Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 16 Aug 2006 12:33:12 +0000 Subject: (debug_output_compilation_hack): Fix return type. --- src/ChangeLog | 4 ++++ src/print.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b3242619d7f..f37715a4b71 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-16 Andreas Schwab + + * print.c (debug_output_compilation_hack): Fix return type. + 2006-08-16 Richard Stallman * print.c (debug_output_compilation_hack): New function. diff --git a/src/print.c b/src/print.c index ac8736d2aa4..e56c231d30a 100644 --- a/src/print.c +++ b/src/print.c @@ -927,7 +927,7 @@ to make it write to the debugging output. */) /* This function is never called. Its purpose is to prevent print_output_debug_flag from being optimized away. */ -int +void debug_output_compilation_hack (x) int x; { -- cgit v1.2.1 From 454e31b372768c8fb24eb10150e4032e3833af90 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Thu, 17 Aug 2006 21:00:13 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index f37715a4b71..68a2bb082ec 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-18 Nick Roberts + + * window.c (Fset_window_fringes): Do nothing on a tty. + (Fwindow_fringes): Put ? operator after the line break. + 2006-08-16 Andreas Schwab * print.c (debug_output_compilation_hack): Fix return type. -- cgit v1.2.1 From d46c6df554b71c54ed9b66122f90d79ef66f1d63 Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Thu, 17 Aug 2006 21:00:44 +0000 Subject: (Fset_window_fringes): Do nothing on a tty. (Fwindow_fringes): Put ? operator after the line break. --- src/window.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/window.c b/src/window.c index 5a7655999f5..47c47fe0f51 100644 --- a/src/window.c +++ b/src/window.c @@ -6656,10 +6656,12 @@ display marginal areas and the text area. */) CHECK_NATNUM (left_width); if (!NILP (right_width)) CHECK_NATNUM (right_width); - - if (!EQ (w->left_fringe_width, left_width) - || !EQ (w->right_fringe_width, right_width) - || !EQ (w->fringes_outside_margins, outside_margins)) + + /* Do nothing on a tty. */ + if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) + && (!EQ (w->left_fringe_width, left_width) + || !EQ (w->right_fringe_width, right_width) + || !EQ (w->fringes_outside_margins, outside_margins))) { w->left_fringe_width = left_width; w->right_fringe_width = right_width; @@ -6687,10 +6689,11 @@ Value is a list of the form (LEFT-WIDTH RIGHT-WIDTH OUTSIDE-MARGINS). */) Lisp_Object window; { struct window *w = decode_window (window); + return Fcons (make_number (WINDOW_LEFT_FRINGE_WIDTH (w)), Fcons (make_number (WINDOW_RIGHT_FRINGE_WIDTH (w)), - Fcons ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) ? - Qt : Qnil), Qnil))); + Fcons ((WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) + ? Qt : Qnil), Qnil))); } -- cgit v1.2.1 From 017e297ea90933bfde94de5f90f9f9260ff032e8 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Fri, 18 Aug 2006 01:52:19 +0000 Subject: Comment change. --- src/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/window.c b/src/window.c index 47c47fe0f51..ba8a541e779 100644 --- a/src/window.c +++ b/src/window.c @@ -6657,7 +6657,7 @@ display marginal areas and the text area. */) if (!NILP (right_width)) CHECK_NATNUM (right_width); - /* Do nothing on a tty. */ + /* Do nothing on a tty. */ if (FRAME_WINDOW_P (WINDOW_XFRAME (w)) && (!EQ (w->left_fringe_width, left_width) || !EQ (w->right_fringe_width, right_width) -- cgit v1.2.1 From ff458d812f881e04585bef6bdb96e3cd0ddd905d Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sun, 20 Aug 2006 12:06:20 +0000 Subject: (Fcurrent_idle_time): New function. (syms_of_keyboard): defsubr it. --- src/keyboard.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index fed6fbc79dd..13ab5299982 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4543,6 +4543,35 @@ timer_check (do_it_now) UNGCPRO; return nexttime; } + +DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0, + /* Return the current length of Emacs idleness. +The value is returned as a list of three integers. The first has the +most significant 16 bits of the seconds, while the second has the +least significant 16 bits. The third integer gives the microsecond +count. + +The microsecond count is zero on systems that do not provide +resolution finer than a second. */) + () +{ + EMACS_TIME now, idleness_now; + Lisp_Object result[3]; + + EMACS_GET_TIME (now); + if (! EMACS_TIME_NEG_P (timer_idleness_start_time)) + { + EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time); + + XSETINT (result[0], (EMACS_SECS (idleness_now) >> 16) & 0xffff); + XSETINT (result[1], (EMACS_SECS (idleness_now) >> 0) & 0xffff); + XSETINT (result[2], EMACS_USECS (idleness_now)); + + return Flist (3, result); + } + + return Qnil; +} /* Caches for modify_event_symbol. */ static Lisp_Object accent_key_syms; @@ -11131,6 +11160,7 @@ syms_of_keyboard () menu_bar_items_vector = Qnil; staticpro (&menu_bar_items_vector); + defsubr (&Scurrent_idle_time); defsubr (&Sevent_convert_list); defsubr (&Sread_key_sequence); defsubr (&Sread_key_sequence_vector); -- cgit v1.2.1 From 2eb582aeac58327a85bd1a5fbdb21fd95264293a Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sun, 20 Aug 2006 12:06:59 +0000 Subject: (load_pixmap): Add quotes in error message. --- src/xfaces.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/xfaces.c b/src/xfaces.c index 99355cca6af..3dc5ddc3401 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -1189,7 +1189,7 @@ load_pixmap (f, name, w_ptr, h_ptr) if (bitmap_id < 0) { - add_to_log ("Invalid or undefined bitmap %s", name, Qnil); + add_to_log ("Invalid or undefined bitmap `%s'", name, Qnil); bitmap_id = 0; if (w_ptr) -- cgit v1.2.1 From ce6297137d3f5ae98335f35119faae72d04d6a44 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sun, 20 Aug 2006 12:19:33 +0000 Subject: *** empty log message *** --- src/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 68a2bb082ec..a820b51f77d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2006-08-20 Richard Stallman + + * xfaces.c (load_pixmap): Add quotes in error message. + + * keyboard.c (Fcurrent_idle_time): New function. + (syms_of_keyboard): defsubr it. + 2006-08-18 Nick Roberts * window.c (Fset_window_fringes): Do nothing on a tty. -- cgit v1.2.1 From c5b76d6cf7f35283aae93ef33b8dad1bdf13e085 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 20 Aug 2006 17:58:09 +0000 Subject: * keyboard.c (show_help_echo): Preserve mouse movement flag if tracking mouse. --- src/ChangeLog | 5 ++ src/keyboard.c | 144 ++++++++++++++++++++++++++++++--------------------------- 2 files changed, 82 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a820b51f77d..b7778885c13 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-20 Chong Yidong + + * keyboard.c (show_help_echo): Preserve mouse movement flag if + tracking mouse. + 2006-08-20 Richard Stallman * xfaces.c (load_pixmap): Add quotes in error message. diff --git a/src/keyboard.c b/src/keyboard.c index 13ab5299982..e4c17d5d43f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1390,6 +1390,72 @@ DEFUN ("abort-recursive-edit", Fabort_recursive_edit, Sabort_recursive_edit, 0, return Qnil; } +#ifdef HAVE_MOUSE + +/* Restore mouse tracking enablement. See Ftrack_mouse for the only use + of this function. */ + +static Lisp_Object +tracking_off (old_value) + Lisp_Object old_value; +{ + do_mouse_tracking = old_value; + if (NILP (old_value)) + { + /* Redisplay may have been preempted because there was input + available, and it assumes it will be called again after the + input has been processed. If the only input available was + the sort that we have just disabled, then we need to call + redisplay. */ + if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW)) + { + redisplay_preserve_echo_area (6); + get_input_pending (&input_pending, + READABLE_EVENTS_DO_TIMERS_NOW); + } + } + return Qnil; +} + +DEFUN ("track-mouse", Ftrack_mouse, Strack_mouse, 0, UNEVALLED, 0, + doc: /* Evaluate BODY with mouse movement events enabled. +Within a `track-mouse' form, mouse motion generates input events that +you can read with `read-event'. +Normally, mouse motion is ignored. +usage: (track-mouse BODY ...) */) + (args) + Lisp_Object args; +{ + int count = SPECPDL_INDEX (); + Lisp_Object val; + + record_unwind_protect (tracking_off, do_mouse_tracking); + + do_mouse_tracking = Qt; + + val = Fprogn (args); + return unbind_to (count, val); +} + +/* If mouse has moved on some frame, return one of those frames. + Return 0 otherwise. */ + +static FRAME_PTR +some_mouse_moved () +{ + Lisp_Object tail, frame; + + FOR_EACH_FRAME (tail, frame) + { + if (XFRAME (frame)->mouse_moved) + return XFRAME (frame); + } + + return 0; +} + +#endif /* HAVE_MOUSE */ + /* This is the actual command reading loop, sans error-handling encapsulation. */ @@ -2310,7 +2376,17 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo) #ifdef HAVE_MOUSE if (!noninteractive && STRINGP (help)) - help = call1 (Qmouse_fixup_help_message, help); + { + /* The mouse-fixup-help-message Lisp function can call + mouse_position_hook, which resets the mouse_moved flags. + This causes trouble if we are trying to read a mouse motion + event (i.e., if we are inside a `track-mouse' form), so we + restore the mouse_moved flag. */ + FRAME_PTR f = NILP (do_mouse_tracking) ? NULL : some_mouse_moved (); + help = call1 (Qmouse_fixup_help_message, help); + if (f) + f->mouse_moved = 1; + } #endif if (STRINGP (help) || NILP (help)) @@ -3464,72 +3540,6 @@ restore_getcjmp (temp) bcopy (temp, getcjmp, sizeof getcjmp); } -#ifdef HAVE_MOUSE - -/* Restore mouse tracking enablement. See Ftrack_mouse for the only use - of this function. */ - -static Lisp_Object -tracking_off (old_value) - Lisp_Object old_value; -{ - do_mouse_tracking = old_value; - if (NILP (old_value)) - { - /* Redisplay may have been preempted because there was input - available, and it assumes it will be called again after the - input has been processed. If the only input available was - the sort that we have just disabled, then we need to call - redisplay. */ - if (!readable_events (READABLE_EVENTS_DO_TIMERS_NOW)) - { - redisplay_preserve_echo_area (6); - get_input_pending (&input_pending, - READABLE_EVENTS_DO_TIMERS_NOW); - } - } - return Qnil; -} - -DEFUN ("track-mouse", Ftrack_mouse, Strack_mouse, 0, UNEVALLED, 0, - doc: /* Evaluate BODY with mouse movement events enabled. -Within a `track-mouse' form, mouse motion generates input events that -you can read with `read-event'. -Normally, mouse motion is ignored. -usage: (track-mouse BODY ...) */) - (args) - Lisp_Object args; -{ - int count = SPECPDL_INDEX (); - Lisp_Object val; - - record_unwind_protect (tracking_off, do_mouse_tracking); - - do_mouse_tracking = Qt; - - val = Fprogn (args); - return unbind_to (count, val); -} - -/* If mouse has moved on some frame, return one of those frames. - Return 0 otherwise. */ - -static FRAME_PTR -some_mouse_moved () -{ - Lisp_Object tail, frame; - - FOR_EACH_FRAME (tail, frame) - { - if (XFRAME (frame)->mouse_moved) - return XFRAME (frame); - } - - return 0; -} - -#endif /* HAVE_MOUSE */ - /* Low level keyboard/mouse input. kbd_buffer_store_event places events in kbd_buffer, and kbd_buffer_get_event retrieves them. */ -- cgit v1.2.1 From 748726f4d0afd75e639ab15ecef1c8ac62bf93f6 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 21 Aug 2006 02:09:31 +0000 Subject: (syms_of_keyboard): Docstring of Vunread_post_input_method_events and Vunread_input_method_events fixed. --- src/ChangeLog | 6 ++++++ src/keyboard.c | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b7778885c13..8308a1ab29d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2006-08-21 Kenichi Handa + + * keyboard.c (syms_of_keyboard): Docstring of + Vunread_post_input_method_events and Vunread_input_method_events + fixed. + 2006-08-20 Chong Yidong * keyboard.c (show_help_echo): Preserve mouse movement flag if diff --git a/src/keyboard.c b/src/keyboard.c index e4c17d5d43f..72e6844d841 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11228,14 +11228,16 @@ These events are processed first, before actual keyboard input. */); DEFVAR_LISP ("unread-post-input-method-events", &Vunread_post_input_method_events, doc: /* List of events to be processed as input by input methods. -These events are processed after `unread-command-events', but -before actual keyboard input. */); +These events are processed before `unread-command-events' +and actual keyboard input without given to `input-method-function'. */); Vunread_post_input_method_events = Qnil; DEFVAR_LISP ("unread-input-method-events", &Vunread_input_method_events, doc: /* List of events to be processed as input by input methods. These events are processed after `unread-command-events', but -before actual keyboard input. */); +before actual keyboard input. +If there's an active input method, the events are given to +`input-method-function'. */); Vunread_input_method_events = Qnil; DEFVAR_LISP ("meta-prefix-char", &meta_prefix_char, -- cgit v1.2.1 From c58790e68a9e81d4606a6f608694db76510eec07 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 21 Aug 2006 08:52:54 +0000 Subject: *** empty log message *** --- src/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 8308a1ab29d..fe4a59cf808 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2006-08-21 Kim F. Storm + + * macterm.c (x_draw_stretch_glyph_string): + * w32term.c (x_draw_stretch_glyph_string): + * xterm.c (x_draw_stretch_glyph_string): It is ok to draw a + stretch glyph in left marginal areas on header and mode lines. + 2006-08-21 Kenichi Handa * keyboard.c (syms_of_keyboard): Docstring of -- cgit v1.2.1 From 6c6939293677c179b65e23aee9ec40537a418dbd Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Mon, 21 Aug 2006 08:53:32 +0000 Subject: (x_draw_stretch_glyph_string): It is ok to draw a stretch glyph in left marginal areas on header and mode lines. --- src/macterm.c | 4 +++- src/w32term.c | 4 +++- src/xterm.c | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/macterm.c b/src/macterm.c index 69612302774..97e3b743469 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -3583,7 +3583,9 @@ x_draw_stretch_glyph_string (s) int background_width = s->background_width; int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); - if (x < left_x) + /* Don't draw into left margin, fringe or scrollbar area + except for header line and mode line. */ + if (x < left_x && !s->row->mode_line_p) { background_width -= left_x - x; x = left_x; diff --git a/src/w32term.c b/src/w32term.c index 294059aa77b..5e33c3af7b9 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2418,7 +2418,9 @@ x_draw_stretch_glyph_string (s) int background_width = s->background_width; int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); - if (x < left_x) + /* Don't draw into left margin, fringe or scrollbar area + except for header line and mode line. */ + if (x < left_x && !s->row->mode_line_p) { background_width -= left_x - x; x = left_x; diff --git a/src/xterm.c b/src/xterm.c index 6fb9ee28f42..9cea615ca1e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2589,7 +2589,9 @@ x_draw_stretch_glyph_string (s) int background_width = s->background_width; int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); - if (x < left_x) + /* Don't draw into left margin, fringe or scrollbar area + except for header line and mode line. */ + if (x < left_x && !s->row->mode_line_p) { background_width -= left_x - x; x = left_x; -- cgit v1.2.1 From 922fd3cb7b382fe0cd5cf48edc2f10f6a31bb0e6 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Mon, 21 Aug 2006 12:54:47 +0000 Subject: Clarify difference between in_sighandler and handling_signal. --- src/keyboard.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index 72e6844d841..0d13743f8b5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -100,7 +100,12 @@ int interrupt_input_pending; /* File descriptor to use for input. */ extern int input_fd; -/* Nonzero if we are executing from the SIGIO signal handler. */ +/* Nonzero if we are executing from the SIGIO signal handler. + The difference between in_sighandler and handling_signal is that + in_sighandler is only set when executing in a signal handler. + handling_signal may be set even if not executing in a signal handler, for + example when reinvoke_input_signal is called from UNBLOCK_INPUT, or + when Emacs is compiled with SYNC_INPUT defined. */ int in_sighandler; #ifdef HAVE_WINDOW_SYSTEM -- cgit v1.2.1 From f73858ce4d4658fed5130a9d748f695e1b25c727 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Mon, 21 Aug 2006 12:55:20 +0000 Subject: * keyboard.c: Clarify difference between in_sighandler and handling_signal. --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index fe4a59cf808..a299d7c603f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-21 Jan Dj,Ad(Brv + + * keyboard.c: Clarify difference between in_sighandler and + handling_signal. + 2006-08-21 Kim F. Storm * macterm.c (x_draw_stretch_glyph_string): -- cgit v1.2.1 From 38babc072d6104b73f5a93a736edd0f232f4a10e Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 22 Aug 2006 09:25:59 +0000 Subject: 2006-08-22 Stefan Monnier (Fset_buffer_multibyte): Record proper undo entry. --- src/buffer.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/buffer.c b/src/buffer.c index 3502afc9bf0..07d0f676aa2 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2115,10 +2115,11 @@ current buffer is cleared. */) { struct Lisp_Marker *tail, *markers; struct buffer *other; - int undo_enabled_p = !EQ (current_buffer->undo_list, Qt); int begv, zv; int narrowed = (BEG != BEGV || Z != ZV); int modified_p = !NILP (Fbuffer_modified_p (Qnil)); + Lisp_Object old_undo = current_buffer->undo_list; + struct gcpro gcpro1; if (current_buffer->base_buffer) error ("Cannot do `set-buffer-multibyte' on an indirect buffer"); @@ -2127,10 +2128,11 @@ current buffer is cleared. */) if (NILP (flag) == NILP (current_buffer->enable_multibyte_characters)) return flag; - /* It would be better to update the list, - but this is good enough for now. */ - if (undo_enabled_p) - current_buffer->undo_list = Qt; + GCPRO1 (old_undo); + + /* Don't record these buffer changes. We will put a special undo entry + instead. */ + current_buffer->undo_list = Qt; /* If the cached position is for this buffer, clear it out. */ clear_charpos_cache (current_buffer); @@ -2330,8 +2332,18 @@ current buffer is cleared. */) set_intervals_multibyte (1); } - if (undo_enabled_p) - current_buffer->undo_list = Qnil; + if (!EQ (old_undo, Qt)) + { + /* Represent all the above changes by a special undo entry. */ + extern Lisp_Object Qapply; + Lisp_Object args[3]; + args[0] = Qapply; + args[1] = intern ("set-buffer-multibyte"); + args[2] = NILP (flag) ? Qt : Qnil; + current_buffer->undo_list = Fcons (Flist (3, args), old_undo); + } + + UNGCPRO; /* Changing the multibyteness of a buffer means that all windows showing that buffer must be updated thoroughly. */ -- cgit v1.2.1 From 7e1de68d272078455b1b67e44b143460ec8fe4c5 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 22 Aug 2006 09:45:04 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a299d7c603f..380675945cb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-22 Stefan Monnier + + * buffer.c (Fset_buffer_multibyte): Record proper undo entry. + 2006-08-21 Jan Dj,Ad(Brv * keyboard.c: Clarify difference between in_sighandler and -- cgit v1.2.1 From 6b4d876273771721eb291850f5b285151a0e56fe Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 22 Aug 2006 21:31:50 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 380675945cb..59bd13f0daf 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-22 Kim F. Storm + + * xdisp.c (update_tool_bar): Redisplay toolbar also when only + number of items changes. + 2006-08-22 Stefan Monnier * buffer.c (Fset_buffer_multibyte): Record proper undo entry. -- cgit v1.2.1 From 462eca8fcf4d5d6b12e7d3d974e45a6a2e03ce1f Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 22 Aug 2006 21:32:04 +0000 Subject: (update_tool_bar): Redisplay toolbar also when only number of items changes. --- src/xdisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 9911f47c2a4..640f7006dd1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9391,7 +9391,8 @@ update_tool_bar (f, save_match_data) &new_n_tool_bar); /* Redisplay the tool-bar if we changed it. */ - if (NILP (Fequal (new_tool_bar, f->tool_bar_items))) + if (new_n_tool_bar != f->n_tool_bar_items + || NILP (Fequal (new_tool_bar, f->tool_bar_items))) { /* Redisplay that happens asynchronously due to an expose event may access f->tool_bar_items. Make sure we update both -- cgit v1.2.1 From 6410aac93b73dae0e18f1df7c25fc945a33549bd Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Thu, 24 Aug 2006 20:40:26 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 59bd13f0daf..1f570e15a07 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2006-08-25 Nick Roberts + + * buffer.c (Fswitch_to_buffer): Move buffer to front of + buffer-alist if necessary. + 2006-08-22 Kim F. Storm * xdisp.c (update_tool_bar): Redisplay toolbar also when only -- cgit v1.2.1 From fab45703d34ca5c8c0adea32a1731bc8b73d77db Mon Sep 17 00:00:00 2001 From: Nick Roberts Date: Thu, 24 Aug 2006 20:40:53 +0000 Subject: (Fswitch_to_buffer): Move buffer to front of buffer-alist if necessary. --- src/buffer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/buffer.c b/src/buffer.c index 07d0f676aa2..f6c45852b51 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1684,9 +1684,13 @@ the window-buffer correspondences. */) char *err; if (EQ (buffer, Fwindow_buffer (selected_window))) - /* Basically a NOP. Avoid signalling an error if the selected window - is dedicated, or a minibuffer, ... */ - return Fset_buffer (buffer); + { + if (NILP (norecord) && !EQ (buffer, XCDR (XCAR (Vbuffer_alist)))) + record_buffer (buffer); + /* Basically a NOP. Avoid signalling an error if the selected window + is dedicated, or a minibuffer, ... */ + return Fset_buffer (buffer); + } err = no_switch_window (selected_window); if (err) error (err); -- cgit v1.2.1 From daa0e79b0a84b14d29a033d5e005ea186e5b1d6a Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Thu, 24 Aug 2006 20:51:17 +0000 Subject: (overline_margin): New variable. (x_produce_glyphs): Use it. (syms_of_xdisp): DEFVAR_INT it. --- src/xdisp.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 640f7006dd1..4144cf51f6a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -710,6 +710,10 @@ Lisp_Object Vresize_mini_windows; struct buffer *displayed_buffer; +/* Space between overline and text. */ + +EMACS_INT overline_margin; + /* Value returned from text property handlers (see below). */ enum prop_handled @@ -20357,7 +20361,7 @@ x_produce_glyphs (it) /* If face has an overline, add the height of the overline (1 pixel) and a 1 pixel margin to the character height. */ if (face->overline_p) - it->ascent += 2; + it->ascent += overline_margin; if (it->constrain_row_ascent_descent_p) { @@ -20559,7 +20563,7 @@ x_produce_glyphs (it) /* If face has an overline, add the height of the overline (1 pixel) and a 1 pixel margin to the character height. */ if (face->overline_p) - it->ascent += 2; + it->ascent += overline_margin; take_vertical_position_into_account (it); @@ -20834,7 +20838,7 @@ x_produce_glyphs (it) /* If face has an overline, add the height of the overline (1 pixel) and a 1 pixel margin to the character height. */ if (face->overline_p) - it->ascent += 2; + it->ascent += overline_margin; take_vertical_position_into_account (it); @@ -24110,6 +24114,12 @@ whose contents depend on various data. */); doc: /* Inhibit try_cursor_movement display optimization. */); inhibit_try_cursor_movement = 0; #endif /* GLYPH_DEBUG */ + + DEFVAR_INT ("overline-margin", &overline_margin, + doc: /* *Space between overline and text, in pixels. +The default value is 2: the height of the overline (1 pixel) plus 1 pixel +margin to the caracter height. */); + overline_margin = 2; } -- cgit v1.2.1 From 30f27523567516a324d042e10bde5dd14d7da90f Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Thu, 24 Aug 2006 20:52:00 +0000 Subject: (x_underline_at_descent_line): New variable. (syms_of_xterm): DEFVAR_BOOL it. (x_draw_glyph_string): Use it. Draw underline and overline up to the end of line if the face extends to the end of line. --- src/macterm.c | 8 ++++---- src/w32term.c | 36 +++++++++++++++++++++++++++--------- src/xterm.c | 51 +++++++++++++++++++++++++++++++++------------------ 3 files changed, 64 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/macterm.c b/src/macterm.c index 97e3b743469..04b55d9fa80 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -3679,14 +3679,14 @@ x_draw_glyph_string (s) if (s->face->underline_defaulted_p) mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, - s->width, h); + s->background_width, h); else { XGCValues xgcv; XGetGCValues (s->display, s->gc, GCForeground, &xgcv); XSetForeground (s->display, s->gc, s->face->underline_color); mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, - s->width, h); + s->background_width, h); XSetForeground (s->display, s->gc, xgcv.foreground); } } @@ -3698,14 +3698,14 @@ x_draw_glyph_string (s) if (s->face->overline_color_defaulted_p) mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, - s->width, h); + s->background_width, h); else { XGCValues xgcv; XGetGCValues (s->display, s->gc, GCForeground, &xgcv); XSetForeground (s->display, s->gc, s->face->overline_color); mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, - s->width, h); + s->background_width, h); XSetForeground (s->display, s->gc, xgcv.foreground); } } diff --git a/src/w32term.c b/src/w32term.c index 5e33c3af7b9..93a697bbd8c 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -91,6 +91,10 @@ static Lisp_Object last_window; (Not yet supported, see TODO in x_draw_glyph_string.) */ int x_use_underline_position_properties; +/* Non-zero means to draw the underline at the same place as the descent line. */ + +int x_underline_at_descent_line; + extern unsigned int msh_mousewheel; extern void free_frame_menubar (); @@ -2509,21 +2513,27 @@ x_draw_glyph_string (s) && (s->font->bdf || !s->font->tm.tmUnderlined)) { unsigned long h = 1; - unsigned long dy = s->height - h; + unsigned long dy = 0; - /* TODO: Use font information for positioning and thickness - of underline. See OUTLINETEXTMETRIC, and xterm.c. - Note: If you make this work, don't forget to change the - doc string of x-use-underline-position-properties below. */ + if (x_underline_at_descent_line) + dy = s->height - h; + else + { + /* TODO: Use font information for positioning and thickness of + underline. See OUTLINETEXTMETRIC, and xterm.c. Note: If + you make this work, don't forget to change the doc string of + x-use-underline-position-properties below. */ + dy = s->height - h; + } if (s->face->underline_defaulted_p) { w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, - s->y + dy, s->width, 1); + s->y + dy, s->background_width, 1); } else { w32_fill_area (s->f, s->hdc, s->face->underline_color, s->x, - s->y + dy, s->width, 1); + s->y + dy, s->background_width, 1); } } @@ -2535,12 +2545,12 @@ x_draw_glyph_string (s) if (s->face->overline_color_defaulted_p) { w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, - s->y + dy, s->width, h); + s->y + dy, s->background_width, h); } else { w32_fill_area (s->f, s->hdc, s->face->overline_color, s->x, - s->y + dy, s->width, h); + s->y + dy, s->background_width, h); } } @@ -6510,6 +6520,14 @@ to 4.1, set this to nil. NOTE: Not supported on MS-Windows yet. */); x_use_underline_position_properties = 0; + DEFVAR_BOOL ("x-underline-at-descent-line", + &x_underline_at_descent_line, + doc: /* *Non-nil means to draw the underline at the same place as the descent line. +nil means to draw the underline according to the value of the variable +`x-use-underline-position-properties', which is usually at the baseline +level. The default value is nil. */); + x_underline_at_descent_line = 0; + DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, doc: /* If not nil, Emacs uses toolkit scroll bars. */); Vx_toolkit_scroll_bars = Qt; diff --git a/src/xterm.c b/src/xterm.c index 9cea615ca1e..c2cf2721881 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -182,6 +182,10 @@ static Lisp_Object last_window; int x_use_underline_position_properties; +/* Non-zero means to draw the underline at the same place as the descent line. */ + +int x_underline_at_descent_line; + /* This is a chain of structures for all the X displays currently in use. */ @@ -2685,32 +2689,35 @@ x_draw_glyph_string (s) if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) h = 1; - /* Get the underline position. This is the recommended - vertical offset in pixels from the baseline to the top of - the underline. This is a signed value according to the - specs, and its default is - - ROUND ((maximum descent) / 2), with - ROUND(x) = floor (x + 0.5) */ - - if (x_use_underline_position_properties - && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem)) - y = s->ybase + (long) tem; - else if (s->face->font) - y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; - else + if (x_underline_at_descent_line) y = s->y + s->height - h; + else + { + /* Get the underline position. This is the recommended + vertical offset in pixels from the baseline to the top of + the underline. This is a signed value according to the + specs, and its default is + + ROUND ((maximum descent) / 2), with + ROUND(x) = floor (x + 0.5) */ + + if (x_use_underline_position_properties + && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem)) + y = s->ybase + (long) tem; + else if (s->face->font) + y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2; + } if (s->face->underline_defaulted_p) XFillRectangle (s->display, s->window, s->gc, - s->x, y, s->width, h); + s->x, y, s->background_width, h); else { XGCValues xgcv; XGetGCValues (s->display, s->gc, GCForeground, &xgcv); XSetForeground (s->display, s->gc, s->face->underline_color); XFillRectangle (s->display, s->window, s->gc, - s->x, y, s->width, h); + s->x, y, s->background_width, h); XSetForeground (s->display, s->gc, xgcv.foreground); } } @@ -2722,14 +2729,14 @@ x_draw_glyph_string (s) if (s->face->overline_color_defaulted_p) XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, - s->width, h); + s->background_width, h); else { XGCValues xgcv; XGetGCValues (s->display, s->gc, GCForeground, &xgcv); XSetForeground (s->display, s->gc, s->face->overline_color); XFillRectangle (s->display, s->window, s->gc, s->x, s->y + dy, - s->width, h); + s->background_width, h); XSetForeground (s->display, s->gc, xgcv.foreground); } } @@ -10979,6 +10986,14 @@ UNDERLINE_POSITION font properties, for example 7x13 on XFree prior to 4.1, set this to nil. */); x_use_underline_position_properties = 1; + DEFVAR_BOOL ("x-underline-at-descent-line", + &x_underline_at_descent_line, + doc: /* *Non-nil means to draw the underline at the same place as the descent line. +nil means to draw the underline according to the value of the variable +`x-use-underline-position-properties', which is usually at the baseline +level. The default value is nil. */); + x_underline_at_descent_line = 0; + DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", &x_mouse_click_focus_ignore_position, doc: /* Non-nil means that a mouse click to focus a frame does not move point. -- cgit v1.2.1 From 8d8dafebb36347734c5f81f8154d0749ca16bfaf Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Thu, 24 Aug 2006 21:18:13 +0000 Subject: *** empty log message *** --- src/ChangeLog | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1f570e15a07..cc87d69e070 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,20 @@ -2006-08-25 Nick Roberts +2006-08-24 Francesc Rocher + + * xdisp.c (overline_margin): New variable. + (x_produce_glyphs): Use it. + (syms_of_xdisp): DEFVAR_INT it. + + * xterm.c (x_underline_at_descent_line): New variable. + (syms_of_xterm): DEFVAR_BOOL it. + (x_draw_glyph_string): Use it. + Draw underline and overline up to the end of line if the face + extends to the end of line. + + * macterm.c: Likewise. + + * w32term.c: Likewise. + +2006-08-24 Nick Roberts * buffer.c (Fswitch_to_buffer): Move buffer to front of buffer-alist if necessary. -- cgit v1.2.1 From 11f56bbcfee486e60d33c9d18d0ca9a01ebbaa6d Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Fri, 25 Aug 2006 07:47:12 +0000 Subject: (sxhash_string): Rotate properly; don't lose bits. --- src/fns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/fns.c b/src/fns.c index ca4a098878a..228d48049f0 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5027,7 +5027,7 @@ sxhash_string (ptr, len) c = *p++; if (c >= 0140) c -= 40; - hash = ((hash << 3) + (hash >> 28) + c); + hash = ((hash << 4) + (hash >> 28) + c); } return hash & INTMASK; -- cgit v1.2.1 From 3e04a8fc9f8cdab42552c658713e12e2ebc74bc2 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Fri, 25 Aug 2006 07:51:57 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index cc87d69e070..b585c06c1c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-25 Richard Stallman + + * fns.c (sxhash_string): Rotate properly; don't lose bits. + 2006-08-24 Francesc Rocher * xdisp.c (overline_margin): New variable. -- cgit v1.2.1 From 16fb6ded70ae47140bb21b06da62f2f85a414019 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 25 Aug 2006 10:05:41 +0000 Subject: *** empty log message *** --- src/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index b585c06c1c0..bcb576f1fa0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2006-08-25 Kim F. Storm + + * keyboard.c (Fcurrent_idle_time): Simplify. + 2006-08-25 Richard Stallman * fns.c (sxhash_string): Rotate properly; don't lose bits. -- cgit v1.2.1 From 966949b00f0515e586645cee56d42a14dac4f9fc Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 25 Aug 2006 10:05:50 +0000 Subject: (Fcurrent_idle_time): Simplify. --- src/keyboard.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index 0d13743f8b5..abf57937966 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4570,19 +4570,16 @@ The microsecond count is zero on systems that do not provide resolution finer than a second. */) () { - EMACS_TIME now, idleness_now; - Lisp_Object result[3]; - - EMACS_GET_TIME (now); if (! EMACS_TIME_NEG_P (timer_idleness_start_time)) { - EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time); + EMACS_TIME now, idleness_now; - XSETINT (result[0], (EMACS_SECS (idleness_now) >> 16) & 0xffff); - XSETINT (result[1], (EMACS_SECS (idleness_now) >> 0) & 0xffff); - XSETINT (result[2], EMACS_USECS (idleness_now)); + EMACS_GET_TIME (now); + EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time); - return Flist (3, result); + return list3 (make_number ((EMACS_SECS (idleness_now) >> 16) & 0xffff), + make_number ((EMACS_SECS (idleness_now) >> 0) & 0xffff), + make_number (EMACS_USECS (idleness_now))); } return Qnil; -- cgit v1.2.1 From d0f891a742ddf5104188a26b9e02211735b9d5a5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 25 Aug 2006 20:44:49 +0000 Subject: (url-file-local-copy): Tell url-copy-file that the dest file will already exist. --- src/ChangeLog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index bcb576f1fa0..e55a8a8b9e3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -868,8 +868,8 @@ 2006-06-14 Chong Yidong - * xdisp.c (back_to_previous_visible_line_start): Reset - it->continuation_lines_width. + * xdisp.c (back_to_previous_visible_line_start): + Reset it->continuation_lines_width. 2006-06-14 Richard Stallman @@ -940,8 +940,8 @@ 2006-06-06 YAMAMOTO Mitsuharu - * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event): Exclude - 0x7f from ASCII range. + * macterm.c [USE_MAC_TSM] (mac_handle_text_input_event): + Exclude 0x7f from ASCII range. 2006-06-05 Jason Rumney -- cgit v1.2.1 From 611ac52147a4682f0c8befc8483dc095966d3fbf Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Fri, 25 Aug 2006 21:10:26 +0000 Subject: (Fswitch_to_buffer): Fix previous change. --- src/buffer.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/buffer.c b/src/buffer.c index f6c45852b51..81ea51b357a 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1685,10 +1685,15 @@ the window-buffer correspondences. */) if (EQ (buffer, Fwindow_buffer (selected_window))) { - if (NILP (norecord) && !EQ (buffer, XCDR (XCAR (Vbuffer_alist)))) + /* Basically a NOP. Avoid signalling an error in the case where + the selected window is dedicated, or a minibuffer. */ + + /* But do put this buffer at the front of the buffer list, + unless that has been inhibited. Note that even if + BUFFER is at the front of the main buffer-list already, + we still want to move it to the front of the frame's buffer list. */ + if (NILP (norecord)) record_buffer (buffer); - /* Basically a NOP. Avoid signalling an error if the selected window - is dedicated, or a minibuffer, ... */ return Fset_buffer (buffer); } -- cgit v1.2.1 From d489b9c5be7c4c8ccfa5a0f4a411bd891faaa663 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 25 Aug 2006 23:32:17 +0000 Subject: *** empty log message *** --- src/ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index e55a8a8b9e3..ac1ac8b53b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,16 @@ +2006-08-26 Kim F. Storm + + * buffer.c (Fset_buffer_multibyte): + * editfns.c (Fcurrent_time, Fget_internal_run_time): + * macfns.c (Fxw_color_values): + * w32fns.c (Fxw_color_values): + * xfns.c (Fxw_color_values): Simplify; use list3. + + * fileio.c (Fmake_directory_internal, Fdelete_directory) + (Fdelete_file): Simplify; use list1. + (Frename_file, Fadd_name_to_file, Fmake_symbolic_link): + Simplify; remove NO_ARG_ARRAY stuff, use list2. + 2006-08-25 Kim F. Storm * keyboard.c (Fcurrent_idle_time): Simplify. -- cgit v1.2.1 From a508663b2687133cd711ef801be11e0f299b5d9c Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 25 Aug 2006 23:33:04 +0000 Subject: (Fxw_color_values): Simplify; use list3. --- src/macfns.c | 11 +++-------- src/w32fns.c | 17 ++++++----------- src/xfns.c | 11 +++-------- 3 files changed, 12 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/macfns.c b/src/macfns.c index 494d6ec1da3..a72cd66cdce 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -2876,14 +2876,9 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, CHECK_STRING (color); if (mac_defined_color (f, SDATA (color), &foo, 0)) - { - Lisp_Object rgb[3]; - - rgb[0] = make_number (foo.red); - rgb[1] = make_number (foo.green); - rgb[2] = make_number (foo.blue); - return Flist (3, rgb); - } + return list3 (make_number (foo.red), + make_number (foo.green), + make_number (foo.blue)); else return Qnil; } diff --git a/src/w32fns.c b/src/w32fns.c index e1cae4f3eb4..8c6a60d47bf 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -6355,17 +6355,12 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, CHECK_STRING (color); if (w32_defined_color (f, SDATA (color), &foo, 0)) - { - Lisp_Object rgb[3]; - - rgb[0] = make_number ((GetRValue (foo.pixel) << 8) - | GetRValue (foo.pixel)); - rgb[1] = make_number ((GetGValue (foo.pixel) << 8) - | GetGValue (foo.pixel)); - rgb[2] = make_number ((GetBValue (foo.pixel) << 8) - | GetBValue (foo.pixel)); - return Flist (3, rgb); - } + return list3 (make_number ((GetRValue (foo.pixel) << 8) + | GetRValue (foo.pixel)), + make_number ((GetGValue (foo.pixel) << 8) + | GetGValue (foo.pixel)), + make_number ((GetBValue (foo.pixel) << 8) + | GetBValue (foo.pixel))); else return Qnil; } diff --git a/src/xfns.c b/src/xfns.c index 47916fccb71..8071ff1c4e6 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -3475,14 +3475,9 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, CHECK_STRING (color); if (x_defined_color (f, SDATA (color), &foo, 0)) - { - Lisp_Object rgb[3]; - - rgb[0] = make_number (foo.red); - rgb[1] = make_number (foo.green); - rgb[2] = make_number (foo.blue); - return Flist (3, rgb); - } + return list3 (make_number (foo.red), + make_number (foo.green), + make_number (foo.blue)); else return Qnil; } -- cgit v1.2.1 From a9f2aeaeed9c9135c27e5abce0051b30d1467089 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 25 Aug 2006 23:33:12 +0000 Subject: (Fmake_directory_internal, Fdelete_directory) (Fdelete_file): Simplify; use list1. (Frename_file, Fadd_name_to_file, Fmake_symbolic_link): Simplify; remove NO_ARG_ARRAY stuff, use list2. --- src/fileio.c | 43 ++++++------------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) (limited to 'src') diff --git a/src/fileio.c b/src/fileio.c index 4a39e7ffa19..fa7a2d0cd85 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2648,7 +2648,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal, #else if (mkdir (dir, 0777) != 0) #endif - report_file_error ("Creating directory", Flist (1, &directory)); + report_file_error ("Creating directory", list1 (directory)); return Qnil; } @@ -2674,7 +2674,7 @@ DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete dir = SDATA (encoded_dir); if (rmdir (dir) != 0) - report_file_error ("Removing directory", Flist (1, &directory)); + report_file_error ("Removing directory", list1 (directory)); return Qnil; } @@ -2705,7 +2705,7 @@ If file has multiple names, it continues to exist with the other names. */) encoded_file = ENCODE_FILE (filename); if (0 > unlink (SDATA (encoded_file))) - report_file_error ("Removing old name", Flist (1, &filename)); + report_file_error ("Removing old name", list1 (filename)); return Qnil; } @@ -2739,9 +2739,6 @@ This is what happens in interactive use with M-x. */) (file, newname, ok_if_already_exists) Lisp_Object file, newname, ok_if_already_exists; { -#ifdef NO_ARG_ARRAY - Lisp_Object args[2]; -#endif Lisp_Object handler; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; Lisp_Object encoded_file, encoded_newname, symlink_target; @@ -2810,15 +2807,7 @@ This is what happens in interactive use with M-x. */) Fdelete_file (file); } else -#ifdef NO_ARG_ARRAY - { - args[0] = file; - args[1] = newname; - report_file_error ("Renaming", Flist (2, args)); - } -#else - report_file_error ("Renaming", Flist (2, &file)); -#endif + report_file_error ("Renaming", list2 (file, newname)); } UNGCPRO; return Qnil; @@ -2834,9 +2823,6 @@ This is what happens in interactive use with M-x. */) (file, newname, ok_if_already_exists) Lisp_Object file, newname, ok_if_already_exists; { -#ifdef NO_ARG_ARRAY - Lisp_Object args[2]; -#endif Lisp_Object handler; Lisp_Object encoded_file, encoded_newname; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -2876,15 +2862,7 @@ This is what happens in interactive use with M-x. */) unlink (SDATA (newname)); if (0 > link (SDATA (encoded_file), SDATA (encoded_newname))) - { -#ifdef NO_ARG_ARRAY - args[0] = file; - args[1] = newname; - report_file_error ("Adding new name", Flist (2, args)); -#else - report_file_error ("Adding new name", Flist (2, &file)); -#endif - } + report_file_error ("Adding new name", list2 (file, newname)); UNGCPRO; return Qnil; @@ -2902,9 +2880,6 @@ This happens for interactive use with M-x. */) (filename, linkname, ok_if_already_exists) Lisp_Object filename, linkname, ok_if_already_exists; { -#ifdef NO_ARG_ARRAY - Lisp_Object args[2]; -#endif Lisp_Object handler; Lisp_Object encoded_filename, encoded_linkname; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -2960,13 +2935,7 @@ This happens for interactive use with M-x. */) } } -#ifdef NO_ARG_ARRAY - args[0] = filename; - args[1] = linkname; - report_file_error ("Making symbolic link", Flist (2, args)); -#else - report_file_error ("Making symbolic link", Flist (2, &filename)); -#endif + report_file_error ("Making symbolic link", list2 (filename, linkname)); } UNGCPRO; return Qnil; -- cgit v1.2.1 From 799734b06388430cca13e5933fa57d782b7b1435 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 25 Aug 2006 23:33:30 +0000 Subject: (Fcurrent_time, Fget_internal_run_time): Simplify; use list3. --- src/editfns.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/editfns.c b/src/editfns.c index 8ac61f3d006..c43528c4863 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -1435,14 +1435,11 @@ resolution finer than a second. */) () { EMACS_TIME t; - Lisp_Object result[3]; EMACS_GET_TIME (t); - XSETINT (result[0], (EMACS_SECS (t) >> 16) & 0xffff); - XSETINT (result[1], (EMACS_SECS (t) >> 0) & 0xffff); - XSETINT (result[2], EMACS_USECS (t)); - - return Flist (3, result); + return list3 (make_number ((EMACS_SECS (t) >> 16) & 0xffff), + make_number ((EMACS_SECS (t) >> 0) & 0xffff), + make_number (EMACS_USECS (t))); } DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time, @@ -1460,7 +1457,6 @@ systems that do not provide resolution finer than a second. */) { #ifdef HAVE_GETRUSAGE struct rusage usage; - Lisp_Object result[3]; int secs, usecs; if (getrusage (RUSAGE_SELF, &usage) < 0) @@ -1476,11 +1472,9 @@ systems that do not provide resolution finer than a second. */) secs++; } - XSETINT (result[0], (secs >> 16) & 0xffff); - XSETINT (result[1], (secs >> 0) & 0xffff); - XSETINT (result[2], usecs); - - return Flist (3, result); + return list3 (make_number ((secs >> 16) & 0xffff), + make_number ((secs >> 0) & 0xffff), + make_number (usecs)); #else return Fcurrent_time (); #endif -- cgit v1.2.1 From 8929fd8784f3029494d04fef6896247385c9d6c0 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 25 Aug 2006 23:33:44 +0000 Subject: (Fset_buffer_multibyte): Simplify; use list3. --- src/buffer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/buffer.c b/src/buffer.c index 81ea51b357a..863b217d2b4 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2345,11 +2345,10 @@ current buffer is cleared. */) { /* Represent all the above changes by a special undo entry. */ extern Lisp_Object Qapply; - Lisp_Object args[3]; - args[0] = Qapply; - args[1] = intern ("set-buffer-multibyte"); - args[2] = NILP (flag) ? Qt : Qnil; - current_buffer->undo_list = Fcons (Flist (3, args), old_undo); + current_buffer->undo_list = Fcons (list3 (Qapply, + intern ("set-buffer-multibyte"), + NILP (flag) ? Qt : Qnil), + old_undo); } UNGCPRO; -- cgit v1.2.1 From f3c4a0e1d28dcf59bf9b59ba040b361ad44adad3 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:08:31 +0000 Subject: (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Undo previous change. Move mutex lock/unlock operations inside BLOCK_INPUT. --- src/alloc.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/alloc.c b/src/alloc.c index 192b974196f..2fd50009649 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -130,27 +130,17 @@ static pthread_mutex_t alloc_mutex; #define BLOCK_INPUT_ALLOC \ do \ { \ - if (!in_sighandler) \ - { \ - pthread_mutex_lock (&alloc_mutex); \ - if (pthread_self () == main_thread) \ - BLOCK_INPUT; \ - else \ - sigblock (sigmask (SIGIO)); \ - } \ + if (pthread_self () == main_thread) \ + BLOCK_INPUT; \ + pthread_mutex_lock (&alloc_mutex); \ } \ while (0) #define UNBLOCK_INPUT_ALLOC \ do \ { \ - if (!in_sighandler) \ - { \ - pthread_mutex_unlock (&alloc_mutex); \ - if (pthread_self () == main_thread) \ - UNBLOCK_INPUT; \ - else \ - sigunblock (sigmask (SIGIO)); \ - } \ + pthread_mutex_unlock (&alloc_mutex); \ + if (pthread_self () == main_thread) \ + UNBLOCK_INPUT; \ } \ while (0) -- cgit v1.2.1 From d15b573ed5740f4b0f4803a1387668c4f540d88c Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:08:39 +0000 Subject: (directory_files_internal_unwind, directory_files_internal) (file_name_completion): Add BLOCK_INPUT around opendir/closedir. --- src/dired.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/dired.c b/src/dired.c index 17a80a3ce4b..b469d682c41 100644 --- a/src/dired.c +++ b/src/dired.c @@ -134,7 +134,9 @@ directory_files_internal_unwind (dh) Lisp_Object dh; { DIR *d = (DIR *) XSAVE_VALUE (dh)->pointer; + BLOCK_INPUT; closedir (d); + UNBLOCK_INPUT; return Qnil; } @@ -196,7 +198,9 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) /* Now *bufp is the compiled form of MATCH; don't call anything which might compile a new regexp until we're done with the loop! */ + BLOCK_INPUT; d = opendir (SDATA (dirfilename)); + UNBLOCK_INPUT; if (d == NULL) report_file_error ("Opening directory", Fcons (directory, Qnil)); @@ -321,7 +325,9 @@ directory_files_internal (directory, full, match, nosort, attrs, id_format) } } + BLOCK_INPUT; closedir (d); + UNBLOCK_INPUT; /* Discard the unwind protect. */ specpdl_ptr = specpdl + count; @@ -508,7 +514,9 @@ file_name_completion (file, dirname, all_flag, ver_flag) { int inner_count = SPECPDL_INDEX (); + BLOCK_INPUT; d = opendir (SDATA (Fdirectory_file_name (encoded_dir))); + UNBLOCK_INPUT; if (!d) report_file_error ("Opening directory", Fcons (dirname, Qnil)); -- cgit v1.2.1 From edc52b3fa1c83b8bab4004b4721cad9afb0563aa Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:08:54 +0000 Subject: [TARGET_API_MAC_CARBON] (image_load_qt_1): Use ComponentResult instead of OSErr. --- src/image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/image.c b/src/image.c index 70ffabc1937..dac896137c3 100644 --- a/src/image.c +++ b/src/image.c @@ -2396,7 +2396,7 @@ image_load_qt_1 (f, img, type, fss, dh) FSSpec *fss; Handle dh; { - OSErr err; + ComponentResult err; GraphicsImportComponent gi; Rect rect; int width, height; -- cgit v1.2.1 From cc4d4639cfd7491eafb5e2e815bf3bf6382e3d2f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:09:06 +0000 Subject: (in_sighandler): Remove variable. (Fcurrent_idle_time): Add missing `doc:'. (input_available_signal, init_keyboard): Undo previous change. --- src/keyboard.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index abf57937966..662aacf91a6 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -100,14 +100,6 @@ int interrupt_input_pending; /* File descriptor to use for input. */ extern int input_fd; -/* Nonzero if we are executing from the SIGIO signal handler. - The difference between in_sighandler and handling_signal is that - in_sighandler is only set when executing in a signal handler. - handling_signal may be set even if not executing in a signal handler, for - example when reinvoke_input_signal is called from UNBLOCK_INPUT, or - when Emacs is compiled with SYNC_INPUT defined. */ -int in_sighandler; - #ifdef HAVE_WINDOW_SYSTEM /* Make all keyboard buffers much bigger when using X windows. */ #ifdef MAC_OS8 @@ -4560,7 +4552,7 @@ timer_check (do_it_now) } DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0, - /* Return the current length of Emacs idleness. + doc: /* Return the current length of Emacs idleness. The value is returned as a list of three integers. The first has the most significant 16 bits of the seconds, while the second has the least significant 16 bits. The third integer gives the microsecond @@ -6977,8 +6969,6 @@ input_available_signal (signo) SIGNAL_THREAD_CHECK (signo); #endif - in_sighandler = 1; - if (input_available_clear_time) EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0); @@ -6990,7 +6980,6 @@ input_available_signal (signo) sigfree (); #endif errno = old_errno; - in_sighandler = 0; } #endif /* SIGIO */ @@ -10858,7 +10847,6 @@ init_keyboard () do_mouse_tracking = Qnil; #endif input_pending = 0; - in_sighandler = 0; /* This means that command_loop_1 won't try to select anything the first time through. */ -- cgit v1.2.1 From 07927df07d03dedf59450771f0353b7795121ebe Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:09:14 +0000 Subject: (in_sighandler): Remove extern. --- src/keyboard.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'src') diff --git a/src/keyboard.h b/src/keyboard.h index f8d8f789c08..96ac7d2e856 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -190,9 +190,6 @@ extern EMACS_INT num_nonmacro_input_events; /* Nonzero means polling for input is temporarily suppressed. */ extern int poll_suppress_count; -/* Nonzero if we are executing from the SIGIO signal handler. */ -extern int in_sighandler; - /* Keymap mapping ASCII function key sequences onto their preferred forms. Initialized by the terminal-specific lisp files. */ extern Lisp_Object Vfunction_key_map; -- cgit v1.2.1 From 270e593abdc765781c7cfe221e57eadb11ec3f00 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:09:23 +0000 Subject: (create_apple_event_from_event_ref, select) (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator) (Fmac_set_file_type, cfstring_create_normalized) (mac_get_system_locale, select_and_poll_event, sys_select): Use OSStatus instead of OSErr. --- src/mac.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/mac.c b/src/mac.c index 4652757fab3..67fd5e4f5e0 100644 --- a/src/mac.c +++ b/src/mac.c @@ -831,7 +831,7 @@ create_apple_event (class, id, result) return err; } -OSErr +OSStatus create_apple_event_from_event_ref (event, num_params, names, types, result) EventRef event; UInt32 num_params; @@ -839,7 +839,7 @@ create_apple_event_from_event_ref (event, num_params, names, types, result) EventParamType *types; AppleEvent *result; { - OSErr err; + OSStatus err; UInt32 i, size; CFStringRef string; CFDataRef data; @@ -2424,7 +2424,7 @@ select (n, rfds, wfds, efds, timeout) SELECT_TYPE *efds; struct timeval *timeout; { - OSErr err; + OSStatus err; #if TARGET_API_MAC_CARBON EventTimeout timeout_sec = (timeout @@ -4192,7 +4192,7 @@ DEFUN ("mac-get-file-creator", Fmac_get_file_creator, Smac_get_file_creator, 1, (filename) Lisp_Object filename; { - OSErr status; + OSStatus status; #ifdef MAC_OSX FSRef fref; #else @@ -4246,7 +4246,7 @@ DEFUN ("mac-get-file-type", Fmac_get_file_type, Smac_get_file_type, 1, 1, 0, (filename) Lisp_Object filename; { - OSErr status; + OSStatus status; #ifdef MAC_OSX FSRef fref; #else @@ -4302,7 +4302,7 @@ assumed. Return non-nil if successful. */) (filename, code) Lisp_Object filename, code; { - OSErr status; + OSStatus status; #ifdef MAC_OSX FSRef fref; #else @@ -4362,7 +4362,7 @@ CODE must be a 4-character string. Return non-nil if successful. */) (filename, code) Lisp_Object filename, code; { - OSErr status; + OSStatus status; #ifdef MAC_OSX FSRef fref; #else @@ -4775,7 +4775,7 @@ cfstring_create_normalized (str, symbol) UnicodeMapping map; CFIndex length; UniChar *in_text, *buffer = NULL, *out_buf = NULL; - OSErr err = noErr; + OSStatus err = noErr; ByteCount out_read, out_size, out_len; map.unicodeEncoding = CreateTextEncoding (kTextEncodingUnicodeDefault, @@ -4910,7 +4910,7 @@ On successful conversion, return the result string, else return nil. */) static Lisp_Object mac_get_system_locale () { - OSErr err; + OSStatus err; LangCode lang; RegionCode region; LocaleRef locale; @@ -4987,7 +4987,7 @@ select_and_poll_event (n, rfds, wfds, efds, timeout) struct timeval *timeout; { int r; - OSErr err; + OSStatus err; r = select (n, rfds, wfds, efds, timeout); if (r != -1) @@ -5017,7 +5017,7 @@ sys_select (n, rfds, wfds, efds, timeout) SELECT_TYPE *efds; struct timeval *timeout; { - OSErr err; + OSStatus err; int i, r; EMACS_TIME select_timeout; -- cgit v1.2.1 From 3bb4025e9f085bd0e541ef57122ddbe5590965d0 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:09:33 +0000 Subject: [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't use FRAME_FILE_NAME. Use (FS)UpdateAlias. (Fx_create_frame): Apply 2006-07-03 for xfns.c. --- src/macfns.c | 87 ++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 53 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/macfns.c b/src/macfns.c index a72cd66cdce..faf4bc01a6a 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -1945,63 +1945,80 @@ static void mac_update_proxy_icon (f) struct frame *f; { + OSStatus err; Lisp_Object file_name = XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename; Window w = FRAME_MAC_WINDOW (f); - - if (FRAME_FILE_NAME (f) == NULL && !STRINGP (file_name)) - return; - if (FRAME_FILE_NAME (f) && STRINGP (file_name) - && strcmp (FRAME_FILE_NAME (f), SDATA (file_name)) == 0) - return; - - if (FRAME_FILE_NAME (f)) - { - xfree (FRAME_FILE_NAME (f)); - FRAME_FILE_NAME (f) = NULL; - } + AliasHandle alias = NULL; BLOCK_INPUT; + err = GetWindowProxyAlias (w, &alias); + if (err == errWindowDoesNotHaveProxy && !STRINGP (file_name)) + goto out; + if (STRINGP (file_name)) { - OSStatus err; AEDesc desc; +#ifdef MAC_OSX + FSRef fref; +#else + FSSpec fss; +#endif + Boolean changed; Lisp_Object encoded_file_name = ENCODE_FILE (file_name); -#ifdef MAC_OS8 +#ifdef MAC_OSX + err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name), + SBYTES (encoded_file_name), typeFSRef, &desc); +#else SetPortWindowPort (w); -#endif err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name), - SBYTES (encoded_file_name), typeAlias, &desc); + SBYTES (encoded_file_name), typeFSS, &desc); +#endif if (err == noErr) { - Size size = AEGetDescDataSize (&desc); - AliasHandle alias = (AliasHandle) NewHandle (size); - - if (alias == NULL) - err = memFullErr; - else - { - HLock ((Handle) alias); - err = AEGetDescData (&desc, *alias, size); - HUnlock ((Handle) alias); - if (err == noErr) - err = SetWindowProxyAlias (w, alias); - DisposeHandle ((Handle) alias); - } +#ifdef MAC_OSX + err = AEGetDescData (&desc, &fref, sizeof (FSRef)); +#else + err = AEGetDescData (&desc, &fss, sizeof (FSSpec)); +#endif AEDisposeDesc (&desc); } if (err == noErr) { - FRAME_FILE_NAME (f) = xmalloc (SBYTES (file_name) + 1); - strcpy (FRAME_FILE_NAME (f), SDATA (file_name)); + if (alias) + { +#ifdef MAC_OSX + err = FSUpdateAlias (NULL, &fref, alias, &changed); +#else + err = UpdateAlias (NULL, &fss, alias, &changed); +#endif + } + if (err != noErr || alias == NULL) + { + if (alias) + DisposeHandle ((Handle) alias); +#ifdef MAC_OSX + err = FSNewAliasMinimal (&fref, &alias); +#else + err = NewAliasMinimal (&fss, &alias); +#endif + changed = true; + } } + if (err == noErr) + if (changed) + err = SetWindowProxyAlias (w, alias); } - if (FRAME_FILE_NAME (f) == NULL) + if (alias) + DisposeHandle ((Handle) alias); + + if (err != noErr || !STRINGP (file_name)) RemoveWindowProxy (w); + out: UNBLOCK_INPUT; } #endif @@ -2566,7 +2583,6 @@ This function is an internal primitive--use `make-frame' instead. */) f->output_data.mac = (struct mac_output *) xmalloc (sizeof (struct mac_output)); bzero (f->output_data.mac, sizeof (struct mac_output)); FRAME_FONTSET (f) = -1; - record_unwind_protect (unwind_create_frame, frame); f->icon_name = mac_get_arg (parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING); @@ -2574,6 +2590,9 @@ This function is an internal primitive--use `make-frame' instead. */) f->icon_name = Qnil; /* FRAME_MAC_DISPLAY_INFO (f) = dpyinfo; */ + + /* With FRAME_MAC_DISPLAY_INFO set up, this unwind-protect is safe. */ + record_unwind_protect (unwind_create_frame, frame); #if GLYPH_DEBUG image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; dpyinfo_refcount = dpyinfo->reference_count; -- cgit v1.2.1 From 31f93085857c71413081acc06c4254cb1fca647f Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:09:41 +0000 Subject: (get_scrap_from_symbol, clear_scrap, put_scrap_string) (put_scrap_private_timestamp, scrap_has_target_type, get_scrap_string) (get_scrap_private_timestamp, get_scrap_target_type_list) (x_own_selection, x_get_foreign_selection) (Fx_disown_selection_internal, Fx_selection_owner_p) (Fx_selection_exists_p): Use OSStatus instead of OSErr. --- src/macselect.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/macselect.c b/src/macselect.c index 67a28cf9e64..fd72bd3cb14 100644 --- a/src/macselect.c +++ b/src/macselect.c @@ -31,15 +31,15 @@ typedef int ScrapRef; typedef ResType ScrapFlavorType; #endif /* !TARGET_API_MAC_CARBON */ -static OSErr get_scrap_from_symbol P_ ((Lisp_Object, int, ScrapRef *)); +static OSStatus get_scrap_from_symbol P_ ((Lisp_Object, int, ScrapRef *)); static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object)); static int valid_scrap_target_type_p P_ ((Lisp_Object)); -static OSErr clear_scrap P_ ((ScrapRef *)); -static OSErr put_scrap_string P_ ((ScrapRef, Lisp_Object, Lisp_Object)); -static OSErr put_scrap_private_timestamp P_ ((ScrapRef, unsigned long)); +static OSStatus clear_scrap P_ ((ScrapRef *)); +static OSStatus put_scrap_string P_ ((ScrapRef, Lisp_Object, Lisp_Object)); +static OSStatus put_scrap_private_timestamp P_ ((ScrapRef, unsigned long)); static ScrapFlavorType scrap_has_target_type P_ ((ScrapRef, Lisp_Object)); static Lisp_Object get_scrap_string P_ ((ScrapRef, Lisp_Object)); -static OSErr get_scrap_private_timestamp P_ ((ScrapRef, unsigned long *)); +static OSStatus get_scrap_private_timestamp P_ ((ScrapRef, unsigned long *)); static Lisp_Object get_scrap_target_type_list P_ ((ScrapRef)); static void x_own_selection P_ ((Lisp_Object, Lisp_Object)); static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int)); @@ -108,13 +108,13 @@ static Lisp_Object Vmac_service_selection; reference is set to *SCRAP, and it becomes NULL if there's no corresponding scrap. Clear the scrap if CLEAR_P is non-zero. */ -static OSErr +static OSStatus get_scrap_from_symbol (sym, clear_p, scrap) Lisp_Object sym; int clear_p; ScrapRef *scrap; { - OSErr err = noErr; + OSStatus err = noErr; Lisp_Object str = Fget (sym, Qmac_scrap_name); if (!STRINGP (str)) @@ -172,7 +172,7 @@ valid_scrap_target_type_p (sym) /* Clear the scrap whose reference is *SCRAP. */ -static INLINE OSErr +static INLINE OSStatus clear_scrap (scrap) ScrapRef *scrap; { @@ -190,7 +190,7 @@ clear_scrap (scrap) /* Put Lisp String STR to the scrap SCRAP. The target type is specified by TYPE. */ -static OSErr +static OSStatus put_scrap_string (scrap, type, str) ScrapRef scrap; Lisp_Object type, str; @@ -211,7 +211,7 @@ put_scrap_string (scrap, type, str) /* Put TIMESTAMP to the scrap SCRAP. The timestamp is used for checking if the scrap is owned by the process. */ -static INLINE OSErr +static INLINE OSStatus put_scrap_private_timestamp (scrap, timestamp) ScrapRef scrap; unsigned long timestamp; @@ -233,7 +233,7 @@ scrap_has_target_type (scrap, type) ScrapRef scrap; Lisp_Object type; { - OSErr err; + OSStatus err; ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type); if (flavor_type) @@ -264,7 +264,7 @@ get_scrap_string (scrap, type) ScrapRef scrap; Lisp_Object type; { - OSErr err; + OSStatus err; Lisp_Object result = Qnil; ScrapFlavorType flavor_type = get_flavor_type_from_symbol (type); #if TARGET_API_MAC_CARBON @@ -310,12 +310,12 @@ get_scrap_string (scrap, type) /* Get timestamp from the scrap SCRAP and set to *TIMPSTAMP. */ -static OSErr +static OSStatus get_scrap_private_timestamp (scrap, timestamp) ScrapRef scrap; unsigned long *timestamp; { - OSErr err = noErr; + OSStatus err = noErr; #if TARGET_API_MAC_CARBON ScrapFlavorFlags flags; @@ -365,7 +365,7 @@ get_scrap_target_type_list (scrap) { Lisp_Object result = Qnil, rest, target_type; #if TARGET_API_MAC_CARBON - OSErr err; + OSStatus err; UInt32 count, i, type; ScrapFlavorInfo *flavor_info = NULL; Lisp_Object strings = Qnil; @@ -425,7 +425,7 @@ static void x_own_selection (selection_name, selection_value) Lisp_Object selection_name, selection_value; { - OSErr err; + OSStatus err; ScrapRef scrap; struct gcpro gcpro1, gcpro2; Lisp_Object rest, handler_fn, value, type; @@ -671,7 +671,7 @@ static Lisp_Object x_get_foreign_selection (selection_symbol, target_type, time_stamp) Lisp_Object selection_symbol, target_type, time_stamp; { - OSErr err; + OSStatus err; ScrapRef scrap; Lisp_Object result = Qnil; @@ -765,7 +765,7 @@ Disowning it means there is no such selection. */) Lisp_Object selection; Lisp_Object time; { - OSErr err; + OSStatus err; ScrapRef scrap; Lisp_Object local_selection_data; @@ -828,7 +828,7 @@ and t is the same as `SECONDARY'. */) (selection) Lisp_Object selection; { - OSErr err; + OSStatus err; ScrapRef scrap; Lisp_Object result = Qnil, local_selection_data; @@ -873,7 +873,7 @@ and t is the same as `SECONDARY'. */) (selection) Lisp_Object selection; { - OSErr err; + OSStatus err; ScrapRef scrap; Lisp_Object result = Qnil, rest; @@ -931,7 +931,7 @@ struct suspended_ae_info struct suspended_ae_info *next; }; -/* List of deferred apple events at the startup time. */ +/* List of apple events deferred at the startup time. */ static struct suspended_ae_info *deferred_apple_events = NULL; /* List of suspended apple events, in order of expiration_tick. */ -- cgit v1.2.1 From 3e7424f76a790845e4972f77e936264d631cb706 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:09:52 +0000 Subject: (mac_draw_string_common, mac_query_char_extents) (x_iconify_frame, XLoadQueryFont, install_window_handler) (mac_handle_command_event, init_command_handler, init_menu_bar): Use OSStatus instead of OSErr. (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Don't use FRAME_FILE_NAME. (x_query_font): Apply 2006-08-04 change for xterm.c. (Qhi_command): Rename from Qhicommand. All uses changed. --- src/macterm.c | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) (limited to 'src') diff --git a/src/macterm.c b/src/macterm.c index 04b55d9fa80..a5369eb1667 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -902,7 +902,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char) #if USE_ATSUI if (GC_FONT (gc)->mac_style) { - OSErr err; + OSStatus err; ATSUTextLayout text_layout; xassert (bytes_per_char == 2); @@ -1129,7 +1129,7 @@ mac_draw_image_string_16 (f, gc, x, y, buf, nchars, bg_width) the font of the current graphics port. If CG_GLYPH is not NULL, *CG_GLYPH is set to the glyph ID or 0 if it cannot be obtained. */ -static OSErr +static OSStatus mac_query_char_extents (style, c, font_ascent_return, font_descent_return, overall_return, cg_glyph) @@ -1147,7 +1147,7 @@ mac_query_char_extents (style, c, void *cg_glyph; #endif { - OSErr err = noErr; + OSStatus err = noErr; int width; Rect char_bounds; @@ -1193,7 +1193,7 @@ mac_query_char_extents (style, c, #if USE_CG_TEXT_DRAWING if (err == noErr && cg_glyph) { - OSErr err1; + OSStatus err1; ATSUGlyphInfoArray glyph_info_array; ByteCount count = sizeof (ATSUGlyphInfoArray); @@ -6314,7 +6314,7 @@ void x_iconify_frame (f) struct frame *f; { - OSErr err; + OSStatus err; /* A deactivate event does not occur when the last visible frame is iconified. So if we clear the highlight here, it will not be @@ -6378,11 +6378,6 @@ x_free_frame_resources (f) if (FRAME_SIZE_HINTS (f)) xfree (FRAME_SIZE_HINTS (f)); -#if TARGET_API_MAC_CARBON - if (FRAME_FILE_NAME (f)) - xfree (FRAME_FILE_NAME (f)); -#endif - xfree (f->output_data.mac); f->output_data.mac = NULL; @@ -7200,7 +7195,7 @@ init_font_name_table () if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), text_encoding_info_alist))) { - OSErr err; + OSStatus err; struct Lisp_Hash_Table *h; unsigned hash_code; ItemCount nfonts, i; @@ -7782,7 +7777,7 @@ XLoadQueryFont (Display *dpy, char *fontname) #if USE_ATSUI if (strcmp (charset, "iso10646-1") == 0) /* XXX */ { - OSErr err; + OSStatus err; ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, kATSUQDBoldfaceTag, kATSUQDItalicTag}; ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed), @@ -7865,7 +7860,7 @@ XLoadQueryFont (Display *dpy, char *fontname) #if USE_ATSUI if (font->mac_style) { - OSErr err; + OSStatus err; UniChar c; font->min_byte1 = 0; @@ -8344,8 +8339,8 @@ x_query_font (f, fontname) for (i = 0; i < dpyinfo->n_fonts; i++) if (dpyinfo->font_table[i].name - && (!strcmp (dpyinfo->font_table[i].name, fontname) - || !strcmp (dpyinfo->font_table[i].full_name, fontname))) + && (!xstricmp (dpyinfo->font_table[i].name, fontname) + || !xstricmp (dpyinfo->font_table[i].full_name, fontname))) return (dpyinfo->font_table + i); return NULL; } @@ -8539,7 +8534,7 @@ Point saved_menu_event_location; /* Apple Events */ #if USE_CARBON_EVENTS -static Lisp_Object Qhicommand; +static Lisp_Object Qhi_command; #ifdef MAC_OSX extern Lisp_Object Qwindow; static Lisp_Object Qtoolbar_switch_mode; @@ -8581,7 +8576,7 @@ static Lisp_Object Qservice, Qpaste, Qperform; static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, EventRef, void *); #endif -OSErr install_window_handler (WindowPtr); +OSStatus install_window_handler (WindowPtr); extern void init_emacs_passwd_dir (); extern int emacs_main (int, char **, char **); @@ -9382,15 +9377,15 @@ mac_handle_command_event (next_handler, event, data) if (err != noErr || command.commandID == 0) return eventNotHandledErr; - /* A HICommand event is mapped to an Apple event whose event class - symbol is `hicommand' and event ID is its command ID. */ + /* A HI command event is mapped to an Apple event whose event class + symbol is `hi-command' and event ID is its command ID. */ err = mac_store_event_ref_as_apple_event (0, command.commandID, - Qhicommand, Qnil, + Qhi_command, Qnil, event, num_params, names, types); return err == noErr ? noErr : eventNotHandledErr; } -static OSErr +static OSStatus init_command_handler () { EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; @@ -9891,11 +9886,11 @@ mac_store_service_event (event) #endif /* USE_CARBON_EVENTS */ -OSErr +OSStatus install_window_handler (window) WindowPtr window; { - OSErr err = noErr; + OSStatus err = noErr; #if USE_CARBON_EVENTS EventTypeSpec specs_window[] = {{kEventClassWindow, kEventWindowUpdate}, @@ -11329,7 +11324,7 @@ static void init_menu_bar () { #ifdef MAC_OSX - OSErr err; + OSStatus err; MenuRef menu; MenuItemIndex menu_index; @@ -11512,7 +11507,7 @@ syms_of_macterm () Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); #if USE_CARBON_EVENTS - Qhicommand = intern ("hicommand"); staticpro (&Qhicommand); + Qhi_command = intern ("hi-command"); staticpro (&Qhi_command); #ifdef MAC_OSX Qtoolbar_switch_mode = intern ("toolbar-switch-mode"); staticpro (&Qtoolbar_switch_mode); -- cgit v1.2.1 From b2aad248ba4625b6f3ca7b7e36f7e0d25fed8b7b Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:10:03 +0000 Subject: (struct mac_output) [TARGET_API_MAC_CARBON]: Remove member file_name. (FRAME_FILE_NAME): Remove macro. (install_window_handler, create_apple_event_from_event_ref): Return OSStatus instead of OSErr. --- src/macterm.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/macterm.h b/src/macterm.h index 55bf583c214..945dbf3af57 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -335,11 +335,6 @@ struct mac_output { /* Hints for the size and the position of a window. */ XSizeHints *size_hints; -#if TARGET_API_MAC_CARBON - /* File name for the proxy icon of this frame. Might be NULL. */ - char *file_name; -#endif - #if USE_CG_DRAWING /* Quartz 2D graphics context. */ CGContextRef cg_context; @@ -365,8 +360,6 @@ typedef struct mac_output mac_output; #define FRAME_SIZE_HINTS(f) ((f)->output_data.mac->size_hints) -#define FRAME_FILE_NAME(f) ((f)->output_data.mac->file_name) - /* This gives the mac_display_info structure for the display F is on. */ #define FRAME_MAC_DISPLAY_INFO(f) (&one_mac_display_info) #define FRAME_X_DISPLAY_INFO(f) (&one_mac_display_info) @@ -634,7 +627,7 @@ extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *)); extern int mac_font_panel_visible_p P_ ((void)); extern OSStatus mac_show_hide_font_panel P_ ((void)); extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int)); -extern OSErr install_window_handler P_ ((WindowPtr)); +extern OSStatus install_window_handler P_ ((WindowPtr)); extern void remove_window_handler P_ ((WindowPtr)); extern void do_menu_choice P_ ((SInt32)); extern OSStatus mac_post_mouse_moved_event P_ ((void)); @@ -675,10 +668,10 @@ extern void mac_clear_font_name_table P_ ((void)); extern Lisp_Object mac_aedesc_to_lisp P_ ((const AEDesc *)); extern OSErr mac_ae_put_lisp P_ ((AEDescList *, UInt32, Lisp_Object)); #if TARGET_API_MAC_CARBON -extern OSErr create_apple_event_from_event_ref P_ ((EventRef, UInt32, - EventParamName *, - EventParamType *, - AppleEvent *)); +extern OSStatus create_apple_event_from_event_ref P_ ((EventRef, UInt32, + EventParamName *, + EventParamType *, + AppleEvent *)); extern OSErr create_apple_event_from_drag_ref P_ ((DragRef, UInt32, FlavorType *, AppleEvent *)); -- cgit v1.2.1 From eb411049435acd5469021b64ce3f59c4ac05f491 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Sun, 27 Aug 2006 07:10:26 +0000 Subject: *** empty log message *** --- src/ChangeLog | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ac1ac8b53b3..c7a065c091e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,52 @@ +2006-08-27 YAMAMOTO Mitsuharu + + * alloc.c (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Undo previous + change. Move mutex lock/unlock operations inside BLOCK_INPUT. + + * dired.c (directory_files_internal_unwind, directory_files_internal) + (file_name_completion): Add BLOCK_INPUT around opendir/closedir. + + * image.c [MAC_OS] (image_load_qt_1): Use ComponentResult instead + of OSErr. + + * keyboard.c (in_sighandler): Remove variable. + (Fcurrent_idle_time): Add missing `doc:'. + (input_available_signal, init_keyboard): Undo previous change. + + * keyboard.h (in_sighandler): Remove extern. + + * mac.c (create_apple_event_from_event_ref, select) + (Fmac_get_file_creator, Fmac_get_file_type, Fmac_set_file_creator) + (Fmac_set_file_type, cfstring_create_normalized) + (mac_get_system_locale, select_and_poll_event, sys_select): Use + OSStatus instead of OSErr. + + * macfns.c [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't + use FRAME_FILE_NAME. Use (FS)UpdateAlias. + (Fx_create_frame): Apply 2006-07-03 for xfns.c. + + * macselect.c (get_scrap_from_symbol, clear_scrap, put_scrap_string) + (put_scrap_private_timestamp, scrap_has_target_type, get_scrap_string) + (get_scrap_private_timestamp, get_scrap_target_type_list) + (x_own_selection, x_get_foreign_selection) + (Fx_disown_selection_internal, Fx_selection_owner_p) + (Fx_selection_exists_p): Use OSStatus instead of OSErr. + + * macterm.c (mac_draw_string_common, mac_query_char_extents) + (x_iconify_frame, XLoadQueryFont, install_window_handler) + (mac_handle_command_event, init_command_handler, init_menu_bar): + Use OSStatus instead of OSErr. + (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Don't use + FRAME_FILE_NAME. + (x_query_font): Apply 2006-08-04 change for xterm.c. + (Qhi_command): Rename from Qhicommand. All uses changed. + + * macterm.h (struct mac_output) [TARGET_API_MAC_CARBON]: Remove member + file_name. + (FRAME_FILE_NAME): Remove macro. + (install_window_handler, create_apple_event_from_event_ref): + Return OSStatus instead of OSErr. + 2006-08-26 Kim F. Storm * buffer.c (Fset_buffer_multibyte): -- cgit v1.2.1