From 03f1132278dce5f86456f58418f608d6d0aa6e14 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 3 Jun 2005 10:39:29 +0000 Subject: (Finternal_lisp_face_equal_p): Really report on faces in a frame, if the argument FRAME is non-nil. Improve argument/docstring consistency. --- src/xfaces.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/xfaces.c b/src/xfaces.c index 21bdb88c860..606a854980a 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -5022,8 +5022,8 @@ lface_equal_p (v1, v2) DEFUN ("internal-lisp-face-equal-p", Finternal_lisp_face_equal_p, Sinternal_lisp_face_equal_p, 2, 3, 0, doc: /* True if FACE1 and FACE2 are equal. -If the optional argument FRAME is given, report on face FACE in that frame. -If FRAME is t, report on the defaults for face FACE (for new frames). +If the optional argument FRAME is given, report on FACE1 and FACE2 in that frame. +If FRAME is t, report on the defaults for FACE1 and FACE2 (for new frames). If FRAME is omitted or nil, use the selected frame. */) (face1, face2, frame) Lisp_Object face1, face2, frame; @@ -5041,8 +5041,8 @@ If FRAME is omitted or nil, use the selected frame. */) Emacs. That frame is not an X frame. */ f = frame_or_selected_frame (frame, 2); - lface1 = lface_from_face_name (NULL, face1, 1); - lface2 = lface_from_face_name (NULL, face2, 1); + lface1 = lface_from_face_name (f, face1, 1); + lface2 = lface_from_face_name (f, face2, 1); equal_p = lface_equal_p (XVECTOR (lface1)->contents, XVECTOR (lface2)->contents); return equal_p ? Qt : Qnil; -- cgit v1.2.1 From 6312e5f78c6904267e0bebff5b8e9b4138e1491b Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 3 Jun 2005 10:40:12 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index dbcac952b51..1982a76162e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-06-03 Juanma Barranquero + + * xfaces.c (Finternal_lisp_face_equal_p): Really report + on faces in a frame, if the argument FRAME is non-nil. + Improve argument/docstring consistency. + 2005-06-02 Kim F. Storm * xdisp.c (MODE_LINE_NOPROP_LEN): New macro. -- cgit v1.2.1 From 24aad44185871b6e1cd36265b10639bed9b97f1a Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 3 Jun 2005 23:02:03 +0000 Subject: (handle_one_xevent): Also ignore mouse motion just before a button release event. --- src/xterm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/xterm.c b/src/xterm.c index 4f9081425f3..8612d53fbee 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6776,12 +6776,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) { dpyinfo->grabbed |= (1 << event.xbutton.button); last_mouse_frame = f; - /* Ignore any mouse motion that happened - before this event; any subsequent mouse-movement - Emacs events should reflect only motion after - the ButtonPress. */ - if (f != 0) - f->mouse_moved = 0; if (!tool_bar_p) last_tool_bar_item = -1; @@ -6789,6 +6783,12 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) else dpyinfo->grabbed &= ~(1 << event.xbutton.button); + /* Ignore any mouse motion that happened before this event; + any subsequent mouse-movement Emacs events should reflect + only motion after the ButtonPress/Release. */ + if (f != 0) + f->mouse_moved = 0; + #if defined (USE_X_TOOLKIT) || defined (USE_GTK) f = x_menubar_window_to_frame (dpyinfo, event.xbutton.window); /* For a down-event in the menu bar, -- cgit v1.2.1 From 5a073f50755944ae51a08f670d8acf192d69e036 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 3 Jun 2005 23:02:21 +0000 Subject: (unbind_to): Preserve value of Vquit_flag. --- src/eval.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/eval.c b/src/eval.c index 8bb201c5df5..0eb1482ee0b 100644 --- a/src/eval.c +++ b/src/eval.c @@ -3130,10 +3130,10 @@ unbind_to (count, value) int count; Lisp_Object value; { - int quitf = !NILP (Vquit_flag); - struct gcpro gcpro1; + Lisp_Object quitf = Vquit_flag; + struct gcpro gcpro1, gcpro2; - GCPRO1 (value); + GCPRO2 (value, quitf); Vquit_flag = Qnil; while (specpdl_ptr != specpdl + count) @@ -3182,8 +3182,8 @@ unbind_to (count, value) } } - if (NILP (Vquit_flag) && quitf) - Vquit_flag = Qt; + if (NILP (Vquit_flag) && !NILP (quitf)) + Vquit_flag = quitf; UNGCPRO; return value; -- cgit v1.2.1 From 731475e79a78cb7f0eb8a25c22a17513fea02738 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 3 Jun 2005 23:02:30 +0000 Subject: (BYTE_CODE_QUIT): Check Vthrow_on_input. --- src/bytecode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/bytecode.c b/src/bytecode.c index e8d006e67d1..6b05a3270d2 100644 --- a/src/bytecode.c +++ b/src/bytecode.c @@ -384,8 +384,11 @@ unmark_byte_stack () do { \ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ { \ + Lisp_Object flag = Vquit_flag; \ Vquit_flag = Qnil; \ BEFORE_POTENTIAL_GC (); \ + if (EQ (Vthrow_on_input, flag)) \ + Fthrow (Vthrow_on_input, Qnil); \ Fsignal (Qquit, Qnil); \ AFTER_POTENTIAL_GC (); \ } \ -- cgit v1.2.1 From 4da256b12405664071edb7183de9e94cce8ec210 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 3 Jun 2005 23:02:40 +0000 Subject: (Fcall_process): Don't use alloca to gradually increase size of buf, as it effectively uses twice the necessary space on the stack. Instead, pre-allocate buf of full size, and gradually increase the read size. --- src/callproc.c | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/callproc.c b/src/callproc.c index 6027ccdda9f..fe198b0770a 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -218,9 +218,10 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) int fd[2]; int filefd; register int pid; - char buf[16384]; - char *bufptr = buf; - int bufsize = sizeof buf; +#define CALLPROC_BUFFER_SIZE_MIN (16 * 1024) +#define CALLPROC_BUFFER_SIZE_MAX (4 * CALLPROC_BUFFER_SIZE_MIN) + char buf[CALLPROC_BUFFER_SIZE_MAX]; + int bufsize = CALLPROC_BUFFER_SIZE_MIN; int count = SPECPDL_INDEX (); register const unsigned char **new_argv @@ -765,7 +766,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) nread = carryover; while (nread < bufsize - 1024) { - int this_read = emacs_read (fd[0], bufptr + nread, + int this_read = emacs_read (fd[0], buf + nread, bufsize - nread); if (this_read < 0) @@ -790,7 +791,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (!NILP (buffer)) { if (! CODING_MAY_REQUIRE_DECODING (&process_coding)) - insert_1_both (bufptr, nread, nread, 0, 1, 0); + insert_1_both (buf, nread, nread, 0, 1, 0); else { /* We have to decode the input. */ int size; @@ -807,7 +808,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) requires text-encoding detection. */ if (process_coding.type == coding_type_undecided) { - detect_coding (&process_coding, bufptr, nread); + detect_coding (&process_coding, buf, nread); if (process_coding.composing != COMPOSITION_DISABLED) /* We have not yet allocated the composition data because the coding type was undecided. */ @@ -816,7 +817,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (process_coding.cmp_data) process_coding.cmp_data->char_offset = PT; - decode_coding (&process_coding, bufptr, decoding_buf, + decode_coding (&process_coding, buf, decoding_buf, nread, size); if (display_on_the_fly @@ -905,7 +906,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (carryover > 0) /* As CARRYOVER should not be that large, we had better avoid overhead of bcopy. */ - BCOPY_SHORT (bufptr + process_coding.consumed, bufptr, + BCOPY_SHORT (buf + process_coding.consumed, buf, carryover); if (process_coding.result == CODING_FINISH_INSUFFICIENT_CMP) { @@ -922,17 +923,13 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) if (process_coding.mode & CODING_MODE_LAST_BLOCK) break; +#if (CALLPROC_BUFFER_SIZE_MIN != CALLPROC_BUFFER_SIZE_MAX) /* Make the buffer bigger as we continue to read more data, - but not past 64k. */ - if (bufsize < 64 * 1024 && total_read > 32 * bufsize) - { - char *tempptr; - bufsize *= 2; - - tempptr = (char *) alloca (bufsize); - bcopy (bufptr, tempptr, bufsize / 2); - bufptr = tempptr; - } + but not past CALLPROC_BUFFER_SIZE_MAX. */ + if (bufsize < CALLPROC_BUFFER_SIZE_MAX && total_read > 32 * bufsize) + if ((bufsize *= 2) > CALLPROC_BUFFER_SIZE_MAX) + bufsize = CALLPROC_BUFFER_SIZE_MAX; +#endif if (display_p) { -- cgit v1.2.1 From c3912f23e3becd31ba3d7d86cbeac00f88046fee Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 3 Jun 2005 23:02:50 +0000 Subject: (decode_coding_string): Handle CODING_FINISH_INTERRUPT. --- src/coding.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/coding.c b/src/coding.c index a0e22184d3c..a7a78bbe2c0 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6260,6 +6260,7 @@ decode_coding_string (str, coding, nocopy) produced += coding->produced; produced_char += coding->produced_char; if (result == CODING_FINISH_NORMAL + || result == CODING_FINISH_INTERRUPT || (result == CODING_FINISH_INSUFFICIENT_SRC && coding->consumed == 0)) break; -- cgit v1.2.1 From 555228aa599a4132c51d7daae62377f1e1ae8921 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Fri, 3 Jun 2005 23:47:56 +0000 Subject: *** empty log message *** --- src/ChangeLog | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1982a76162e..5f724fe8450 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,19 @@ +2005-06-04 Kim F. Storm + + * coding.c (decode_coding_string): Handle CODING_FINISH_INTERRUPT. + + * callproc.c (Fcall_process): Don't use alloca to gradually + increase size of buf, as it effectively uses twice the necessary + space on the stack. Instead, pre-allocate buf of full size, and + gradually increase the read size. + + * bytecode.c (BYTE_CODE_QUIT): Check Vthrow_on_input. + + * eval.c (unbind_to): Preserve value of Vquit_flag. + + * xterm.c (handle_one_xevent): Also ignore mouse motion just + before a button release event. + 2005-06-03 Juanma Barranquero * xfaces.c (Finternal_lisp_face_equal_p): Really report -- cgit v1.2.1 From b89875707ce5b8e88097b7d4d365b480b17733a6 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Sat, 4 Jun 2005 08:06:57 +0000 Subject: * macmenu.c (cleanup_popup_menu): New function. (Fx_popup_menu): unwind protect cleanup_popup_menu in case mac_menu_show Quit:s. (mac_menu_show): Quit on cancel if not popped up on click (i.e. a dialog). --- src/ChangeLog | 8 ++++++++ src/macmenu.c | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 5f724fe8450..36650215350 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-06-04 Jan Dj,Ad(Brv + + * macmenu.c (cleanup_popup_menu): New function. + (Fx_popup_menu): unwind protect cleanup_popup_menu in case + mac_menu_show Quit:s. + (mac_menu_show): Quit on cancel if not popped up on click (i.e. + a dialog). + 2005-06-04 Kim F. Storm * coding.c (decode_coding_string): Handle CODING_FINISH_INTERRUPT. diff --git a/src/macmenu.c b/src/macmenu.c index 54393bca594..e97a968d92d 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -602,6 +602,13 @@ list_of_items (pane) } } +static Lisp_Object +cleanup_popup_menu (arg) + Lisp_Object arg; +{ + discard_menu_items (); +} + DEFUN ("x-popup-menu", Fx_popup_menu, Sx_popup_menu, 2, 2, 0, doc: /* Pop up a deck-of-cards menu and return user's selection. POSITION is a position specification. This is either a mouse button @@ -647,6 +654,8 @@ cached information about equivalent key sequences. */) int keymaps = 0; int for_click = 0; struct gcpro gcpro1; + int specpdl_count = SPECPDL_INDEX (); + #ifdef HAVE_MENUS if (! NILP (position)) @@ -806,13 +815,13 @@ cached information about equivalent key sequences. */) #ifdef HAVE_MENUS /* Display them in a menu. */ + record_unwind_protect (cleanup_popup_menu, Qnil); BLOCK_INPUT; selection = mac_menu_show (f, xpos, ypos, for_click, keymaps, title, &error_name); UNBLOCK_INPUT; - - discard_menu_items (); + unbind_to (specpdl_count, Qnil); UNGCPRO; #endif /* HAVE_MENUS */ @@ -1931,6 +1940,9 @@ mac_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; } -- cgit v1.2.1 From 196ac78ce159aaeb675c57e8cabb5747cbba3713 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Sat, 4 Jun 2005 18:09:16 +0000 Subject: (popup_get_selection): Click not in menu deactivates menu. --- src/ChangeLog | 4 ++++ src/xmenu.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 36650215350..c0466275d4a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-04 Richard M. Stallman + + * xmenu.c (popup_get_selection): Click not in menu deactivates menu. + 2005-06-04 Jan Dj,Ad(Brv * macmenu.c (cleanup_popup_menu): New function. diff --git a/src/xmenu.c b/src/xmenu.c index 6f758d12fc7..6e3a21604c1 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1235,6 +1235,10 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers) if (event.type == ButtonRelease && dpyinfo->display == event.xbutton.display) { + /* If the click is not on the menu, deactivate the menu. */ + if (x_any_window_to_frame (dpyinfo, event.xexpose.window)) + popup_activated_flag = 0; + dpyinfo->grabbed &= ~(1 << event.xbutton.button); #ifdef USE_MOTIF /* Pretending that the event came from a Btn1Down seems the only way to convince Motif to -- cgit v1.2.1 From 24af414ed1c4ac099b955728f8d4821952eaf123 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Jun 2005 19:38:23 +0000 Subject: (DOC): Define to point to the generated DOC-X. --- src/makefile.w32-in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 5a232e28362..b5890593cd8 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -42,6 +42,8 @@ TOBJ = $(BLD)/firstfile.$(O) TRES = $(BLD)/emacs.res TLASTLIB = $(BLD)/lastfile.$(A) +DOC = $(OBJDIR)/etc/DOC-X + FULL_LINK_FLAGS = $(LINK_FLAGS) $(TEMACS_EXTRA_LINK) # -- cgit v1.2.1 From 910182298af7f21498c03a2edfdf4331539de386 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Jun 2005 19:47:24 +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 c0466275d4a..2264a791014 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-04 Eli Zaretskii + + * makefile.w32-in (DOC): Define to point to the generated DOC-X. + 2005-06-04 Richard M. Stallman * xmenu.c (popup_get_selection): Click not in menu deactivates menu. -- cgit v1.2.1 From c68a2829f2293dfca9edb98aae3426e5a3e6b8c3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Jun 2005 19:59:30 +0000 Subject: Include w32heap.h, to avoid compiler warning about sbrk. --- src/emacs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/emacs.c b/src/emacs.c index 68720eecc27..fd38268386a 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -44,6 +44,7 @@ Boston, MA 02111-1307, USA. */ #include #include /* just for w32.h */ #include "w32.h" +#include "w32heap.h" /* for prototype of sbrk */ #endif #include "lisp.h" -- cgit v1.2.1 From d01a9710746df2584e6f24b1398cbe2d0e87728d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Jun 2005 20:00:54 +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 2264a791014..9d9062e2aa9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2005-06-04 Eli Zaretskii + * emacs.c: Include w32heap.h, to avoid compiler warning about + sbrk. + * makefile.w32-in (DOC): Define to point to the generated DOC-X. 2005-06-04 Richard M. Stallman -- cgit v1.2.1 From b6f0a39717ed4be8f35c059ab32d4b4bd9199129 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Jun 2005 20:09:13 +0000 Subject: *** empty log message *** --- src/ChangeLog | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 9d9062e2aa9..f4f9b8d6537 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2005-06-04 Eli Zaretskii + * s/ms-w32.h (fileno): Don't define if already defined. + * emacs.c: Include w32heap.h, to avoid compiler warning about sbrk. -- cgit v1.2.1 From 23bf9efbaa448c04f1a25106c9e394143d902697 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Jun 2005 20:10:49 +0000 Subject: (fileno): Don't define if already defined. --- src/s/ms-w32.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h index 709b32f1452..998c1f7cf05 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h @@ -354,7 +354,9 @@ Boston, MA 02111-1307, USA. */ #define fcloseall _fcloseall #define fdopen _fdopen #define fgetchar _fgetchar +#ifndef fileno #define fileno _fileno +#endif #define flushall _flushall #define fputchar _fputchar #define fsync _commit -- cgit v1.2.1 From 6e60256665d21eab02d22b9488d68cfc751f8eec Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Jun 2005 20:39:15 +0000 Subject: (gettimeofday): Use struct _timeb, not struct timeb. (open_unc_volume): Cast return value of map_w32_filename, to avoid compiler warnings. --- src/w32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/w32.c b/src/w32.c index cdc41a8c772..8707732fd6c 100644 --- a/src/w32.c +++ b/src/w32.c @@ -1273,7 +1273,7 @@ get_emacs_configuration_options (void) void gettimeofday (struct timeval *tv, struct timezone *tz) { - struct timeb tb; + struct _timeb tb; _ftime (&tb); tv->tv_sec = tb.time; @@ -1777,7 +1777,7 @@ open_unc_volume (const char *path) nr.dwDisplayType = RESOURCEDISPLAYTYPE_SERVER; nr.dwUsage = RESOURCEUSAGE_CONTAINER; nr.lpLocalName = NULL; - nr.lpRemoteName = map_w32_filename (path, NULL); + nr.lpRemoteName = (LPSTR)map_w32_filename (path, NULL); nr.lpComment = NULL; nr.lpProvider = NULL; -- cgit v1.2.1 From 1a8fb4262f0bfaa1244885834feb8963dd615d6a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Jun 2005 20:40:00 +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 f4f9b8d6537..3c72b4e7982 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2005-06-04 Eli Zaretskii + * w32.c (gettimeofday): Use struct _timeb, not struct timeb. + (open_unc_volume): Cast return value of map_w32_filename, to avoid + compiler warnings. + * s/ms-w32.h (fileno): Don't define if already defined. * emacs.c: Include w32heap.h, to avoid compiler warning about -- cgit v1.2.1 From 17a7c5c2b024a97106c865f76e2cbd3b90591615 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Sun, 5 Jun 2005 17:09:55 +0000 Subject: *** empty log message *** --- src/ChangeLog | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 3c72b4e7982..12fc70289aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -6,8 +6,7 @@ * s/ms-w32.h (fileno): Don't define if already defined. - * emacs.c: Include w32heap.h, to avoid compiler warning about - sbrk. + * emacs.c: Include w32heap.h, to avoid compiler warning about sbrk. * makefile.w32-in (DOC): Define to point to the generated DOC-X. -- cgit v1.2.1 From a5a389bb745fa63b3c4299ceb69c903e47de2d6d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 5 Jun 2005 19:13:37 +0000 Subject: (sys_setsockopt): Change arg 4 to `const void *'. In the call to pfn_setsockopt, cast optval to `const char *'. --- src/w32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/w32.c b/src/w32.c index 8707732fd6c..1bb4a91ff03 100644 --- a/src/w32.c +++ b/src/w32.c @@ -3207,7 +3207,7 @@ sys_shutdown (int s, int how) } int -sys_setsockopt (int s, int level, int optname, const char * optval, int optlen) +sys_setsockopt (int s, int level, int optname, const void * optval, int optlen) { if (winsock_lib == NULL) { @@ -3219,7 +3219,7 @@ sys_setsockopt (int s, int level, int optname, const char * optval, int optlen) if (fd_info[s].flags & FILE_SOCKET) { int rc = pfn_setsockopt (SOCK_HANDLE (s), level, optname, - optval, optlen); + (const char *)optval, optlen); if (rc == SOCKET_ERROR) set_errno (); return rc; -- cgit v1.2.1 From a0c3832890dad9977f12eacd1beafb9c50dd7a12 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 5 Jun 2005 19:16:55 +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 12fc70289aa..7ddc5911729 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-05 Eli Zaretskii + + * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the + call to pfn_setsockopt, cast optval to `const char *'. + 2005-06-04 Eli Zaretskii * w32.c (gettimeofday): Use struct _timeb, not struct timeb. -- cgit v1.2.1 From a9b4333620eb259e974445066a8e64cee0c21d69 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 6 Jun 2005 00:45:57 +0000 Subject: *** empty log message *** --- src/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 7ddc5911729..f5bbebbb760 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -5129,7 +5129,7 @@ 2004-06-11 Kenichi Handa - * coding.c (decode_coding_string): Check CODING_FINISH_INTERRUPT. + * coding.c (encode_coding_string): Check CODING_FINISH_INTERRUPT. 2004-06-11 Kim F. Storm -- cgit v1.2.1 From 5494d7bcdba82b2c33278b8d37fee6b0c9bd14e5 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Mon, 6 Jun 2005 10:38:40 +0000 Subject: * window.c (delete_window): Handle the case where a h/vchild has a h/vchild. --- src/ChangeLog | 5 +++++ src/window.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index f5bbebbb760..308d55187d2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-06 Jan Dj,Ad(Brv + + * window.c (delete_window): Handle the case where a h/vchild has + a h/vchild. + 2005-06-05 Eli Zaretskii * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the diff --git a/src/window.c b/src/window.c index faf88c91ffc..4839830b177 100644 --- a/src/window.c +++ b/src/window.c @@ -1452,8 +1452,10 @@ delete_window (window) tem = par->hchild; if (NILP (tem)) tem = par->vchild; - if (NILP (XWINDOW (tem)->next)) + if (NILP (XWINDOW (tem)->next)) { replace_window (parent, tem); + par = XWINDOW (tem); + } /* Since we may be deleting combination windows, we must make sure that not only p but all its children have been marked as deleted. */ @@ -1465,6 +1467,51 @@ delete_window (window) /* Mark this window as deleted. */ p->buffer = p->hchild = p->vchild = Qnil; + if (! NILP (par->parent)) + par = XWINDOW (par->parent); + + /* Check if we have a v/hchild with a v/hchild. In that case remove + one of them. */ + + if (! NILP (par->vchild) && ! NILP (XWINDOW (par->vchild)->vchild)) + { + p = XWINDOW (par->vchild); + par->vchild = p->vchild; + tem = p->vchild; + } + else if (! NILP (par->hchild) && ! NILP (XWINDOW (par->hchild)->hchild)) + { + p = XWINDOW (par->hchild); + par->hchild = p->hchild; + tem = p->hchild; + } + else + p = 0; + + if (p) + { + while (! NILP (tem)) { + XWINDOW (tem)->parent = p->parent; + if (NILP (XWINDOW (tem)->next)) + break; + tem = XWINDOW (tem)->next; + } + if (! NILP (tem)) { + /* The next of the v/hchild we are removing is now the next of the + last child for the v/hchild: + Before v/hchild -> v/hchild -> next1 -> next2 + | + -> next3 + After: v/hchild -> next1 -> next2 -> next3 + */ + XWINDOW (tem)->next = p->next; + if (! NILP (p->next)) + XWINDOW (p->next)->prev = tem; + } + p->next = p->prev = p->vchild = p->hchild = p->buffer = Qnil; + } + + /* Adjust glyph matrices. */ adjust_glyphs (f); UNBLOCK_INPUT; -- cgit v1.2.1 From 44e582b843ef057c07d89dfa5485fd9814caa0d1 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 6 Jun 2005 12:36:29 +0000 Subject: (Qno_break_space): New variable. (syms_of_xdisp): Initialize it. (get_next_display_element): Add no-break space and soft hypen codes for iso8859-2 and iso8859-5. Don't add `\' for them. Use `no-break-space' face for no-break spaces. --- src/xdisp.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index 63af22d9112..c1ea2a9389a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -350,6 +350,10 @@ Lisp_Object Qtrailing_whitespace; Lisp_Object Qescape_glyph; +/* Name and number of the face used to highlight non-breaking spaces. */ + +Lisp_Object Qno_break_space; + /* The symbol `image' which is the car of the lists used to represent images in Lisp. */ @@ -5094,8 +5098,10 @@ get_next_display_element (it) && it->len == 1) || !CHAR_PRINTABLE_P (it->c) || (!NILP (Vshow_nonbreak_escape) - && (it->c == 0x8ad || it->c == 0x8a0 - || it->c == 0xf2d || it->c == 0xf20))) + && (it->c == 0x8a0 || it->c == 0x8ad + || it->c == 0x920 || it->c == 0x92d + || it->c == 0xe20 || it->c == 0xe2d + || it->c == 0xf20 || it->c == 0xf2d))) : (it->c >= 127 && (!unibyte_display_via_language_environment || it->c == unibyte_char_to_multibyte (it->c))))) @@ -5162,13 +5168,25 @@ get_next_display_element (it) it->face_id); } - if (it->c == 0x8a0 || it->c == 0x8ad - || it->c == 0xf20 || it->c == 0xf2d) + if (it->c == 0x8a0 || it->c == 0x920 + || it->c == 0xe20 || it->c == 0xf20) { - XSETINT (it->ctl_chars[0], escape_glyph); + /* Merge the no-break-space face into the current face. */ + face_id = merge_faces (it->f, Qno_break_space, 0, + it->face_id); + g = it->c; - XSETINT (it->ctl_chars[1], g); - ctl_len = 2; + XSETINT (it->ctl_chars[0], g); + ctl_len = 1; + goto display_control; + } + + if (it->c == 0x8ad || it->c == 0x92d + || it->c == 0xe2d || it->c == 0xf2d) + { + g = it->c; + XSETINT (it->ctl_chars[0], g); + ctl_len = 1; goto display_control; } @@ -22714,6 +22732,8 @@ syms_of_xdisp () staticpro (&Qtrailing_whitespace); Qescape_glyph = intern ("escape-glyph"); staticpro (&Qescape_glyph); + Qno_break_space = intern ("no-break-space"); + staticpro (&Qno_break_space); Qimage = intern ("image"); staticpro (&Qimage); QCmap = intern (":map"); -- cgit v1.2.1 From c476bcb06c7fff47d9223555be774236e06462ce Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 6 Jun 2005 12:37:46 +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 308d55187d2..5d49e82d875 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-06-06 Juri Linkov + + * xdisp.c (Qno_break_space): New variable. + (syms_of_xdisp): Initialize it. + (get_next_display_element): Add no-break space and soft hypen + codes for iso8859-2 and iso8859-5. Don't add `\' for them. + Use `no-break-space' face for no-break spaces. + 2005-06-06 Jan Dj,Ad(Brv * window.c (delete_window): Handle the case where a h/vchild has -- cgit v1.2.1 From 1ca1f3f6c9c3734066ffd000bbc8ba9fcd1f1b89 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Mon, 6 Jun 2005 12:56:53 +0000 Subject: (popup_get_selection): Undo previous change. --- src/xmenu.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src') diff --git a/src/xmenu.c b/src/xmenu.c index 6e3a21604c1..6f758d12fc7 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1235,10 +1235,6 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers) if (event.type == ButtonRelease && dpyinfo->display == event.xbutton.display) { - /* If the click is not on the menu, deactivate the menu. */ - if (x_any_window_to_frame (dpyinfo, event.xexpose.window)) - popup_activated_flag = 0; - dpyinfo->grabbed &= ~(1 << event.xbutton.button); #ifdef USE_MOTIF /* Pretending that the event came from a Btn1Down seems the only way to convince Motif to -- cgit v1.2.1 From ce6e10af528e2caeee454097bde62bc65f2ea220 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Mon, 6 Jun 2005 12:58:13 +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 5d49e82d875..c4734dd67f7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-06 Richard M. Stallman + + * xmenu.c (popup_get_selection): Undo previous change. + 2005-06-06 Juri Linkov * xdisp.c (Qno_break_space): New variable. -- cgit v1.2.1 From 24e55febf48bcd6bef8c5a0343a2f7bbcd24637d Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 6 Jun 2005 16:14:46 +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 c4734dd67f7..6ae26d7f5e9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-06 Luc Teirlinck + + * keyboard.c (command_loop_1): Update Vthis_original_command. + 2005-06-06 Richard M. Stallman * xmenu.c (popup_get_selection): Undo previous change. -- cgit v1.2.1 From 6e005d5617bf8b74c2633a17336671f34d003b1e Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 6 Jun 2005 16:17:44 +0000 Subject: (command_loop_1): Update Vthis_original_command. --- src/keyboard.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index baba3c466d2..a4af619fafd 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1522,6 +1522,7 @@ command_loop_1 () Vthis_command = Qnil; real_this_command = Qnil; + Vthis_original_command=Qnil; /* Read next key sequence; i gets its length. */ i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0], -- cgit v1.2.1 From a74089f7a13e594c51388f74fc5222d908262c2b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 6 Jun 2005 19:27:37 +0000 Subject: (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove macros. --- src/w32heap.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'src') diff --git a/src/w32heap.h b/src/w32heap.h index 7fdf952683c..556c7fb28b4 100644 --- a/src/w32heap.h +++ b/src/w32heap.h @@ -82,15 +82,6 @@ typedef struct file_data { unsigned char *file_base; } file_data; -#define OFFSET_TO_RVA(var,section) \ - (section->VirtualAddress + ((DWORD)(var) - section->PointerToRawData)) - -#define RVA_TO_OFFSET(var,section) \ - (section->PointerToRawData + ((DWORD)(var) - section->VirtualAddress)) - -#define RVA_TO_PTR(var,section,filedata) \ - ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base)) - int open_input_file (file_data *p_file, char *name); int open_output_file (file_data *p_file, char *name, unsigned long size); void close_file_data (file_data *p_file); -- cgit v1.2.1 From e9bdb9c9f79bfb31977501ef5aebd53f1505718a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 6 Jun 2005 19:28:02 +0000 Subject: (RVA_TO_PTR): Moved here from w32heap.h. --- src/unexw32.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/unexw32.c b/src/unexw32.c index b1838644965..1b2dbe74c31 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -325,6 +325,9 @@ relocate_offset (DWORD offset, /* Convert address in executing image to RVA. */ #define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL)) +#define RVA_TO_PTR(var,section,filedata) \ + ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base)) + #define PTR_TO_OFFSET(ptr, pfile_data) \ ((unsigned char *)(ptr) - (pfile_data)->file_base) -- cgit v1.2.1 From 8747ac3f6853164434eb82c8172c7547b4e32be7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 6 Jun 2005 19:28:27 +0000 Subject: (RVA_TO_PTR): New macro. --- src/w32proc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/w32proc.c b/src/w32proc.c index 9abee2bf0c2..48b5e2c14a3 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -57,6 +57,11 @@ extern BOOL WINAPI IsValidLocale(LCID, DWORD); #include "syssignal.h" #include "w32term.h" +#define RVA_TO_PTR(var,section,filedata) \ + ((void *)((section)->PointerToRawData \ + + ((DWORD)(var) - (section)->VirtualAddress) \ + + (filedata).file_base)) + /* Control whether spawnve quotes arguments as necessary to ensure correct parsing by child process. Because not all uses of spawnve are careful about constructing argv arrays, we make this behaviour -- cgit v1.2.1 From 61bfbbfaa14a1c74263171cbe64df53e4c4fddc2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 6 Jun 2005 19:28:47 +0000 Subject: (RVA_TO_PTR): No need to #undef now. --- src/w32heap.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/w32heap.c b/src/w32heap.c index d947842474f..4c28718a510 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -31,7 +31,6 @@ Boston, MA 02111-1307, USA. #include "w32heap.h" #include "lisp.h" /* for VALMASK */ -#undef RVA_TO_PTR #define RVA_TO_PTR(rva) ((unsigned char *)((DWORD)(rva) + (DWORD)GetModuleHandle (NULL))) /* This gives us the page size and the size of the allocation unit on NT. */ -- cgit v1.2.1 From b6cc2ad0e9215dd8da7a4adeee5aeecf45a256c2 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 6 Jun 2005 19:29:58 +0000 Subject: ($(BLD)/emacs.$(O), $(BLD)/w32select.$(O)): Depend on w32heap.h. --- src/ChangeLog | 14 ++++++++++++++ src/makefile.w32-in | 2 ++ 2 files changed, 16 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 6ae26d7f5e9..ff49eff9284 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2005-06-06 Eli Zaretskii + + * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove + macros. + + * unexw32.c (RVA_TO_PTR): Moved here from w32heap.h. + + * w32proc.c (RVA_TO_PTR): New macro. + + * w32heap.c (RVA_TO_PTR): No need to #undef now. + + * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/w32select.$(O)): + Depend on w32heap.h. + 2005-06-06 Luc Teirlinck * keyboard.c (command_loop_1): Update Vthis_original_command. diff --git a/src/makefile.w32-in b/src/makefile.w32-in index b5890593cd8..f25af87cb92 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -595,6 +595,7 @@ $(BLD)/emacs.$(O) : \ $(SRC)/termhooks.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ + $(SRC)/w32heap.h \ $(SRC)/window.h $(BLD)/eval.$(O) : \ @@ -1430,6 +1431,7 @@ $(BLD)/w32select.$(O): \ $(SRC)/systime.h \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ + $(SRC)/w32heap.h \ $(SRC)/w32term.h $(BLD)/w32reg.$(O): \ -- cgit v1.2.1 From a6f4bf4882f49bcfe6812f1d43ebcb0051c9a9ea Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Mon, 6 Jun 2005 20:18:38 +0000 Subject: added HAVE_CANCELMENUTRACKING --- src/config.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/config.in b/src/config.in index 6939ff2577c..93ee6488e0c 100644 --- a/src/config.in +++ b/src/config.in @@ -96,6 +96,9 @@ Boston, MA 02111-1307, USA. */ /* Define to 1 if you have the `bzero' function. */ #undef HAVE_BZERO +/* Define to 1 if CancelMenuTracking is available (Mac OSX). */ +#undef HAVE_CANCELMENUTRACKING + /* Define to 1 if you are using the Carbon API on Mac OS X. */ #undef HAVE_CARBON @@ -782,9 +785,9 @@ Boston, MA 02111-1307, USA. */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ -- cgit v1.2.1 From 16d2e7043a77f41e4afbe4dfd98ba6414a479b52 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Mon, 6 Jun 2005 20:23:30 +0000 Subject: * macmenu.c (menu_quit_handler, install_menu_quit_handler): New functions for popping down menus on C-g. (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler. * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode non-static. * config.in: Added HAVE_CANCELMENUTRACKING --- src/ChangeLog | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index ff49eff9284..05713fba1dc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2005-06-06 Jan Dj,Ad(Brv + + * macmenu.c (menu_quit_handler, install_menu_quit_handler): New + functions for popping down menus on C-g. + (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler. + + * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode + non-static. + + * config.in: Added HAVE_CANCELMENUTRACKING + 2005-06-06 Eli Zaretskii * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove -- cgit v1.2.1 From 1b0fc0ce6165f2c61941bb429b032851219115e6 Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Mon, 6 Jun 2005 20:23:56 +0000 Subject: * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode non-static. --- src/macterm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/macterm.c b/src/macterm.c index 6ebaa39437b..093b60a639a 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -9890,8 +9890,8 @@ MakeMeTheFrontProcess () /***** Code to handle C-g testing *****/ /* Contains the Mac modifier formed from quit_char */ -static mac_quit_char_modifiers = 0; -static mac_quit_char_keycode; +int mac_quit_char_modifiers = 0; +int mac_quit_char_keycode; extern int quit_char; static void -- cgit v1.2.1 From f5f870c03cd5cd6805b620cccf0aff4e9951e18c Mon Sep 17 00:00:00 2001 From: Jan Djärv Date: Mon, 6 Jun 2005 20:24:13 +0000 Subject: * macmenu.c (menu_quit_handler, install_menu_quit_handler): New functions for popping down menus on C-g. (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler. --- src/macmenu.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 121 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/macmenu.c b/src/macmenu.c index e97a968d92d..77c66470c09 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -1356,6 +1356,68 @@ update_submenu_strings (first_wv) } +/* Event handler function that pops down a menu on C-g. We can only pop + down menus if CancelMenuTracking is present (OSX 10.3 or later). */ + +#ifdef HAVE_CANCELMENUTRACKING +static pascal OSStatus +menu_quit_handler (nextHandler, theEvent, userData) + EventHandlerCallRef nextHandler; + EventRef theEvent; + void* userData; +{ + UInt32 keyCode; + UInt32 keyModifiers; + extern int mac_quit_char_modifiers; + extern int mac_quit_char_keycode; + + GetEventParameter (theEvent, kEventParamKeyCode, + typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode); + + GetEventParameter (theEvent, kEventParamKeyModifiers, + typeUInt32, NULL, sizeof(UInt32), + NULL, &keyModifiers); + + if (keyCode == mac_quit_char_keycode + && keyModifiers == mac_quit_char_modifiers) + { + MenuRef menu = userData != 0 + ? (MenuRef)userData : AcquireRootMenu (); + + CancelMenuTracking (menu, true, 0); + if (!userData) ReleaseMenu (menu); + return noErr; + } + + return CallNextEventHandler (nextHandler, theEvent); +} +#endif /* HAVE_CANCELMENUTRACKING */ + +/* Add event handler for MENU_HANDLE so we can detect C-g. + If MENU_HANDLE is NULL, install handler for all menus in the menu bar. + If CancelMenuTracking isn't available, do nothing. */ + +static void +install_menu_quit_handler (MenuHandle menu_handle) +{ +#ifdef HAVE_CANCELMENUTRACKING + EventHandlerUPP handler = NewEventHandlerUPP(menu_quit_handler); + UInt32 numTypes = 1; + EventTypeSpec typesList[] = { { kEventClassKeyboard, kEventRawKeyDown } }; + int i = MIN_MENU_ID; + MenuHandle menu = menu_handle ? menu_handle : GetMenuHandle (i); + + while (menu != NULL) + { + InstallMenuEventHandler (menu, handler, GetEventTypeCount (typesList), + typesList, menu_handle, NULL); + if (menu_handle) break; + menu = GetMenuHandle (++i); + } + DisposeEventHandlerUPP (handler); +#endif /* HAVE_CANCELMENUTRACKING */ +} + /* Set the contents of the menubar widgets of frame F. The argument FIRST_TIME is currently ignored; it is set the first time this is called, from initialize_frame_menubar. */ @@ -1575,6 +1637,8 @@ set_frame_menubar (f, first_time, deep_p) DrawMenuBar (); + /* Add event handler so we can detect C-g. */ + install_menu_quit_handler (NULL); free_menubar_widget_value_tree (first_wv); UNBLOCK_INPUT; @@ -1606,7 +1670,43 @@ free_frame_menubar (f) } -/* mac_menu_show actually displays a menu using the panes and items in +static Lisp_Object +pop_down_menu (arg) + Lisp_Object arg; +{ + struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg)); + struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg)); + + FRAME_PTR f = p1->pointer; + MenuHandle *menu = p2->pointer; + + BLOCK_INPUT; + + /* Must reset this manually because the button release event is not + passed to Emacs event loop. */ + FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0; + + /* delete all menus */ + { + int i = MIN_POPUP_SUBMENU_ID; + MenuHandle submenu = GetMenuHandle (i); + while (submenu != NULL) + { + DeleteMenu (i); + DisposeMenu (submenu); + submenu = GetMenuHandle (++i); + } + } + + DeleteMenu (POPUP_SUBMENU_ID); + DisposeMenu (*menu); + + UNBLOCK_INPUT; + + return Qnil; +} + +/* Mac_menu_show actually displays a menu using the panes and items in menu_items and returns the value selected from it; we assume input is blocked by the caller. */ @@ -1644,6 +1744,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) = (Lisp_Object *) alloca (menu_items_used * sizeof (Lisp_Object)); int submenu_depth = 0; int first_pane; + int specpdl_count = SPECPDL_INDEX (); *error = NULL; @@ -1817,7 +1918,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) title = ENCODE_MENU_STRING (title); #endif wv_title->name = (char *) SDATA (title); - wv_title->enabled = TRUE; + wv_title->enabled = FALSE; wv_title->title = TRUE; wv_title->button_type = BUTTON_TYPE_NONE; wv_title->help = Qnil; @@ -1830,6 +1931,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) submenu_id = MIN_POPUP_SUBMENU_ID; fill_submenu (menu, first_wv->contents); + /* Free the widget_value objects we used to specify the + contents. */ + free_menubar_widget_value_tree (first_wv); + /* Adjust coordinates to be root-window-relative. */ pos.h = x; pos.v = y; @@ -1844,11 +1949,18 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) InsertMenu (menu, -1); + record_unwind_protect (pop_down_menu, + Fcons (make_save_value (f, 0), + make_save_value (&menu, 0))); + + /* Add event handler so we can detect C-g. */ + install_menu_quit_handler (menu); + /* Display the menu. */ menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0); menu_item_selection = LoWord (menu_item_choice); - /* Get the refcon to find the correct item*/ + /* Get the refcon to find the correct item */ if (menu_item_selection) { MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice)); @@ -1856,35 +1968,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) GetMenuItemRefCon (sel_menu, menu_item_selection, &refcon); } } - -#if 0 - /* Clean up extraneous mouse events which might have been generated - during the call. */ - discard_mouse_events (); -#endif - - /* Must reset this manually because the button release event is not - passed to Emacs event loop. */ - FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0; - - /* Free the widget_value objects we used to specify the - contents. */ - free_menubar_widget_value_tree (first_wv); - - /* delete all menus */ - { - int i = MIN_POPUP_SUBMENU_ID; - MenuHandle submenu = GetMenuHandle (i); - while (submenu != NULL) - { - DeleteMenu (i); - DisposeMenu (submenu); - submenu = GetMenuHandle (++i); - } - } - - DeleteMenu (POPUP_SUBMENU_ID); - DisposeMenu (menu); + else if (! for_click) + /* Make "Cancel" equivalent to C-g unless this menu was popped up by + a mouse press. */ + Fsignal (Qquit, Qnil); /* Find the selected item, and its pane, to return the proper value. */ @@ -1944,6 +2031,8 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) /* Make "Cancel" equivalent to C-g. */ Fsignal (Qquit, Qnil); + unbind_to (specpdl_count, Qnil); + return Qnil; } -- cgit v1.2.1 From 9cfc7da4248c20530326ba688dae2db837cf1ab8 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 6 Jun 2005 21:27:50 +0000 Subject: (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars if available. --- src/xterm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/xterm.c b/src/xterm.c index 8612d53fbee..4ab555974db 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4589,11 +4589,14 @@ x_create_toolkit_scroll_bar (f, bar) char *initial = ""; char *val = initial; XtVaGetValues (widget, XtNscrollVCursor, (XtPointer) &val, +#ifdef XtNarrowScrollbars + XtNarrowScrollbars, (XtPointer) &xaw3d_arrow_scroll, +#endif XtNpickTop, (XtPointer) &xaw3d_pick_top, NULL); - if (val == initial) + if (xaw3d_arrow_scroll || val == initial) { /* ARROW_SCROLL */ xaw3d_arrow_scroll = True; - /* Isn't that just a personal preference ? -sm */ + /* Isn't that just a personal preference ? --Stef */ XtVaSetValues (widget, XtNcursorName, "top_left_arrow", NULL); } } -- cgit v1.2.1 From 3d031334d8861fbb143b40a777da75bee8295660 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 6 Jun 2005 21:33:29 +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 05713fba1dc..9b6d5f93744 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-06 Stefan Monnier + + * xterm.c (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars + if available. + 2005-06-06 Jan Dj,Ad(Brv * macmenu.c (menu_quit_handler, install_menu_quit_handler): New -- cgit v1.2.1 From 28893db2e7f1991942fd1e667c9802f20a00e2af Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 7 Jun 2005 13:02:04 +0000 Subject: Update comment. --- src/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/image.c b/src/image.c index 15e835fef3b..bc88c9d1d04 100644 --- a/src/image.c +++ b/src/image.c @@ -6265,8 +6265,8 @@ jpeg_image_p (object) #endif /* HAVE_STLIB_H */ #if defined (HAVE_NTGUI) && !defined (__WIN32__) -/* jpeglib.h will define boolean differently depending on __WIN32__, - so make sure it is defined. */ +/* In older releases of the jpeg library, jpeglib.h will define boolean + differently depending on __WIN32__, so make sure it is defined. */ #define __WIN32__ 1 #endif -- cgit v1.2.1 From 8b793bed5341add3be4ece580ace65dfd5aa24bf Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 7 Jun 2005 13:19:11 +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 9b6d5f93744..0651dc206a0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-07 Kim F. Storm + + * process.c: Improve commentary for adaptive read buffering. + 2005-06-06 Stefan Monnier * xterm.c (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars -- cgit v1.2.1 From db853b7a753cb38f082d26036a92b8982aeb5bf1 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Tue, 7 Jun 2005 13:19:25 +0000 Subject: Improve commentary for adaptive read buffering. --- src/process.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/process.c b/src/process.c index 5f756f4db05..bee61b5505a 100644 --- a/src/process.c +++ b/src/process.c @@ -272,17 +272,19 @@ int update_tick; #define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) #define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) -/* Number of processes which might be delayed. */ +/* Number of processes which have a non-zero read_output_delay, + and therefore might be delayed for adaptive read buffering. */ static int process_output_delay_count; -/* Non-zero if any process has non-nil process_output_skip. */ +/* Non-zero if any process has non-nil read_output_skip. */ static int process_output_skip; /* Non-nil means to delay reading process output to improve buffering. A value of t means that delay is reset after each send, any other - non-nil value does not reset the delay. */ + non-nil value does not reset the delay. A value of nil disables + adaptive read buffering completely. */ static Lisp_Object Vprocess_adaptive_read_buffering; #else #define process_output_delay_count 0 @@ -4319,6 +4321,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, #endif #ifdef ADAPTIVE_READ_BUFFERING + /* Set the timeout for adaptive read buffering if any + process has non-nil read_output_skip and non-zero + read_output_delay, and we are not reading output for a + specific wait_channel. It is not executed if + Vprocess_adaptive_read_buffering is nil. */ if (process_output_skip && check_delay > 0) { int usecs = EMACS_USECS (timeout); @@ -4329,6 +4336,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, proc = chan_process[channel]; if (NILP (proc)) continue; + /* Find minimum non-zero read_output_delay among the + processes with non-nil read_output_skip. */ if (XINT (XPROCESS (proc)->read_output_delay) > 0) { check_delay--; @@ -6711,7 +6720,7 @@ init_process () #endif /* HAVE_SOCKETS */ #if defined (DARWIN) || defined (MAC_OSX) - /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive + /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive processes. As such, we only change the default value. */ if (initialized) { -- cgit v1.2.1 From 602907aea1d3cbebcbe51ca1be18c043b5df3140 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Tue, 7 Jun 2005 14:32:23 +0000 Subject: * xdisp.c (note_mode_line_or_margin_highlight): Check the overlapping of re-rendering area to avoid flickering. (note_mouse_highlight): Call clear_mouse_face if PART is not ON_MODE_LINE nor ON_HEADER_LINE. --- src/ChangeLog | 7 +++++++ src/xdisp.c | 34 ++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0651dc206a0..003668db560 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2005-06-07 Masatake YAMATO + + * xdisp.c (note_mode_line_or_margin_highlight): Check + the overlapping of re-rendering area to avoid flickering. + (note_mouse_highlight): Call clear_mouse_face if PART + is not ON_MODE_LINE nor ON_HEADER_LINE. + 2005-06-07 Kim F. Storm * process.c: Improve commentary for adaptive read buffering. diff --git a/src/xdisp.c b/src/xdisp.c index c1ea2a9389a..47421d13115 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21491,10 +21491,8 @@ note_mode_line_or_margin_highlight (window, x, y, area) int total_pixel_width; int ignore; - - if (clear_mouse_face (dpyinfo)) - cursor = No_Cursor; - + int vpos, hpos; + b = Fprevious_single_property_change (make_number (charpos + 1), Qmouse_face, string, Qnil); if (NILP (b)) @@ -21537,15 +21535,30 @@ note_mode_line_or_margin_highlight (window, x, y, area) for (tmp_glyph = glyph - gpos; tmp_glyph != glyph; tmp_glyph++) total_pixel_width += tmp_glyph->pixel_width; - dpyinfo->mouse_face_beg_col = (x - gpos); - dpyinfo->mouse_face_beg_row = (area == ON_MODE_LINE - ? (w->current_matrix)->nrows - 1 - : 0); + /* Pre calculation of re-rendering position */ + vpos = (x - gpos); + hpos = (area == ON_MODE_LINE + ? (w->current_matrix)->nrows - 1 + : 0); + + /* If the re-rendering position is included in the last + re-rendering area, we should do nothing. */ + if ( window == dpyinfo->mouse_face_window + && dpyinfo->mouse_face_beg_col <= vpos + && vpos < dpyinfo->mouse_face_end_col + && dpyinfo->mouse_face_beg_row == hpos ) + return; + + if (clear_mouse_face (dpyinfo)) + cursor = No_Cursor; + + dpyinfo->mouse_face_beg_col = vpos; + dpyinfo->mouse_face_beg_row = hpos; dpyinfo->mouse_face_beg_x = original_x_pixel - (total_pixel_width + dx); dpyinfo->mouse_face_beg_y = 0; - dpyinfo->mouse_face_end_col = (x - gpos) + gseq_length; + dpyinfo->mouse_face_end_col = vpos + gseq_length; dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row; dpyinfo->mouse_face_end_x = 0; @@ -21617,7 +21630,8 @@ note_mouse_highlight (f, x, y) /* If we were displaying active text in another window, clear that. Also clear if we move out of text area in same window. */ if (! EQ (window, dpyinfo->mouse_face_window) - || (part != ON_TEXT && !NILP (dpyinfo->mouse_face_window))) + || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE + && !NILP (dpyinfo->mouse_face_window))) clear_mouse_face (dpyinfo); /* Not on a window -> return. */ -- cgit v1.2.1 From 638322a4ac66df028a3cb92208a29f3ddd0438b2 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 8 Jun 2005 15:16:31 +0000 Subject: (struct process): Conditionalize slots adaptive_read_buffering, read_output_delay and read_output_skip on ADAPTIVE_READ_BUFFERING. Delete command_channel_p. --- src/process.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/process.h b/src/process.h index 6e2641d6b06..5d5f9d5b616 100644 --- a/src/process.h +++ b/src/process.h @@ -52,8 +52,6 @@ struct Lisp_Process Lisp_Object buffer; /* Number of this process */ Lisp_Object pid; - /* Non-nil if this is really a command channel */ - Lisp_Object command_channel_p; /* t if this is a real child process. For a net connection, it is a plist based on the arguments to make-network-process. */ Lisp_Object childp; @@ -101,11 +99,12 @@ struct Lisp_Process generated, and can be changed by the function `set-process-fileter-multibyte'. */ Lisp_Object filter_multibyte; +#ifdef ADAPTIVE_READ_BUFFERING /* Should we delay reading output from this process. Initialized from `Vprocess_adaptive_read_buffering'. */ Lisp_Object adaptive_read_buffering; /* Hysteresis to try to read process output in larger blocks. - On some systems, e.g. the Linux kernel, emacs is seen as + On some systems, e.g. GNU/Linux, Emacs is seen as an interactive app also when reading process output, meaning that process output can be read in as little as 1 byte at a time. Value is micro-seconds to delay reading output from @@ -113,6 +112,7 @@ struct Lisp_Process Lisp_Object read_output_delay; /* Skip reading this process on next read. */ Lisp_Object read_output_skip; +#endif }; /* Every field in the preceding structure except for the first two -- cgit v1.2.1 From 01836ccef042bfc40a71bb6a6cec44556ad0c34e Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 8 Jun 2005 15:18:10 +0000 Subject: (Fstart_process): Don't touch command_channel_p slot. --- src/process.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/process.c b/src/process.c index bee61b5505a..d2d4390c501 100644 --- a/src/process.c +++ b/src/process.c @@ -1537,7 +1537,6 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) XPROCESS (proc)->childp = Qt; XPROCESS (proc)->plist = Qnil; - XPROCESS (proc)->command_channel_p = Qnil; XPROCESS (proc)->buffer = buffer; XPROCESS (proc)->sentinel = Qnil; XPROCESS (proc)->filter = Qnil; -- cgit v1.2.1 From 9d138659971d8f027fe1e203e23b885f00cb8c25 Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 8 Jun 2005 15:18:49 +0000 Subject: Clean up whitespace. --- src/keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index a4af619fafd..77663a0ba61 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1522,7 +1522,7 @@ command_loop_1 () Vthis_command = Qnil; real_this_command = Qnil; - Vthis_original_command=Qnil; + Vthis_original_command = Qnil; /* Read next key sequence; i gets its length. */ i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0], -- cgit v1.2.1 From 547d2b37972e31e448d85c0b99e64a3e42b4f5ba Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 8 Jun 2005 15:26:33 +0000 Subject: (get_next_display_element): Alter previous change: Distinguish Vshow_nonbreak_escape = t or not t. For t, use escape_glyph once again, as before previous change. Use space or hyphen for display, instead of the non-ASCII char. (syms_of_xdisp) : Doc fix. --- src/ChangeLog | 15 ++++++++++++++ src/xdisp.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 64 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 003668db560..cfbbe7b47c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2005-06-08 Richard M. Stallman + + * xdisp.c (get_next_display_element): Alter previous change: + Distinguish Vshow_nonbreak_escape = t or not t. + For t, use escape_glyph once again, as before previous change. + Use space or hyphen for display, instead of the non-ASCII char. + (syms_of_xdisp) : Doc fix. + + * process.c (Fstart_process): Don't touch command_channel_p slot. + + * process.h (struct process): Conditionalize slots + adaptive_read_buffering, read_output_delay and read_output_skip + on ADAPTIVE_READ_BUFFERING. + Delete command_channel_p. + 2005-06-07 Masatake YAMATO * xdisp.c (note_mode_line_or_margin_highlight): Check diff --git a/src/xdisp.c b/src/xdisp.c index 47421d13115..fb5b8fbe6f2 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5116,6 +5116,8 @@ get_next_display_element (it) int face_id, lface_id = 0 ; GLYPH escape_glyph; + /* Handle control characters with ^. */ + if (it->c < 128 && it->ctl_arrow_p) { g = '^'; /* default glyph for Control */ @@ -5147,7 +5149,28 @@ get_next_display_element (it) goto display_control; } - escape_glyph = '\\'; /* default for Octal display */ + /* Handle non-break space in the mode where it only gets + highlighting. */ + + if (! EQ (Vshow_nonbreak_escape, Qt) + && (it->c == 0x8a0 || it->c == 0x920 + || it->c == 0xe20 || it->c == 0xf20)) + { + /* Merge the no-break-space face into the current face. */ + face_id = merge_faces (it->f, Qno_break_space, 0, + it->face_id); + + g = it->c = ' '; + XSETINT (it->ctl_chars[0], g); + ctl_len = 1; + goto display_control; + } + + /* Handle sequences that start with the "escape glyph". */ + + /* the default escape glyph is \. */ + escape_glyph = '\\'; + if (it->dp && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) @@ -5157,6 +5180,8 @@ get_next_display_element (it) } if (lface_id) { + /* The display table specified a face. + Merge it into face_id and also into escape_glyph. */ escape_glyph = FAST_GLYPH_CHAR (escape_glyph); face_id = merge_faces (it->f, Qt, lface_id, it->face_id); @@ -5168,25 +5193,31 @@ get_next_display_element (it) it->face_id); } - if (it->c == 0x8a0 || it->c == 0x920 - || it->c == 0xe20 || it->c == 0xf20) - { - /* Merge the no-break-space face into the current face. */ - face_id = merge_faces (it->f, Qno_break_space, 0, - it->face_id); + /* Handle soft hyphens in the mode where they only get + highlighting. */ - g = it->c; + if (! EQ (Vshow_nonbreak_escape, Qt) + && (it->c == 0x8ad || it->c == 0x92d + || it->c == 0xe2d || it->c == 0xf2d)) + { + g = it->c = '-'; XSETINT (it->ctl_chars[0], g); ctl_len = 1; goto display_control; } - if (it->c == 0x8ad || it->c == 0x92d - || it->c == 0xe2d || it->c == 0xf2d) + /* Handle non-break space and soft hyphen + with the escape glyph. */ + + if (it->c == 0x8a0 || it->c == 0x8ad + || it->c == 0x920 || it->c == 0x92d + || it->c == 0xe20 || it->c == 0xe2d + || it->c == 0xf20 || it->c == 0xf2d) { - g = it->c; - XSETINT (it->ctl_chars[0], g); - ctl_len = 1; + XSETINT (it->ctl_chars[0], escape_glyph); + g = it->c = ((it->c & 0xf) == 0 ? ' ' : '-'); + XSETINT (it->ctl_chars[1], g); + ctl_len = 2; goto display_control; } @@ -22854,7 +22885,11 @@ The face used for trailing whitespace is `trailing-whitespace'. */); Vshow_trailing_whitespace = Qnil; DEFVAR_LISP ("show-nonbreak-escape", &Vshow_nonbreak_escape, - doc: /* *Non-nil means display escape character before non-break space and hyphen. */); + doc: /* *Control highlighting of non-break space and soft hyphen. +t means highlight the character itself (for non-break space, +use face `non-break-space'. +nil means no highlighting. +other values mean display the escape glyph before the character. */); Vshow_nonbreak_escape = Qt; DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, -- cgit v1.2.1 From beac3988dff35004f271c2d603d5aeef4079f4dc Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 8 Jun 2005 15:28:27 +0000 Subject: Undo previous change. --- src/process.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/process.h b/src/process.h index 5d5f9d5b616..8e3f9028c0b 100644 --- a/src/process.h +++ b/src/process.h @@ -99,7 +99,6 @@ struct Lisp_Process generated, and can be changed by the function `set-process-fileter-multibyte'. */ Lisp_Object filter_multibyte; -#ifdef ADAPTIVE_READ_BUFFERING /* Should we delay reading output from this process. Initialized from `Vprocess_adaptive_read_buffering'. */ Lisp_Object adaptive_read_buffering; @@ -112,7 +111,6 @@ struct Lisp_Process Lisp_Object read_output_delay; /* Skip reading this process on next read. */ Lisp_Object read_output_skip; -#endif }; /* Every field in the preceding structure except for the first two -- cgit v1.2.1 From 995987378d97aed8094f27262f37aefcf6b7f2cc Mon Sep 17 00:00:00 2001 From: Richard M. Stallman Date: Wed, 8 Jun 2005 15:55:18 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index cfbbe7b47c0..28824b94e36 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -8,10 +8,7 @@ * process.c (Fstart_process): Don't touch command_channel_p slot. - * process.h (struct process): Conditionalize slots - adaptive_read_buffering, read_output_delay and read_output_skip - on ADAPTIVE_READ_BUFFERING. - Delete command_channel_p. + * process.h (struct process): Delete command_channel_p. 2005-06-07 Masatake YAMATO -- cgit v1.2.1 From abd0071cac2757eb7d1f34ae3c7e15c5093df77d Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Wed, 8 Jun 2005 22:32:20 +0000 Subject: (Fmatch_data): Add optional RESEAT arg. Unchain markers in REUSE list if non-nil; free them if equal to evaporate. (Fset_match_data): Add optional RESEAT arg. Unchain markers in LIST if non-nil; free them if equal to evaporate. Use XCAR/XCDR. (restore_search_regs): Rename from restore_match_data. Uses changed. (unwind_set_match_data): New function. (record_unwind_save_match_data): New function like save-match-data. --- src/search.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/search.c b/src/search.c index 73ec3a78e58..2a75c96e117 100644 --- a/src/search.c +++ b/src/search.c @@ -2739,7 +2739,7 @@ Zero means the entire text matched by the whole regexp or whole string. */) return match_limit (subexp, 0); } -DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 2, 0, +DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 3, 0, doc: /* Return a list containing all info on what the last search matched. Element 2N is `(match-beginning N)'; element 2N + 1 is `(match-end N)'. All the elements are markers or nil (nil if the Nth pair didn't match) @@ -2751,17 +2751,35 @@ integers \(rather than markers) to represent buffer positions. In this case, and if the last match was in a buffer, the buffer will get stored as one additional element at the end of the list. -If REUSE is a list, reuse it as part of the value. If REUSE is long enough -to hold all the values, and if INTEGERS is non-nil, no consing is done. +If REUSE is a list, reuse it as part of the value. If REUSE is long +enough to hold all the values, and if INTEGERS is non-nil, no consing +is done. + +If optional third arg RESEAT is non-nil, any previous markers on the +REUSE list will be modified to point to nowhere. + +If RESEAT is `evaporate', put markers back on the free list. +Note: No other references to the markers must exist if you use this. Return value is undefined if the last search failed. */) - (integers, reuse) - Lisp_Object integers, reuse; + (integers, reuse, reseat) + Lisp_Object integers, reuse, reseat; { Lisp_Object tail, prev; Lisp_Object *data; int i, len; + if (!NILP (reseat)) + for (tail = reuse; CONSP (tail); tail = XCDR (tail)) + if (MARKERP (XCAR (tail))) + { + if (EQ (reseat, Qevaporate)) + free_marker (XCAR (tail)); + else + unchain_marker (XMARKER (XCAR (tail))); + XSETCAR (tail, Qnil); + } + if (NILP (last_thing_searched)) return Qnil; @@ -2797,10 +2815,10 @@ Return value is undefined if the last search failed. */) /* last_thing_searched must always be Qt, a buffer, or Qnil. */ abort (); - len = 2*(i+1); + len = 2 * i + 2; } else - data[2 * i] = data [2 * i + 1] = Qnil; + data[2 * i] = data[2 * i + 1] = Qnil; } if (BUFFERP (last_thing_searched) && !NILP (integers)) @@ -2834,11 +2852,15 @@ Return value is undefined if the last search failed. */) } -DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 1, 0, +DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 2, 0, doc: /* Set internal data on last search match from elements of LIST. -LIST should have been created by calling `match-data' previously. */) - (list) - register Lisp_Object list; +LIST should have been created by calling `match-data' previously. + +If optional arg RESEAT is non-nil, make markers on LIST point nowhere. +If RESEAT is `evaporate', put the markers back on the free list. +Note: No other references to the markers must exist if you use this. */) + (list, reseat) + register Lisp_Object list, reseat; { register int i; register Lisp_Object marker; @@ -2882,9 +2904,9 @@ LIST should have been created by calling `match-data' previously. */) search_regs.num_regs = length; } - for (i = 0;; i++) + for (i = 0; CONSP (list); i++) { - marker = Fcar (list); + marker = XCAR (list); if (BUFFERP (marker)) { last_thing_searched = marker; @@ -2895,12 +2917,14 @@ LIST should have been created by calling `match-data' previously. */) if (NILP (marker)) { search_regs.start[i] = -1; - list = Fcdr (list); + list = XCDR (list); } else { int from; + Lisp_Object m; + m = marker; if (MARKERP (marker)) { if (XMARKER (marker)->buffer == 0) @@ -2911,17 +2935,36 @@ LIST should have been created by calling `match-data' previously. */) CHECK_NUMBER_COERCE_MARKER (marker); from = XINT (marker); - list = Fcdr (list); - marker = Fcar (list); + if (!NILP (reseat) && MARKERP (m)) + { + if (EQ (reseat, Qevaporate)) + free_marker (m); + else + unchain_marker (XMARKER (m)); + } + + if ((list = XCDR (list), !CONSP (list))) + break; + + m = marker = XCAR (list); + if (MARKERP (marker) && XMARKER (marker)->buffer == 0) XSETFASTINT (marker, 0); CHECK_NUMBER_COERCE_MARKER (marker); search_regs.start[i] = from; search_regs.end[i] = XINT (marker); + + if (!NILP (reseat) && MARKERP (m)) + { + if (EQ (reseat, Qevaporate)) + free_marker (m); + else + unchain_marker (XMARKER (m)); + } } - list = Fcdr (list); + list = XCDR (list); } for (; i < search_regs.num_regs; i++) @@ -2959,7 +3002,7 @@ save_search_regs () /* Called upon exit from filters and sentinels. */ void -restore_match_data () +restore_search_regs () { if (search_regs_saved) { @@ -2977,6 +3020,21 @@ restore_match_data () } } +static Lisp_Object +unwind_set_match_data (list) + Lisp_Object list; +{ + return Fset_match_data (list, Qevaporate); +} + +/* Called to unwind protect the match data. */ +void +record_unwind_save_match_data () +{ + record_unwind_protect (unwind_set_match_data, + Fmatch_data (Qnil, Qnil, Qnil)); +} + /* Quote a string to inactivate reg-expr chars */ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, -- cgit v1.2.1 From 5fe2b5a58dc9d211eb523b11f2731b03b8bd525d Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Wed, 8 Jun 2005 22:32:33 +0000 Subject: (Fmatch_data, Fset_match_data): Fix EXFUN. (record_unwind_save_match_data): Add prototype. (restore_search_regs): Rename from restore_match_data. --- src/lisp.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lisp.h b/src/lisp.h index b6ba06e17f8..e1a7e61c70a 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2768,6 +2768,7 @@ EXFUN (Fbuffer_disable_undo, 1); EXFUN (Fbuffer_enable_undo, 1); EXFUN (Ferase_buffer, 0); extern Lisp_Object Qoverlayp; +extern Lisp_Object Qevaporate; extern Lisp_Object get_truename_buffer P_ ((Lisp_Object)); extern struct buffer *all_buffers; EXFUN (Fprevious_overlay_change, 1); @@ -2835,11 +2836,12 @@ extern void syms_of_abbrev P_ ((void)); /* defined in search.c */ extern void shrink_regexp_cache P_ ((void)); EXFUN (Fstring_match, 3); -extern void restore_match_data P_ ((void)); -EXFUN (Fmatch_data, 2); -EXFUN (Fset_match_data, 1); +extern void restore_search_regs P_ ((void)); +EXFUN (Fmatch_data, 3); +EXFUN (Fset_match_data, 2); EXFUN (Fmatch_beginning, 1); EXFUN (Fmatch_end, 1); +extern void record_unwind_save_match_data P_ ((void)); EXFUN (Flooking_at, 1); extern int fast_string_match P_ ((Lisp_Object, Lisp_Object)); extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *)); -- cgit v1.2.1 From 89f2614d96b5cf84f01c4903652a6a2b5b23d3d3 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Wed, 8 Jun 2005 22:33:36 +0000 Subject: * composite.c (compose_chars_in_text): * eval.c (do_autoload): * macmenu.c (set_frame_menubar): * process.c (read_process_output, exec_sentinel): * xmenu.c (set_frame_menubar): * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar): * w32menu.c (set_frame_menubar): Use record_unwind_save_match_data. Rename restore_match_data to restore_search_regs. --- src/composite.c | 2 +- src/eval.c | 2 +- src/macmenu.c | 8 ++++---- src/process.c | 20 ++++++++++---------- src/w32menu.c | 3 ++- src/xdisp.c | 6 +++--- src/xmenu.c | 2 +- 7 files changed, 22 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/composite.c b/src/composite.c index f8e655a3685..ff2eed925d1 100644 --- a/src/composite.c +++ b/src/composite.c @@ -628,7 +628,7 @@ compose_chars_in_text (start, end, string) } /* Preserve the match data. */ - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); /* If none of ASCII characters have composition functions, we can skip them quickly. */ diff --git a/src/eval.c b/src/eval.c index 0eb1482ee0b..46affcac418 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1971,7 +1971,7 @@ do_autoload (fundef, funname) GCPRO3 (fun, funname, fundef); /* Preserve the match data. */ - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); /* Value saved here is to be restored into Vautoload_queue. */ record_unwind_protect (un_autoload, Vautoload_queue); diff --git a/src/macmenu.c b/src/macmenu.c index 77c66470c09..ee83a5f609f 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -1406,7 +1406,7 @@ install_menu_quit_handler (MenuHandle menu_handle) EventTypeSpec typesList[] = { { kEventClassKeyboard, kEventRawKeyDown } }; int i = MIN_MENU_ID; MenuHandle menu = menu_handle ? menu_handle : GetMenuHandle (i); - + while (menu != NULL) { InstallMenuEventHandler (menu, handler, GetEventTypeCount (typesList), @@ -1475,7 +1475,7 @@ set_frame_menubar (f, first_time, deep_p) because it is not reentrant. */ specbind (Qdebug_on_next_call, Qnil); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); if (NILP (Voverriding_local_map_menu_flag)) { specbind (Qoverriding_terminal_local_map, Qnil); @@ -1676,7 +1676,7 @@ pop_down_menu (arg) { struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg)); struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg)); - + FRAME_PTR f = p1->pointer; MenuHandle *menu = p2->pointer; @@ -1955,7 +1955,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) /* Add event handler so we can detect C-g. */ install_menu_quit_handler (menu); - + /* Display the menu. */ menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0); menu_item_selection = LoWord (menu_item_choice); diff --git a/src/process.c b/src/process.c index d2d4390c501..0a4ee8aee46 100644 --- a/src/process.c +++ b/src/process.c @@ -4887,10 +4887,10 @@ read_process_output (proc, channel) { Lisp_Object tem; /* Don't clobber the CURRENT match data, either! */ - tem = Fmatch_data (Qnil, Qnil); - restore_match_data (); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); - Fset_match_data (tem); + tem = Fmatch_data (Qnil, Qnil, Qnil); + restore_search_regs (); + record_unwind_save_match_data (); + Fset_match_data (tem, Qt); } /* For speed, if a search happens within this code, @@ -4944,7 +4944,7 @@ read_process_output (proc, channel) read_process_output_error_handler); /* If we saved the match data nonrecursively, restore it now. */ - restore_match_data (); + restore_search_regs (); running_asynch_code = outer_running_asynch_code; /* Handling the process output should not deactivate the mark. */ @@ -6348,10 +6348,10 @@ exec_sentinel (proc, reason) if (outer_running_asynch_code) { Lisp_Object tem; - tem = Fmatch_data (Qnil, Qnil); - restore_match_data (); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); - Fset_match_data (tem); + tem = Fmatch_data (Qnil, Qnil, Qnil); + restore_search_regs (); + record_unwind_save_match_data (); + Fset_match_data (tem, Qt); } /* For speed, if a search happens within this code, @@ -6365,7 +6365,7 @@ exec_sentinel (proc, reason) exec_sentinel_error_handler); /* If we saved the match data nonrecursively, restore it now. */ - restore_match_data (); + restore_search_regs (); running_asynch_code = outer_running_asynch_code; Vdeactivate_mark = odeactivate; diff --git a/src/w32menu.c b/src/w32menu.c index 8a90eae7ec7..c5af0aae980 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -1443,7 +1443,8 @@ set_frame_menubar (f, first_time, deep_p) because it is not reentrant. */ specbind (Qdebug_on_next_call, Qnil); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); + if (NILP (Voverriding_local_map_menu_flag)) { specbind (Qoverriding_terminal_local_map, Qnil); diff --git a/src/xdisp.c b/src/xdisp.c index fb5b8fbe6f2..3a44cc808c0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -8489,7 +8489,7 @@ prepare_menu_bars () Lisp_Object tail, frame; int count = SPECPDL_INDEX (); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); FOR_EACH_FRAME (tail, frame) { @@ -8612,7 +8612,7 @@ update_menu_bar (f, save_match_data) set_buffer_internal_1 (XBUFFER (w->buffer)); if (save_match_data) - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); if (NILP (Voverriding_local_map_menu_flag)) { specbind (Qoverriding_terminal_local_map, Qnil); @@ -8803,7 +8803,7 @@ update_tool_bar (f, save_match_data) /* Save match data, if we must. */ if (save_match_data) - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); /* Make sure that we don't accidentally use bogus keymaps. */ if (NILP (Voverriding_local_map_menu_flag)) diff --git a/src/xmenu.c b/src/xmenu.c index 6f758d12fc7..16d4e0029cd 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -2030,7 +2030,7 @@ set_frame_menubar (f, first_time, deep_p) because it is not reentrant. */ specbind (Qdebug_on_next_call, Qnil); - record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); + record_unwind_save_match_data (); record_unwind_protect (unuse_menu_items, Qnil); if (NILP (Voverriding_local_map_menu_flag)) { -- cgit v1.2.1 From 9ad54a7e1699f6fdc85c64c9117f446d6fb7afc7 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Wed, 8 Jun 2005 22:54:39 +0000 Subject: (Fset_match_data): Fix last change. --- src/search.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/search.c b/src/search.c index 2a75c96e117..c1f2fd77cec 100644 --- a/src/search.c +++ b/src/search.c @@ -2942,6 +2942,7 @@ Note: No other references to the markers must exist if you use this. */) free_marker (m); else unchain_marker (XMARKER (m)); + XSETCAR (list, Qnil); } if ((list = XCDR (list), !CONSP (list))) @@ -2962,6 +2963,7 @@ Note: No other references to the markers must exist if you use this. */) free_marker (m); else unchain_marker (XMARKER (m)); + XSETCAR (list, Qnil); } } list = XCDR (list); -- cgit v1.2.1 From b7aae902ed6d45976a249e44e296df9a97737c16 Mon Sep 17 00:00:00 2001 From: Kim F. Storm Date: Wed, 8 Jun 2005 23:04:27 +0000 Subject: *** empty log message *** --- src/ChangeLog | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 28824b94e36..077b0da84b3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,26 @@ +2005-06-09 Kim F. Storm + + * search.c (Fmatch_data): Add optional RESEAT arg. Unchain markers + in REUSE list if non-nil; free them if equal to evaporate. + (Fset_match_data): Add optional RESEAT arg. Unchain markers in LIST + if non-nil; free them if equal to evaporate. Use XCAR/XCDR. + (restore_search_regs): Rename from restore_match_data. Uses changed. + (unwind_set_match_data): New function. + (record_unwind_save_match_data): New function like save-match-data. + + * lisp.h (Fmatch_data, Fset_match_data): Fix EXFUN. + (record_unwind_save_match_data): Add prototype. + (restore_search_regs): Rename from restore_match_data. + + * composite.c (compose_chars_in_text): + * eval.c (do_autoload): + * macmenu.c (set_frame_menubar): + * process.c (read_process_output, exec_sentinel): + * xmenu.c (set_frame_menubar): + * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar): + * w32menu.c (set_frame_menubar): + Use record_unwind_save_match_data. + 2005-06-08 Richard M. Stallman * xdisp.c (get_next_display_element): Alter previous change: @@ -14,7 +37,7 @@ * xdisp.c (note_mode_line_or_margin_highlight): Check the overlapping of re-rendering area to avoid flickering. - (note_mouse_highlight): Call clear_mouse_face if PART + (note_mouse_highlight): Call clear_mouse_face if PART is not ON_MODE_LINE nor ON_HEADER_LINE. 2005-06-07 Kim F. Storm -- cgit v1.2.1 From 427c5b1be2e6473c6792b375c8976c88e77570f7 Mon Sep 17 00:00:00 2001 From: Steven Tamm Date: Thu, 9 Jun 2005 03:37:20 +0000 Subject: unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section used by gcc4 on intel mac. --- src/ChangeLog | 5 +++++ src/unexmacosx.c | 1 + 2 files changed, 6 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 077b0da84b3..2d506df58cb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-08 Steven Tamm + + * unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section + used by gcc4 on intel mac. + 2005-06-09 Kim F. Storm * search.c (Fmatch_data): Add optional RESEAT arg. Unchain markers diff --git a/src/unexmacosx.c b/src/unexmacosx.c index e54dbea448c..1a2c211a09d 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c @@ -695,6 +695,7 @@ copy_data_segment (struct load_command *lc) } else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 + || strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0 || strncmp (sectp->sectname, "__dyld", 16) == 0 || strncmp (sectp->sectname, "__const", 16) == 0 || strncmp (sectp->sectname, "__cfstring", 16) == 0) -- cgit v1.2.1 From 9fed2905dd854ab0647b337973f1c543b93be1ff Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 9 Jun 2005 10:39:02 +0000 Subject: (Fdisplay_supports_face_attributes_p): Fix typo in docstring. --- src/ChangeLog | 11 ++++++++--- src/xfaces.c | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 2d506df58cb..4c43422e660 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-09 Juanma Barranquero + + * xfaces.c (Fdisplay_supports_face_attributes_p): + Fix typo in docstring. + 2005-06-08 Steven Tamm * unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section @@ -63,7 +68,7 @@ * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode non-static. - * config.in: Added HAVE_CANCELMENUTRACKING + * config.in: Add HAVE_CANCELMENUTRACKING. 2005-06-06 Eli Zaretskii @@ -12994,9 +12999,9 @@ * sound.c: Added a partial implementation of play-sound-internal for Microsoft Windows. Added various #ifdef / #else / #endif code blocks to separate the code that will compile under - Microsoft Windows from the code that is specific to Gnu/Linux. + Microsoft Windows from the code that is specific to GNU/Linux. Moved several blocks of code around to make this separation of code - into Windows compatible and Gnu/Linux compatible code blocks easier. + into Windows compatible and GNU/Linux compatible code blocks easier. * makefile.w32-in: Include sound.c and link with WinMM.lib. diff --git a/src/xfaces.c b/src/xfaces.c index 606a854980a..11e72ab7d05 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -6109,7 +6109,7 @@ DEFUN ("display-supports-face-attributes-p", 1, 2, 0, doc: /* Return non-nil if all the face attributes in ATTRIBUTES are supported. The optional argument DISPLAY can be a display name, a frame, or -nil (meaning the selected frame's display) +nil (meaning the selected frame's display). The definition of `supported' is somewhat heuristic, but basically means that a face containing all the attributes in ATTRIBUTES, when merged @@ -6122,7 +6122,7 @@ Point (2) implies that a `:weight black' attribute will be satisfied by any display that can display bold, and a `:foreground \"yellow\"' as long as it can display a yellowish color, but `:slant italic' will _not_ be satisfied by the tty display code's automatic substitution of a `dim' -face for italic. */) +face for italic. */) (attributes, display) Lisp_Object attributes, display; { -- cgit v1.2.1 From c14ec13543ea0bef97466957bc17e071a16b7419 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 9 Jun 2005 23:27:58 +0000 Subject: (Fmemq, Fmaphash): Doc fixes. --- src/ChangeLog | 4 ++++ src/fns.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 4c43422e660..4ab24a42e41 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-10 Juanma Barranquero + + * fns.c (Fmemq, Fmaphash): Doc fixes. + 2005-06-09 Juanma Barranquero * xfaces.c (Fdisplay_supports_face_attributes_p): diff --git a/src/fns.c b/src/fns.c index e910c87375b..a36789b4a92 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1471,7 +1471,7 @@ The value is actually the tail of LIST whose car is ELT. */) DEFUN ("memq", Fmemq, Smemq, 2, 2, 0, doc: /* Return non-nil if ELT is an element of LIST. -Comparison done with EQ. The value is actually the tail of LIST +Comparison done with `eq'. The value is actually the tail of LIST whose car is ELT. */) (elt, list) Lisp_Object elt, list; @@ -5486,7 +5486,7 @@ DEFUN ("remhash", Fremhash, Sremhash, 2, 2, 0, DEFUN ("maphash", Fmaphash, Smaphash, 2, 2, 0, doc: /* Call FUNCTION for all entries in hash table TABLE. -FUNCTION is called with 2 arguments KEY and VALUE. */) +FUNCTION is called with two arguments, KEY and VALUE. */) (function, table) Lisp_Object function, table; { -- cgit v1.2.1 From 20dc6fbbe0577a26d14489bc5c4d557a76c71052 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 10 Jun 2005 02:22:11 +0000 Subject: (Fhandle_switch_frame, Fselect_frame): Delete unused arg no_enter. (Fset_mouse_position, Fset_mouse_pixel_position, Ficonify_frame): Adapt to above change. --- src/frame.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/frame.c b/src/frame.c index d757e935752..16810c21739 100644 --- a/src/frame.c +++ b/src/frame.c @@ -729,7 +729,7 @@ do_switch_frame (frame, track, for_deletion) return frame; } -DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 2, "e", +DEFUN ("select-frame", Fselect_frame, Sselect_frame, 1, 1, "e", doc: /* Select the frame FRAME. Subsequent editing commands apply to its selected window. The selection of FRAME lasts until the next time the user does @@ -740,14 +740,14 @@ the command loop, because it still may have the window system's input focus. On a text-only terminal, the next redisplay will display FRAME. This function returns FRAME, or nil if FRAME has been deleted. */) - (frame, no_enter) - Lisp_Object frame, no_enter; + (frame) + Lisp_Object frame; { return do_switch_frame (frame, 1, 0); } -DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 2, "e", +DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e", doc: /* Handle a switch-frame event EVENT. Switch-frame events are usually bound to this function. A switch-frame event tells Emacs that the window manager has requested @@ -756,8 +756,8 @@ This function selects the selected window of the frame of EVENT. If EVENT is frame object, handle it as if it were a switch-frame event to that frame. */) - (event, no_enter) - Lisp_Object event, no_enter; + (event) + Lisp_Object event; { /* Preserve prefix arg that the command loop just cleared. */ current_kboard->Vprefix_arg = Vcurrent_prefix_arg; @@ -1530,7 +1530,7 @@ before calling this function on it, like this. #if defined (MSDOS) && defined (HAVE_MOUSE) if (FRAME_MSDOS_P (XFRAME (frame))) { - Fselect_frame (frame, Qnil); + Fselect_frame (frame); mouse_moveto (XINT (x), XINT (y)); } #endif @@ -1562,7 +1562,7 @@ before calling this function on it, like this. #if defined (MSDOS) && defined (HAVE_MOUSE) if (FRAME_MSDOS_P (XFRAME (frame))) { - Fselect_frame (frame, Qnil); + Fselect_frame (frame); mouse_moveto (XINT (x), XINT (y)); } #endif @@ -1684,7 +1684,7 @@ If omitted, FRAME defaults to the currently selected frame. */) #if 0 /* This isn't logically necessary, and it can do GC. */ /* Don't let the frame remain selected. */ if (EQ (frame, selected_frame)) - Fhandle_switch_frame (next_frame (frame, Qt), Qnil); + Fhandle_switch_frame (next_frame (frame, Qt)); #endif /* Don't allow minibuf_window to remain on a deleted frame. */ -- cgit v1.2.1 From f840fb39d6091f5d8cd361ae6531ba7f38979133 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 10 Jun 2005 02:26:58 +0000 Subject: (command_loop_1): Adapt call to Fselect_frame. --- src/keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/keyboard.c b/src/keyboard.c index 77663a0ba61..b213d187aac 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1509,7 +1509,7 @@ command_loop_1 () Is this a good idea? */ if (FRAMEP (internal_last_event_frame) && !EQ (internal_last_event_frame, selected_frame)) - Fselect_frame (internal_last_event_frame, Qnil); + Fselect_frame (internal_last_event_frame); #endif /* If it has changed current-menubar from previous value, really recompute the menubar from the value. */ -- cgit v1.2.1 From 9848feb480dbc9255f770d23ca7f3db9b1ba8d40 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 10 Jun 2005 02:29:12 +0000 Subject: Update EXFUN of Fselect_frame. --- src/lisp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lisp.h b/src/lisp.h index e1a7e61c70a..7cb3b0719dc 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2956,7 +2956,7 @@ extern Lisp_Object do_switch_frame P_ ((Lisp_Object, int, int)); extern Lisp_Object get_frame_param P_ ((struct frame *, Lisp_Object)); extern Lisp_Object frame_buffer_predicate P_ ((Lisp_Object)); EXFUN (Fframep, 1); -EXFUN (Fselect_frame, 2); +EXFUN (Fselect_frame, 1); EXFUN (Fselected_frame, 0); EXFUN (Fwindow_frame, 1); EXFUN (Fframe_root_window, 1); -- cgit v1.2.1 From c869384d74ca1fc2c33b25eb28316b3a6415dcf8 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 10 Jun 2005 02:36:07 +0000 Subject: (Fselect_window): Adapt call to Fselect_frame. --- src/ChangeLog | 12 ++++++++++++ src/window.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 4ab24a42e41..0962308155e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2005-06-09 Luc Teirlinck + + * window.c (Fselect_window): Adapt call to Fselect_frame. + + * lisp.h: Update EXFUN of Fselect_frame. + + * keyboard.c (command_loop_1): Adapt call to Fselect_frame. + + * frame.c (do_switch_frame, Fselect_frame): Delete unused arg no_enter. + (set-mouse-position, set-mouse-pixel-position, iconify-frame): + Adapt to above change. + 2005-06-10 Juanma Barranquero * fns.c (Fmemq, Fmaphash): Doc fixes. diff --git a/src/window.c b/src/window.c index 4839830b177..1f2af647677 100644 --- a/src/window.c +++ b/src/window.c @@ -3234,7 +3234,7 @@ selects the buffer of the selected window before each command. */) so that FRAME_FOCUS_FRAME is moved appropriately as we move around in the state where a minibuffer in a separate frame is active. */ - Fselect_frame (WINDOW_FRAME (w), Qnil); + Fselect_frame (WINDOW_FRAME (w)); } else sf->selected_window = window; -- cgit v1.2.1 From 6ecf436de1ade9aed4741f91608bf605bc166e64 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Fri, 10 Jun 2005 02:45:38 +0000 Subject: *** empty log message *** --- src/ChangeLog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0962308155e..2622787d3aa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -6,8 +6,9 @@ * keyboard.c (command_loop_1): Adapt call to Fselect_frame. - * frame.c (do_switch_frame, Fselect_frame): Delete unused arg no_enter. - (set-mouse-position, set-mouse-pixel-position, iconify-frame): + * frame.c (Fhandle_switch_frame, Fselect_frame): Delete unused arg + no_enter. + (Fset_mouse_position, Fset_mouse_pixel_position, Ficonify_frame): Adapt to above change. 2005-06-10 Juanma Barranquero -- cgit v1.2.1 From 121c59a3e42a0d596967bf3e4baa323ea9bd4ff2 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Fri, 10 Jun 2005 05:31:45 +0000 Subject: * xdisp.c (note_mode_line_or_margin_highlight): Call clear_mouse_face when mouse_face is not given. Remove unnecessary tabs. --- src/ChangeLog | 6 ++++++ src/xdisp.c | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 2622787d3aa..94479694c7a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-06-10 Masatake YAMATO + + * xdisp.c (note_mode_line_or_margin_highlight): Call clear_mouse_face + when mouse_face is not given. + Remove unnecessary tabs. + 2005-06-09 Luc Teirlinck * window.c (Fselect_window): Adapt call to Fselect_frame. diff --git a/src/xdisp.c b/src/xdisp.c index 3a44cc808c0..b32f43b97b9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21523,7 +21523,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) int ignore; int vpos, hpos; - + b = Fprevious_single_property_change (make_number (charpos + 1), Qmouse_face, string, Qnil); if (NILP (b)) @@ -21571,7 +21571,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) hpos = (area == ON_MODE_LINE ? (w->current_matrix)->nrows - 1 : 0); - + /* If the re-rendering position is included in the last re-rendering area, we should do nothing. */ if ( window == dpyinfo->mouse_face_window @@ -21579,10 +21579,10 @@ note_mode_line_or_margin_highlight (window, x, y, area) && vpos < dpyinfo->mouse_face_end_col && dpyinfo->mouse_face_beg_row == hpos ) return; - + if (clear_mouse_face (dpyinfo)) cursor = No_Cursor; - + dpyinfo->mouse_face_beg_col = vpos; dpyinfo->mouse_face_beg_row = hpos; @@ -21607,8 +21607,9 @@ note_mode_line_or_margin_highlight (window, x, y, area) if (NILP (pointer)) pointer = Qhand; } + else if ((area == ON_MODE_LINE) || (area == ON_HEADER_LINE)) + clear_mouse_face (dpyinfo); } - define_frame_cursor1 (f, cursor, pointer); } -- cgit v1.2.1 From 4162f25f3e4ca44c19e4b121ee56ba7463ffac6f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 10 Jun 2005 11:04:20 +0000 Subject: (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument `verbose'; print diagnostic messages only if it is non-zero. All callers changed to pass a zero value unless DEBUG_DUMP is defined in the environment. (copy_executable_and_dump_data): Print section names with %.8s. --- src/ChangeLog | 8 ++++++++ src/unexw32.c | 54 ++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 42 insertions(+), 20 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 94479694c7a..3f76f1f8eb3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-06-10 Eli Zaretskii + + * unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument + `verbose'; print diagnostic messages only if it is non-zero. All + callers changed to pass a zero value unless DEBUG_DUMP is defined + in the environment. + (copy_executable_and_dump_data): Print section names with %.8s. + 2005-06-10 Masatake YAMATO * xdisp.c (note_mode_line_or_margin_highlight): Call clear_mouse_face diff --git a/src/unexw32.c b/src/unexw32.c index 1b2dbe74c31..6c565ff7491 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -491,27 +491,34 @@ copy_executable_and_dump_data (file_data *p_infile, PIMAGE_SECTION_HEADER dst_section; DWORD offset; int i; + int be_verbose = GetEnvironmentVariable ("DEBUG_DUMP", NULL, 0) > 0; -#define COPY_CHUNK(message, src, size) \ +#define COPY_CHUNK(message, src, size, verbose) \ do { \ unsigned char *s = (void *)(src); \ unsigned long count = (size); \ - printf ("%s\n", (message)); \ - printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \ - printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ - printf ("\t0x%08x Size in bytes.\n", count); \ + if (verbose) \ + { \ + printf ("%s\n", (message)); \ + printf ("\t0x%08x Offset in input file.\n", s - p_infile->file_base); \ + printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ + printf ("\t0x%08x Size in bytes.\n", count); \ + } \ memcpy (dst, s, count); \ dst += count; \ } while (0) -#define COPY_PROC_CHUNK(message, src, size) \ +#define COPY_PROC_CHUNK(message, src, size, verbose) \ do { \ unsigned char *s = (void *)(src); \ unsigned long count = (size); \ - printf ("%s\n", (message)); \ - printf ("\t0x%08x Address in process.\n", s); \ - printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ - printf ("\t0x%08x Size in bytes.\n", count); \ + if (verbose) \ + { \ + printf ("%s\n", (message)); \ + printf ("\t0x%08x Address in process.\n", s); \ + printf ("\t0x%08x Offset in output file.\n", dst - p_outfile->file_base); \ + printf ("\t0x%08x Size in bytes.\n", count); \ + } \ memcpy (dst, s, count); \ dst += count; \ } while (0) @@ -542,13 +549,14 @@ copy_executable_and_dump_data (file_data *p_infile, dst = (unsigned char *) p_outfile->file_base; COPY_CHUNK ("Copying DOS header...", dos_header, - (DWORD) nt_header - (DWORD) dos_header); + (DWORD) nt_header - (DWORD) dos_header, be_verbose); dst_nt_header = (PIMAGE_NT_HEADERS) dst; COPY_CHUNK ("Copying NT header...", nt_header, - (DWORD) section - (DWORD) nt_header); + (DWORD) section - (DWORD) nt_header, be_verbose); dst_section = (PIMAGE_SECTION_HEADER) dst; COPY_CHUNK ("Copying section table...", section, - nt_header->FileHeader.NumberOfSections * sizeof (*section)); + nt_header->FileHeader.NumberOfSections * sizeof (*section), + be_verbose); /* Align the first section's raw data area, and set the header size field accordingly. */ @@ -558,7 +566,9 @@ copy_executable_and_dump_data (file_data *p_infile, for (i = 0; i < nt_header->FileHeader.NumberOfSections; i++) { char msg[100]; - sprintf (msg, "Copying raw data for %s...", section->Name); + /* Windows section names are fixed 8-char strings, only + zero-terminated if the name is shorter than 8 characters. */ + sprintf (msg, "Copying raw data for %.8s...", section->Name); dst_save = dst; @@ -571,7 +581,7 @@ copy_executable_and_dump_data (file_data *p_infile, /* Can always copy the original raw data. */ COPY_CHUNK (msg, OFFSET_TO_PTR (section->PointerToRawData, p_infile), - section->SizeOfRawData); + section->SizeOfRawData, be_verbose); /* Ensure alignment slop is zeroed. */ ROUND_UP_DST_AND_ZERO (dst_nt_header->OptionalHeader.FileAlignment); @@ -580,7 +590,8 @@ copy_executable_and_dump_data (file_data *p_infile, { dst = dst_save + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (data_start), dst_section); - COPY_PROC_CHUNK ("Dumping initialized data...", data_start, data_size); + COPY_PROC_CHUNK ("Dumping initialized data...", + data_start, data_size, be_verbose); dst = dst_save + dst_section->SizeOfRawData; } if (section == bss_section) @@ -589,7 +600,8 @@ copy_executable_and_dump_data (file_data *p_infile, data size as necessary. */ dst = dst_save + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (bss_start), dst_section); - COPY_PROC_CHUNK ("Dumping bss data...", bss_start, bss_size); + COPY_PROC_CHUNK ("Dumping bss data...", bss_start, + bss_size, be_verbose); ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment); dst_section->PointerToRawData = PTR_TO_OFFSET (dst_save, p_outfile); /* Determine new size of raw data area. */ @@ -604,7 +616,8 @@ copy_executable_and_dump_data (file_data *p_infile, section's raw data size as necessary. */ dst = dst_save + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (bss_start_static), dst_section); - COPY_PROC_CHUNK ("Dumping static bss data...", bss_start_static, bss_size_static); + COPY_PROC_CHUNK ("Dumping static bss data...", bss_start_static, + bss_size_static, be_verbose); ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment); dst_section->PointerToRawData = PTR_TO_OFFSET (dst_save, p_outfile); /* Determine new size of raw data area. */ @@ -622,7 +635,8 @@ copy_executable_and_dump_data (file_data *p_infile, section's size to the appropriate size. */ dst = dst_save + RVA_TO_SECTION_OFFSET (PTR_TO_RVA (heap_start), dst_section); - COPY_PROC_CHUNK ("Dumping heap...", heap_start, heap_size); + COPY_PROC_CHUNK ("Dumping heap...", heap_start, heap_size, + be_verbose); ROUND_UP_DST (dst_nt_header->OptionalHeader.FileAlignment); dst_section->PointerToRawData = PTR_TO_OFFSET (dst_save, p_outfile); /* Determine new size of raw data area. */ @@ -657,7 +671,7 @@ copy_executable_and_dump_data (file_data *p_infile, COPY_CHUNK ("Copying remainder of executable...", OFFSET_TO_PTR (offset, p_infile), - p_infile->size - offset); + p_infile->size - offset, be_verbose); /* Final size for new image. */ p_outfile->size = DST_TO_OFFSET (); -- cgit v1.2.1 From 1a5cab376956c1c76105abfe1fe1030a4839ba20 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 10 Jun 2005 12:56:51 +0000 Subject: Update copyrighte years. --- src/unexw32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/unexw32.c b/src/unexw32.c index 6c565ff7491..ebeb7355673 100644 --- a/src/unexw32.c +++ b/src/unexw32.c @@ -1,5 +1,5 @@ /* unexec for GNU Emacs on Windows NT. - Copyright (C) 1994 Free Software Foundation, Inc. + Copyright (C) 1994, 2005 Free Software Foundation, Inc. This file is part of GNU Emacs. -- cgit v1.2.1 From 2de35a2582731182773e7689cee38780bddd7799 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 10 Jun 2005 14:19:26 +0000 Subject: (syms_of_process) [ADAPTIVE_READ_BUFFERING]: Fix spellings in docstrings. --- src/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/process.c b/src/process.c index 0a4ee8aee46..e7ea1bfe7df 100644 --- a/src/process.c +++ b/src/process.c @@ -6824,7 +6824,7 @@ The value takes effect when `start-process' is called. */); doc: /* If non-nil, improve receive buffering by delaying after short reads. On some systems, when Emacs reads the output from a subprocess, the output data is read in very small blocks, potentially resulting in very poor performance. -This behaviour can be remedied to some extent by setting this variable to a +This behavior can be remedied to some extent by setting this variable to a non-nil value, as it will automatically delay reading from such processes, to allowing them to produce more output before Emacs tries to read it. If the value is t, the delay is reset after each write to the process; any other -- cgit v1.2.1 From a8ab3e96074252549b8f9f9a53939c09b60ebee9 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 10 Jun 2005 14:21:22 +0000 Subject: (syms_of_w32fns): Fix spellings. --- src/w32fns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/w32fns.c b/src/w32fns.c index b7115601553..23297ade5f3 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -8698,7 +8698,7 @@ fontsets are automatically created. */); DEFVAR_BOOL ("w32-strict-painting", &w32_strict_painting, doc: /* Non-nil means use strict rules for repainting frames. -Set this to nil to get the old behaviour for repainting; this should +Set this to nil to get the old behavior for repainting; this should only be necessary if the default setting causes problems. */); w32_strict_painting = 1; -- cgit v1.2.1 From 578c1340ea0f4d6a6aa9d86ff5d89bdf690e8fbb Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 10 Jun 2005 15:00:48 +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 3f76f1f8eb3..8a9f2914519 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-10 Juanma Barranquero + + * process.c (syms_of_process) [ADAPTIVE_READ_BUFFERING]: + * w32fns.c (syms_of_w32fns): Fix spellings. + 2005-06-10 Eli Zaretskii * unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument -- cgit v1.2.1 From cd4344a3ee945afa2e5623b975ef80e21252d204 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 10 Jun 2005 17:47:00 +0000 Subject: ($(TEMACS)): Depend on addsection.exe. --- src/ChangeLog | 4 ++++ src/makefile.w32-in | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 8a9f2914519..da7ce8af7ea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2005-06-10 Eli Zaretskii + + * makefile.w32-in ($(TEMACS)): Depend on addsection.exe. + 2005-06-10 Juanma Barranquero * process.c (syms_of_process) [ADAPTIVE_READ_BUFFERING]: diff --git a/src/makefile.w32-in b/src/makefile.w32-in index f25af87cb92..c631852c0f0 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -167,7 +167,8 @@ $(EMACS): $(DOC) $(TEMACS) # (it is the preload heap size in MB). # temacs: $(BLD) $(TEMACS) -$(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) +$(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) \ + ../nt/$(BLD)/addsection.exe $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 16 echo $(OBJ0) > $(BLD)/buildobj.lst -- cgit v1.2.1 From ba6f3859e02ec8ff4b2d7ba179efa1ee3fb0243c Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Fri, 10 Jun 2005 23:03:28 +0000 Subject: (Fx_file_dialog): Unblock input before falling back to minibuffer. --- src/macfns.c | 3 ++- src/w32fns.c | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/macfns.c b/src/macfns.c index d0dd9b9c072..b26baf3eaf7 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -4375,14 +4375,15 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) break; } NavDialogDispose(dialogRef); + UNBLOCK_INPUT; } else { + UNBLOCK_INPUT; /* Fall back on minibuffer if there was a problem */ file = Fcompleting_read (prompt, intern ("read-file-name-internal"), dir, mustmatch, dir, Qfile_name_history, default_filename, Qnil); } - UNBLOCK_INPUT; } UNGCPRO; diff --git a/src/w32fns.c b/src/w32fns.c index 23297ade5f3..0e9e4509373 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7808,6 +7808,7 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) { OPENFILENAME file_details; + BOOL file_opened = FALSE; /* Prevent redisplay. */ specbind (Qinhibit_redisplay, Qt); @@ -7836,7 +7837,11 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) file_details.lpfnHook = (LPOFNHOOKPROC) file_dialog_callback; - if (GetOpenFileName (&file_details)) + file_opened = GetOpenFileName (&file_details); + + UNBLOCK_INPUT; + + if (file_opened) { dostounix_filename (filename); if (file_details.nFilterIndex == 2) @@ -7857,7 +7862,6 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) dir, mustmatch, dir, Qfile_name_history, default_filename, Qnil); - UNBLOCK_INPUT; file = unbind_to (count, file); } -- cgit v1.2.1 From d11f8e1ab9bd57d2c9346520858a328e9bc6d0d5 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Fri, 10 Jun 2005 23:04:18 +0000 Subject: *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index da7ce8af7ea..34c19326c98 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2005-06-11 Jason Rumney + + * w32fns.c (Fx_file_dialog): Unblock input before falling back to + minibuffer. + * macfns.c (Fx_file_dialog): Likewise. + 2005-06-10 Eli Zaretskii * makefile.w32-in ($(TEMACS)): Depend on addsection.exe. -- cgit v1.2.1 From 17757d663fba6555c4c285ed86c47aa5b801add3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 11 Jun 2005 15:10:58 +0000 Subject: (create_offscreen_bitmap): Cast `bitsp' to `void **' in the call to CreateDIBSection, to avoid a compiler warning. --- src/w32bdf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/w32bdf.c b/src/w32bdf.c index 092aff306dc..8d57cbd3523 100644 --- a/src/w32bdf.c +++ b/src/w32bdf.c @@ -604,7 +604,7 @@ create_offscreen_bitmap(HDC hdc, int width, int height, unsigned char **bitsp) info.c[1].rgbRed = info.c[1].rgbGreen = info.c[1].rgbBlue = 255; return CreateDIBSection(hdc, (LPBITMAPINFO)&info, - DIB_RGB_COLORS, bitsp, NULL, 0); + DIB_RGB_COLORS, (void **)bitsp, NULL, 0); } glyph_metric * -- cgit v1.2.1 From 099a3eead27b2b63747e778aaf55565dd7ad698c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 11 Jun 2005 15:11:34 +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 34c19326c98..0232aea8b48 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-11 Eli Zaretskii + + * w32bdf.c (create_offscreen_bitmap): Cast `bitsp' to `void **' in + the call to CreateDIBSection, to avoid a compiler warning. + 2005-06-11 Jason Rumney * w32fns.c (Fx_file_dialog): Unblock input before falling back to -- cgit v1.2.1 From 2e09fef1ac0317fc63a1a628de0cb7371c1427d1 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 11 Jun 2005 16:25:14 +0000 Subject: (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg to CreateDIBSection to avoid a compiler warning. (pbm_load): Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler warning. (png_load): Cast return values of fn_png_create_read_struct and fn_png_create_info_struct, to avoid compiler warnings on W32. Cast 3rd arg to IMAGE_BACKGROUND and image_background_transparent to avoid compiler warnings. (jpeg_load): Cast return value of fn_jpeg_std_error to avoid a compiler warning on W32. Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler warning. (tiff_load): Cast return values of fn_TIFFOpen and fn_TIFFClientOpen to avoid compiler warning on W32. Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler warning. (gif_load): Cast return values of fn_DGifOpenFileName and fn_DGifOpen to avoid compiler warnings on W32. Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler warning. (DrawText) [HAVE_NTGUI || MAC_OS]: If already defined, undef before redefining. --- src/ChangeLog | 20 +++++++++++++++ src/image.c | 82 +++++++++++++++++++++++++++++++++++++---------------------- 2 files changed, 71 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0232aea8b48..5b71d4b089f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,25 @@ 2005-06-11 Eli Zaretskii + * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg + to CreateDIBSection to avoid a compiler warning. + (pbm_load): Cast 3rd arg to IMAGE_BACKGROUND to avoid a compiler + warning. + (png_load): Cast return values of fn_png_create_read_struct and + fn_png_create_info_struct, to avoid compiler warnings on W32. + Cast 3rd arg to IMAGE_BACKGROUND and image_background_transparent + to avoid compiler warnings. + (jpeg_load): Cast return value of fn_jpeg_std_error to avoid a + compiler warning on W32. Cast 3rd arg to IMAGE_BACKGROUND to + avoid a compiler warning. + (tiff_load): Cast return values of fn_TIFFOpen and + fn_TIFFClientOpen to avoid compiler warning on W32. Cast 3rd arg + to IMAGE_BACKGROUND to avoid a compiler warning. + (gif_load): Cast return values of fn_DGifOpenFileName and + fn_DGifOpen to avoid compiler warnings on W32. Cast 3rd arg to + IMAGE_BACKGROUND to avoid a compiler warning. + (DrawText) [HAVE_NTGUI || MAC_OS]: If already defined, undef + before redefining. + * w32bdf.c (create_offscreen_bitmap): Cast `bitsp' to `void **' in the call to CreateDIBSection, to avoid a compiler warning. diff --git a/src/image.c b/src/image.c index bc88c9d1d04..462294b33b4 100644 --- a/src/image.c +++ b/src/image.c @@ -1972,7 +1972,8 @@ x_create_x_image_and_pixmap (f, width, height, depth, ximg, pixmap) and store its handle in *pixmap. */ *pixmap = CreateDIBSection (hdc, &((*ximg)->info), (depth < 16) ? DIB_PAL_COLORS : DIB_RGB_COLORS, - &((*ximg)->data), NULL, 0); + /* casting avoids a GCC warning */ + (void **)&((*ximg)->data), NULL, 0); /* Realize display palette and garbage all frames. */ release_frame_dc (f, hdc); @@ -5517,7 +5518,8 @@ pbm_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into a pixmap. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -5843,9 +5845,11 @@ png_load (f, img) tbr.bytes += sizeof (sig); } - /* Initialize read and info structs for PNG lib. */ - png_ptr = fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, NULL, - my_png_error, my_png_warning); + /* Initialize read and info structs for PNG lib. Casting return + value avoids a GCC warning on W32. */ + png_ptr = (png_structp)fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, + NULL, my_png_error, + my_png_warning); if (!png_ptr) { if (fp) fclose (fp); @@ -5853,7 +5857,8 @@ png_load (f, img) return 0; } - info_ptr = fn_png_create_info_struct (png_ptr); + /* Casting return value avoids a GCC warning on W32. */ + info_ptr = (png_infop)fn_png_create_info_struct (png_ptr); if (!info_ptr) { fn_png_destroy_read_struct (&png_ptr, NULL, NULL); @@ -5862,7 +5867,8 @@ png_load (f, img) return 0; } - end_info = fn_png_create_info_struct (png_ptr); + /* Casting return value avoids a GCC warning on W32. */ + end_info = (png_infop)fn_png_create_info_struct (png_ptr); if (!end_info) { fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL); @@ -6135,8 +6141,9 @@ png_load (f, img) img->width = width; img->height = height; - /* Maybe fill in the background field while we have ximg handy. */ - IMAGE_BACKGROUND (img, f, ximg); + /* Maybe fill in the background field while we have ximg handy. + Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into the pixmap, then free the X image and its buffer. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -6145,9 +6152,9 @@ png_load (f, img) /* Same for the mask. */ if (mask_img) { - /* Fill in the background_transparent field while we have the mask - handy. */ - image_background_transparent (img, f, mask_img); + /* Fill in the background_transparent field while we have the + mask handy. Casting avoids a GCC warning. */ + image_background_transparent (img, f, (XImagePtr_or_DC)mask_img); x_put_x_image (f, mask_img, img->mask, img->width, img->height); x_destroy_x_image (mask_img); @@ -6494,8 +6501,9 @@ jpeg_load (f, img) } /* Customize libjpeg's error handling to call my_error_exit when an - error is detected. This function will perform a longjmp. */ - cinfo.err = fn_jpeg_std_error (&mgr.pub); + error is detected. This function will perform a longjmp. + Casting return value avoids a GCC warning on W32. */ + cinfo.err = (struct jpeg_error_mgr *)fn_jpeg_std_error (&mgr.pub); mgr.pub.error_exit = my_error_exit; if ((rc = setjmp (mgr.setjmp_buffer)) != 0) @@ -6606,7 +6614,8 @@ jpeg_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into the pixmap. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -6932,8 +6941,9 @@ tiff_load (f, img) return 0; } - /* Try to open the image file. */ - tiff = fn_TIFFOpen (SDATA (file), "r"); + /* Try to open the image file. Casting return value avoids a + GCC warning on W32. */ + tiff = (TIFF *)fn_TIFFOpen (SDATA (file), "r"); if (tiff == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -6948,14 +6958,15 @@ tiff_load (f, img) memsrc.len = SBYTES (specified_data); memsrc.index = 0; - tiff = fn_TIFFClientOpen ("memory_source", "r", &memsrc, - (TIFFReadWriteProc) tiff_read_from_memory, - (TIFFReadWriteProc) tiff_write_from_memory, - tiff_seek_in_memory, - tiff_close_memory, - tiff_size_of_memory, - tiff_mmap_memory, - tiff_unmap_memory); + /* Casting return value avoids a GCC warning on W32. */ + tiff = (TIFF *)fn_TIFFClientOpen ("memory_source", "r", &memsrc, + (TIFFReadWriteProc) tiff_read_from_memory, + (TIFFReadWriteProc) tiff_write_from_memory, + tiff_seek_in_memory, + tiff_close_memory, + tiff_size_of_memory, + tiff_mmap_memory, + tiff_unmap_memory); if (!tiff) { @@ -7018,7 +7029,8 @@ tiff_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning on W32. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into the pixmap, then free the X image and its buffer. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -7126,6 +7138,11 @@ gif_image_p (object) #ifdef HAVE_GIF #if defined (HAVE_NTGUI) || defined (MAC_OS) +/* winuser.h might define DrawText to DrawTextA or DrawTextW. + Undefine before redefining to avoid a preprocessor warning. */ +#ifdef DrawText +#undef DrawText +#endif /* avoid conflict with QuickdrawText.h */ #define DrawText gif_DrawText #include @@ -7239,8 +7256,9 @@ gif_load (f, img) return 0; } - /* Open the GIF file. */ - gif = fn_DGifOpenFileName (SDATA (file)); + /* Open the GIF file. Casting return value avoids a GCC warning + on W32. */ + gif = (GifFileType *)fn_DGifOpenFileName (SDATA (file)); if (gif == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -7256,7 +7274,8 @@ gif_load (f, img) memsrc.len = SBYTES (specified_data); memsrc.index = 0; - gif = fn_DGifOpen(&memsrc, gif_read_from_memory); + /* Casting return value avoids a GCC warning on W32. */ + gif = (GifFileType *)fn_DGifOpen(&memsrc, gif_read_from_memory); if (!gif) { image_error ("Cannot open memory source `%s'", img->spec, Qnil); @@ -7390,7 +7409,8 @@ gif_load (f, img) /* Maybe fill in the background field while we have ximg handy. */ if (NILP (image_spec_value (img->spec, QCbackground, NULL))) - IMAGE_BACKGROUND (img, f, ximg); + /* Casting avoids a GCC warning. */ + IMAGE_BACKGROUND (img, f, (XImagePtr_or_DC)ximg); /* Put the image into the pixmap, then free the X image and its buffer. */ x_put_x_image (f, ximg, img->pixmap, width, height); @@ -7400,7 +7420,7 @@ gif_load (f, img) return 1; } -#else +#else /* !HAVE_GIF */ #ifdef MAC_OS static int -- cgit v1.2.1 From c52e16385d1a0a662df0df835f12e7e9b2c020a4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 12 Jun 2005 10:41:05 +0000 Subject: (w32_abort): Use the MB_YESNO dialog instead of MB_ABORTRETRYIGNORE. Never return, even if DebugBreak does. --- src/w32fns.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/w32fns.c b/src/w32fns.c index 0e9e4509373..7f625916926 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -8894,24 +8894,25 @@ void globals_of_w32fns () #undef abort +void w32_abort (void) NO_RETURN; + void w32_abort() { int button; button = MessageBox (NULL, "A fatal error has occurred!\n\n" - "Select Abort to exit, Retry to debug, Ignore to continue", + "Would you like to attach a debugger?\n\n" + "Select YES to debug, NO to abort Emacs", "Emacs Abort Dialog", MB_ICONEXCLAMATION | MB_TASKMODAL - | MB_SETFOREGROUND | MB_ABORTRETRYIGNORE); + | MB_SETFOREGROUND | MB_YESNO); switch (button) { - case IDRETRY: + case IDYES: DebugBreak (); - break; - case IDIGNORE: - break; - case IDABORT: + exit (2); /* tell the compiler we will never return */ + case IDNO: default: abort (); break; -- cgit v1.2.1 From a1e8cad6ea6d8281cdbf7b70d20f5241329da14c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 12 Jun 2005 11:28:55 +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 5b71d4b089f..a2c70f13109 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-12 Eli Zaretskii + + * w32fns.c (w32_abort): Use the MB_YESNO dialog instead of + MB_ABORTRETRYIGNORE. Never return, even if DebugBreak does. + 2005-06-11 Eli Zaretskii * image.c (x_create_x_image_and_pixmap) [HAVE_NTGUI]: Cast 4th arg -- cgit v1.2.1 From 7f2b4738d9c69b3e4ca564d53c01493c0af9b247 Mon Sep 17 00:00:00 2001 From: Jason Rumney Date: Sun, 12 Jun 2005 19:23:28 +0000 Subject: (NEWOPENFILENAME): New struct. (Fx_file_dialog): Use it to trick the system into giving us up to date dialogs on systems that are documented to support it. Do not set OFN_FILEMUSTEXIST flag if looking for a directory. --- src/ChangeLog | 7 +++++++ src/w32fns.c | 59 +++++++++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 50 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index a2c70f13109..76cdc9893ba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2005-06-12 Jason Rumney + + * w32fns.c (NEWOPENFILENAME): New struct. + (Fx_file_dialog): Use it to trick the system into giving us up to + date dialogs on systems that are documented to support it. + Do not set OFN_FILEMUSTEXIST flag if looking for a directory. + 2005-06-12 Eli Zaretskii * w32fns.c (w32_abort): Use the MB_YESNO dialog instead of diff --git a/src/w32fns.c b/src/w32fns.c index 7f625916926..6a2f98c4c7d 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7759,6 +7759,19 @@ file_dialog_callback (hwnd, msg, wParam, lParam) return 0; } +/* Since we compile with _WIN32_WINNT set to 0x0400 (for NT4 compatibility) + we end up with the old file dialogs. Define a big enough struct for the + new dialog to trick GetOpenFileName into giving us the new dialogs on + Windows 2000 and XP. */ +typedef struct +{ + OPENFILENAME real_details; + void * pReserved; + DWORD dwReserved; + DWORD FlagsEx; +} NEWOPENFILENAME; + + DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0, doc: /* Read file name, prompting with PROMPT in directory DIR. Use a file selection dialog. @@ -7807,44 +7820,58 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) filename[0] = '\0'; { - OPENFILENAME file_details; + NEWOPENFILENAME new_file_details; BOOL file_opened = FALSE; - + OPENFILENAME * file_details = &new_file_details.real_details; + /* Prevent redisplay. */ specbind (Qinhibit_redisplay, Qt); BLOCK_INPUT; - bzero (&file_details, sizeof (file_details)); - file_details.lStructSize = sizeof (file_details); - file_details.hwndOwner = FRAME_W32_WINDOW (f); + bzero (&new_file_details, sizeof (new_file_details)); + /* Apparently NT4 crashes if you give it an unexpected size. + I'm not sure about Windows 9x, so play it safe. */ + if (w32_major_version > 4 && w32_major_version < 95) + file_details->lStructSize = sizeof (new_file_details); + else + file_details->lStructSize = sizeof (file_details); + + file_details->hwndOwner = FRAME_W32_WINDOW (f); /* Undocumented Bug in Common File Dialog: If a filter is not specified, shell links are not resolved. */ - file_details.lpstrFilter = "All Files (*.*)\0*.*\0Directories\0*|*\0\0"; - file_details.lpstrFile = filename; - file_details.nMaxFile = sizeof (filename); - file_details.lpstrInitialDir = init_dir; - file_details.lpstrTitle = SDATA (prompt); + file_details->lpstrFilter = "All Files (*.*)\0*.*\0Directories\0*|*\0\0"; + file_details->lpstrFile = filename; + file_details->nMaxFile = sizeof (filename); + file_details->lpstrInitialDir = init_dir; + file_details->lpstrTitle = SDATA (prompt); if (! NILP (only_dir_p)) default_filter_index = 2; - file_details.nFilterIndex = default_filter_index; + file_details->nFilterIndex = default_filter_index; - file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR + file_details->Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR | OFN_EXPLORER | OFN_ENABLEHOOK); if (!NILP (mustmatch)) - file_details.Flags |= OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST; + { + /* Require that the path to the parent directory exists. */ + file_details->Flags |= OFN_PATHMUSTEXIST; + /* If we are looking for a file, require that it exists. */ + if (NILP (only_dir_p)) + file_details->Flags |= OFN_FILEMUSTEXIST; + } - file_details.lpfnHook = (LPOFNHOOKPROC) file_dialog_callback; + file_details->lpfnHook = (LPOFNHOOKPROC) file_dialog_callback; - file_opened = GetOpenFileName (&file_details); + file_opened = GetOpenFileName (file_details); UNBLOCK_INPUT; if (file_opened) { dostounix_filename (filename); - if (file_details.nFilterIndex == 2) + + if (file_details->nFilterIndex == 2) { /* "Directories" selected - strip dummy file name. */ char * last = strrchr (filename, '/'); -- cgit v1.2.1 From 099b6577820e74de1b0793ba60da3a13616c54d9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 13 Jun 2005 12:18:31 +0000 Subject: (x_use_underline_position_properties): New variable. (x_draw_glyph_string): Remind in a comment to change doc string of x-use-underline-position-properties if/when underline positioning is implemented. (syms_of_w32term): DEFVAR_BOOL x-use-underline-position-properties, and initialize it to nil. --- src/w32term.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/w32term.c b/src/w32term.c index 1223aa310d9..1caa1313df4 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -87,6 +87,10 @@ static int any_help_event_p; /* Last window where we saw the mouse. Used by mouse-autoselect-window. */ static Lisp_Object last_window; +/* Non-zero means make use of UNDERLINE_POSITION font properties. + (Not yet supported, see TODO in x_draw_glyph_string.) */ +int x_use_underline_position_properties; + extern unsigned int msh_mousewheel; extern void free_frame_menubar (); @@ -2488,7 +2492,9 @@ x_draw_glyph_string (s) unsigned long dy = s->height - h; /* TODO: Use font information for positioning and thickness - of underline. See OUTLINETEXTMETRIC, and xterm.c. */ + 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 (s->face->underline_defaulted_p) { w32_fill_area (s->f, s->hdc, s->gc->foreground, s->x, @@ -6536,6 +6542,18 @@ the cursor have no effect. */); &w32_use_visible_system_caret, 0)) w32_use_visible_system_caret = 0; + /* We don't yet support this, but defining this here avoids whining + from cus-start.el and other places, like "M-x set-variable". */ + DEFVAR_BOOL ("x-use-underline-position-properties", + &x_use_underline_position_properties, + doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. +nil means ignore them. If you encounter fonts with bogus +UNDERLINE_POSITION font properties, for example 7x13 on XFree prior +to 4.1, set this to nil. + +NOTE: Not supported on MS-Windows yet. */); + x_use_underline_position_properties = 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; -- cgit v1.2.1 From 0e0dddda54491f07cb5a1b871eefd2517144361c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 13 Jun 2005 12:19:38 +0000 Subject: *** empty log message *** --- src/ChangeLog | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 76cdc9893ba..1866d894ac3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2005-06-13 Eli Zaretskii + + * w32term.c (x_use_underline_position_properties): New variable. + (x_draw_glyph_string): Remind in a comment to change doc string of + x-use-underline-position-properties if/when underline positioning + is implemented. + (syms_of_w32term): DEFVAR_BOOL x-use-underline-position-properties, + and initialize it to nil. + 2005-06-12 Jason Rumney * w32fns.c (NEWOPENFILENAME): New struct. -- cgit v1.2.1 From 737ccba9d952f6a45cce4fda8ba7a9a31f033b4c Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 13 Jun 2005 20:47:42 +0000 Subject: (run_pre_post_conversion_on_str): Remove unused var `buf'. --- src/coding.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/coding.c b/src/coding.c index a7a78bbe2c0..0c4ec1eebc5 100644 --- a/src/coding.c +++ b/src/coding.c @@ -6060,7 +6060,6 @@ run_pre_post_conversion_on_str (str, coding, encodep) int count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2; int multibyte = STRING_MULTIBYTE (str); - struct buffer *buf; Lisp_Object old_deactivate_mark; record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); -- cgit v1.2.1 From b78ab259b1e35e52754fca92eb0f0650690104da Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 13 Jun 2005 20:49:14 +0000 Subject: (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. (get_phys_cursor_geometry, format_mode_line_unwind_data) (get_line_height_property, x_produce_glyphs): Remove unused vars. --- src/xdisp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/xdisp.c b/src/xdisp.c index b32f43b97b9..7ce461c1897 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1898,7 +1898,7 @@ get_phys_cursor_geometry (w, row, glyph, heightp) int *heightp; { struct frame *f = XFRAME (WINDOW_FRAME (w)); - int x, y, wd, h, h0, y0; + int y, wd, h, h0, y0; /* Compute the width of the rectangle to draw. If on a stretch glyph, and `x-stretch-block-cursor' is nil, don't draw a @@ -8252,7 +8252,6 @@ static Lisp_Object format_mode_line_unwind_data (obuf) struct buffer *obuf; { - int i = 0; Lisp_Object vector; /* Reduce consing by keeping one vector in @@ -19201,7 +19200,7 @@ get_line_height_property (it, prop) struct it *it; Lisp_Object prop; { - Lisp_Object position, val; + Lisp_Object position; if (STRINGP (it->object)) position = make_number (IT_STRING_CHARPOS (*it)); @@ -19552,7 +19551,6 @@ x_produce_glyphs (it) else { Lisp_Object spacing; - int total = 0; it->phys_ascent = it->ascent; it->phys_descent = it->descent; @@ -21574,7 +21572,7 @@ note_mode_line_or_margin_highlight (window, x, y, area) /* If the re-rendering position is included in the last re-rendering area, we should do nothing. */ - if ( window == dpyinfo->mouse_face_window + if ( EQ (window, dpyinfo->mouse_face_window) && dpyinfo->mouse_face_beg_col <= vpos && vpos < dpyinfo->mouse_face_end_col && dpyinfo->mouse_face_beg_row == hpos ) -- cgit v1.2.1 From 5aa6db5755dd0a5c1f855ba7e98044945b368b1a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 13 Jun 2005 20:50:25 +0000 Subject: *** empty log message *** --- src/ChangeLog | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 1866d894ac3..965d7357b44 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-06-13 Stefan Monnier + + * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. + (get_phys_cursor_geometry, format_mode_line_unwind_data) + (get_line_height_property, x_produce_glyphs): Remove unused vars. + + * coding.c (run_pre_post_conversion_on_str): Remove unused var `buf'. + 2005-06-13 Eli Zaretskii * w32term.c (x_use_underline_position_properties): New variable. @@ -62,8 +70,8 @@ 2005-06-10 Eli Zaretskii * unexw32.c (COPY_CHUNK, COPY_PROC_CHUNK): Add a new argument - `verbose'; print diagnostic messages only if it is non-zero. All - callers changed to pass a zero value unless DEBUG_DUMP is defined + `verbose'; print diagnostic messages only if it is non-zero. + All callers changed to pass a zero value unless DEBUG_DUMP is defined in the environment. (copy_executable_and_dump_data): Print section names with %.8s. @@ -137,8 +145,8 @@ 2005-06-07 Masatake YAMATO - * xdisp.c (note_mode_line_or_margin_highlight): Check - the overlapping of re-rendering area to avoid flickering. + * xdisp.c (note_mode_line_or_margin_highlight): + Check the overlapping of re-rendering area to avoid flickering. (note_mouse_highlight): Call clear_mouse_face if PART is not ON_MODE_LINE nor ON_HEADER_LINE. @@ -153,8 +161,8 @@ 2005-06-06 Jan Dj,Ad(Brv - * macmenu.c (menu_quit_handler, install_menu_quit_handler): New - functions for popping down menus on C-g. + * macmenu.c (menu_quit_handler, install_menu_quit_handler): + New functions for popping down menus on C-g. (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler. * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode @@ -164,10 +172,10 @@ 2005-06-06 Eli Zaretskii - * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove - macros. + * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): + Remove macros. - * unexw32.c (RVA_TO_PTR): Moved here from w32heap.h. + * unexw32.c (RVA_TO_PTR): Move here from w32heap.h. * w32proc.c (RVA_TO_PTR): New macro. @@ -291,11 +299,11 @@ (format_mode_line_unwind_data, unwind_format_mode_line): New functions for unwind protection in mode line formatting. (x_consider_frame_title): Use them and new local var 'title_start' - to support nested calls to format-mode-line and redisplay. Set - mode_line_target to MODE_LINE_TITLE. + to support nested calls to format-mode-line and redisplay. + Set mode_line_target to MODE_LINE_TITLE. (Fformat_mode_line): Use them and new local var 'string_start' to - support nested calls to format-mode-line and redisplay. Set - mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING. + support nested calls to format-mode-line and redisplay. + Set mode_line_target to MODE_LINE_NOPROP or MODE_LINE_STRING. Don't trim trailing dashes. (decode_mode_spec): Don't make infinite number of trailing dashes for MODE_LINE_NOPROP and MODE_LINE_STRING targets. -- cgit v1.2.1 From 4a9308b8e2b100ab15a7eded063304c8a4fbc144 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Tue, 14 Jun 2005 00:39:32 +0000 Subject: (Fdefvaralias): Rename arguments SYMBOL and ALIASED to NEW-ALIAS and BASE-VARIABLE, respectively. --- src/ChangeLog | 5 +++++ src/eval.c | 39 ++++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 965d7357b44..0224932301c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-14 Juanma Barranquero + + * eval.c (Fdefvaralias): Rename arguments SYMBOL and ALIASED to + NEW-ALIAS and BASE-VARIABLE, respectively. + 2005-06-13 Stefan Monnier * xdisp.c (note_mode_line_or_margin_highlight): Lisp_Object/int mixup. diff --git a/src/eval.c b/src/eval.c index 46affcac418..445eb283114 100644 --- a/src/eval.c +++ b/src/eval.c @@ -722,35 +722,36 @@ usage: (defmacro NAME ARGLIST [DOCSTRING] [DECL] BODY...) */) DEFUN ("defvaralias", Fdefvaralias, Sdefvaralias, 2, 3, 0, - doc: /* Make SYMBOL a variable alias for symbol ALIASED. -Setting the value of SYMBOL will subsequently set the value of ALIASED, -and getting the value of SYMBOL will return the value ALIASED has. -Third arg DOCSTRING, if non-nil, is documentation for SYMBOL. If it is -omitted or nil, SYMBOL gets the documentation string of ALIASED, or of the -variable at the end of the chain of aliases, if ALIASED is itself an alias. -The return value is ALIASED. */) - (symbol, aliased, docstring) - Lisp_Object symbol, aliased, docstring; + doc: /* Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE. +Setting the value of NEW-ALIAS will subsequently set the value of BASE-VARIABLE, + and getting the value of NEW-ALIAS will return the value BASE-VARIABLE has. +Third arg DOCSTRING, if non-nil, is documentation for NEW-ALIAS. If it is + omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE, + or of the variable at the end of the chain of aliases, if BASE-VARIABLE is + itself an alias. +The return value is BASE-VARIABLE. */) + (new_alias, base_variable, docstring) + Lisp_Object new_alias, base_variable, docstring; { struct Lisp_Symbol *sym; - CHECK_SYMBOL (symbol); - CHECK_SYMBOL (aliased); + CHECK_SYMBOL (new_alias); + CHECK_SYMBOL (base_variable); - if (SYMBOL_CONSTANT_P (symbol)) + if (SYMBOL_CONSTANT_P (new_alias)) error ("Cannot make a constant an alias"); - sym = XSYMBOL (symbol); + sym = XSYMBOL (new_alias); sym->indirect_variable = 1; - sym->value = aliased; - sym->constant = SYMBOL_CONSTANT_P (aliased); - LOADHIST_ATTACH (symbol); + sym->value = base_variable; + sym->constant = SYMBOL_CONSTANT_P (base_variable); + LOADHIST_ATTACH (new_alias); if (!NILP (docstring)) - Fput (symbol, Qvariable_documentation, docstring); + Fput (new_alias, Qvariable_documentation, docstring); else - Fput (symbol, Qvariable_documentation, Qnil); + Fput (new_alias, Qvariable_documentation, Qnil); - return aliased; + return base_variable; } -- cgit v1.2.1 From 950850233d48dddfb6ef972ed22764f3d0662571 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Wed, 15 Jun 2005 02:30:03 +0000 Subject: (mac_compute_glyph_string_overhangs): Don't set overhangs unless the given glyph type is noncomposite CHAR_GLYPH. [USE_CARBON_EVENTS] (mac_convert_event_ref): Convert dead key down events. (XTread_socket): Don't pass keyboard events with the option modifier to the system when Vmac_command_key_is_meta is nil or Vmac_option_modifier is non-nil. [USE_CARBON_EVENTS] (read_socket_inev): New variable. [USE_CARBON_EVENTS] (init_command_handler): Fix argument. [USE_CARBON_EVENTS] (mac_handle_mouse_event): New Carbon event handler function. (install_window_handler) [USE_CARBON_EVENTS]: Install it. (XTread_socket) [USE_CARBON_EVENTS]: Move mouse wheel event handler part to mac_handle_mouse_event. --- src/ChangeLog | 17 ++++ src/macterm.c | 314 +++++++++++++++++++++++++++++++++++----------------------- 2 files changed, 207 insertions(+), 124 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 0224932301c..46cab9c1cba 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,20 @@ +2005-06-15 YAMAMOTO Mitsuharu + + * macterm.c (mac_compute_glyph_string_overhangs): Don't set + overhangs unless the given glyph type is noncomposite CHAR_GLYPH. + [USE_CARBON_EVENTS] (mac_convert_event_ref): Convert dead key down + events. + (XTread_socket): Don't pass keyboard events with the option + modifier to the system when Vmac_command_key_is_meta is nil or + Vmac_option_modifier is non-nil. + [USE_CARBON_EVENTS] (read_socket_inev): New variable. + [USE_CARBON_EVENTS] (init_command_handler): Fix argument. + [USE_CARBON_EVENTS] (mac_handle_mouse_event): New Carbon event + handler function. + (install_window_handler) [USE_CARBON_EVENTS]: Install it. + (XTread_socket) [USE_CARBON_EVENTS]: Move mouse wheel event + handler part to mac_handle_mouse_event. + 2005-06-14 Juanma Barranquero * eval.c (Fdefvaralias): Rename arguments SYMBOL and ALIASED to diff --git a/src/macterm.c b/src/macterm.c index 093b60a639a..26e7b117fc5 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -1996,33 +1996,37 @@ static void mac_compute_glyph_string_overhangs (s) struct glyph_string *s; { - Rect r; - MacFontStruct *font = s->font; - - TextFont (font->mac_fontnum); - TextSize (font->mac_fontsize); - TextFace (font->mac_fontface); - - if (s->two_byte_p) - QDTextBounds (s->nchars * 2, (char *)s->char2b, &r); - else + if (s->cmp == NULL + && s->first_glyph->type == CHAR_GLYPH) { - int i; - char *buf = xmalloc (s->nchars); + Rect r; + MacFontStruct *font = s->font; - if (buf == NULL) - SetRect (&r, 0, 0, 0, 0); + TextFont (font->mac_fontnum); + TextSize (font->mac_fontsize); + TextFace (font->mac_fontface); + + if (s->two_byte_p) + QDTextBounds (s->nchars * 2, (char *)s->char2b, &r); else { - for (i = 0; i < s->nchars; ++i) - buf[i] = s->char2b[i].byte2; - QDTextBounds (s->nchars, buf, &r); - xfree (buf); + int i; + char *buf = xmalloc (s->nchars); + + if (buf == NULL) + SetRect (&r, 0, 0, 0, 0); + else + { + for (i = 0; i < s->nchars; ++i) + buf[i] = s->char2b[i].byte2; + QDTextBounds (s->nchars, buf, &r); + xfree (buf); + } } - } - s->right_overhang = r.right > s->width ? r.right - s->width : 0; - s->left_overhang = r.left < 0 ? -r.left : 0; + s->right_overhang = r.right > s->width ? r.right - s->width : 0; + s->left_overhang = r.left < 0 ? -r.left : 0; + } } @@ -7469,6 +7473,11 @@ Lisp_Object Vmac_pass_command_to_system; /* If Non-nil, the Mac "Control" key is passed on to the Mac Toolbox for processing before Emacs sees it. */ Lisp_Object Vmac_pass_control_to_system; + +/* Points to the variable `inev' in the function XTread_socket. It is + used for passing an input event to the function back from a Carbon + event handler. */ +static struct input_event *read_socket_inev = NULL; #endif /* Set in term/mac-win.el to indicate that event loop can now generate @@ -7601,45 +7610,79 @@ mac_get_mouse_btn (EventRef ref) /* Normally, ConvertEventRefToEventRecord will correctly handle all events. However the click of the mouse wheel is not converted to a - mouseDown or mouseUp event. This calls ConvertEventRef, but then - checks to see if it is a mouse up or down carbon event that has not - been converted, and if so, converts it by hand (to be picked up in - the XTread_socket loop). */ + mouseDown or mouseUp event. Likewise for dead key down events. + This calls ConvertEventRef, but then checks to see if it is a mouse + up/down, or a dead key down carbon event that has not been + converted, and if so, converts it by hand (to be picked up in the + XTread_socket loop). */ static Boolean mac_convert_event_ref (EventRef eventRef, EventRecord *eventRec) { Boolean result = ConvertEventRefToEventRecord (eventRef, eventRec); - /* Do special case for mouse wheel button. */ - if (!result && GetEventClass (eventRef) == kEventClassMouse) + + if (result) + return result; + + switch (GetEventClass (eventRef)) { - UInt32 kind = GetEventKind (eventRef); - if (kind == kEventMouseDown && !(eventRec->what == mouseDown)) + case kEventClassMouse: + switch (GetEventKind (eventRef)) { + case kEventMouseDown: eventRec->what = mouseDown; - result=1; - } - if (kind == kEventMouseUp && !(eventRec->what == mouseUp)) - { + result = 1; + break; + + case kEventMouseUp: eventRec->what = mouseUp; - result=1; + result = 1; + break; + + default: + break; } - if (result) + + case kEventClassKeyboard: + switch (GetEventKind (eventRef)) { - /* Need where and when. */ - UInt32 mods; - GetEventParameter (eventRef, kEventParamMouseLocation, - typeQDPoint, NULL, sizeof (Point), - NULL, &eventRec->where); - /* Use two step process because new event modifiers are - 32-bit and old are 16-bit. Currently, only loss is - NumLock & Fn. */ - GetEventParameter (eventRef, kEventParamKeyModifiers, - typeUInt32, NULL, sizeof (UInt32), - NULL, &mods); - eventRec->modifiers = mods; - - eventRec->when = EventTimeToTicks (GetEventTime (eventRef)); + case kEventRawKeyDown: + { + unsigned char char_codes; + UInt32 key_code; + + eventRec->what = keyDown; + GetEventParameter (eventRef, kEventParamKeyMacCharCodes, typeChar, + NULL, sizeof (char), NULL, &char_codes); + GetEventParameter (eventRef, kEventParamKeyCode, typeUInt32, + NULL, sizeof (UInt32), NULL, &key_code); + eventRec->message = char_codes | ((key_code & 0xff) << 8); + result = 1; + } + break; + + default: + break; } + + default: + break; } + + if (result) + { + /* Need where and when. */ + UInt32 mods; + + GetEventParameter (eventRef, kEventParamMouseLocation, typeQDPoint, + NULL, sizeof (Point), NULL, &eventRec->where); + /* Use two step process because new event modifiers are 32-bit + and old are 16-bit. Currently, only loss is NumLock & Fn. */ + GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, + NULL, sizeof (UInt32), NULL, &mods); + eventRec->modifiers = mods; + + eventRec->when = EventTimeToTicks (GetEventTime (eventRef)); + } + return result; } @@ -8209,8 +8252,7 @@ mac_handle_command_event (next_handler, event, data) } static OSErr -init_command_handler (window) - WindowPtr window; +init_command_handler () { OSErr err = noErr; EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; @@ -8295,6 +8337,68 @@ mac_handle_window_event (next_handler, event, data) return eventNotHandledErr; } + +static pascal OSStatus +mac_handle_mouse_event (next_handler, event, data) + EventHandlerCallRef next_handler; + EventRef event; + void *data; +{ + OSStatus result; + + switch (GetEventKind (event)) + { + case kEventMouseWheelMoved: + { + WindowPtr wp; + struct frame *f; + EventMouseWheelAxis axis; + SInt32 delta; + Point point; + + result = CallNextEventHandler (next_handler, event); + if (result != eventNotHandledErr || read_socket_inev == NULL) + return result; + + GetEventParameter (event, kEventParamWindowRef, typeWindowRef, + NULL, sizeof (WindowRef), NULL, &wp); + f = mac_window_to_frame (wp); + if (f != mac_focus_frame (&one_mac_display_info)) + break; + + GetEventParameter (event, kEventParamMouseWheelAxis, + typeMouseWheelAxis, NULL, + sizeof (EventMouseWheelAxis), NULL, &axis); + if (axis != kEventMouseWheelAxisY) + break; + + GetEventParameter (event, kEventParamMouseWheelDelta, typeSInt32, + NULL, sizeof (SInt32), NULL, &delta); + GetEventParameter (event, kEventParamMouseLocation, typeQDPoint, + NULL, sizeof (Point), NULL, &point); + read_socket_inev->kind = WHEEL_EVENT; + read_socket_inev->code = 0; + read_socket_inev->modifiers = + (mac_event_to_emacs_modifiers (event) + | ((delta < 0) ? down_modifier : up_modifier)); + SetPortWindowPort (wp); + GlobalToLocal (&point); + XSETINT (read_socket_inev->x, point.h); + XSETINT (read_socket_inev->y, point.v); + XSETFRAME (read_socket_inev->frame_or_window, f); + read_socket_inev->timestamp = + EventTimeToTicks (GetEventTime (event)) * (1000/60); + + return noErr; + } + break; + + default: + break; + } + + return eventNotHandledErr; +} #endif /* USE_CARBON_EVENTS */ @@ -8304,16 +8408,24 @@ install_window_handler (window) { OSErr err = noErr; #if USE_CARBON_EVENTS - EventTypeSpec specs[] = {{kEventClassWindow, kEventWindowUpdate}, - {kEventClassWindow, kEventWindowBoundsChanging}}; - static EventHandlerUPP handle_window_event_UPP = NULL; - - if (handle_window_event_UPP == NULL) - handle_window_event_UPP = NewEventHandlerUPP (mac_handle_window_event); - - err = InstallWindowEventHandler (window, handle_window_event_UPP, - GetEventTypeCount (specs), specs, - NULL, NULL); + EventTypeSpec specs_window[] = + {{kEventClassWindow, kEventWindowUpdate}, + {kEventClassWindow, kEventWindowBoundsChanging}}; + EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}}; + static EventHandlerUPP handle_window_eventUPP = NULL; + static EventHandlerUPP handle_mouse_eventUPP = NULL; + + if (handle_window_eventUPP == NULL) + handle_window_eventUPP = NewEventHandlerUPP (mac_handle_window_event); + if (handle_mouse_eventUPP == NULL) + handle_mouse_eventUPP = NewEventHandlerUPP (mac_handle_mouse_event); + err = InstallWindowEventHandler (window, handle_window_eventUPP, + GetEventTypeCount (specs_window), + specs_window, NULL, NULL); + if (err == noErr) + err = InstallWindowEventHandler (window, handle_mouse_eventUPP, + GetEventTypeCount (specs_mouse), + specs_mouse, NULL, NULL); #endif #if TARGET_API_MAC_CARBON if (mac_do_track_dragUPP == NULL) @@ -8865,68 +8977,19 @@ XTread_socket (sd, expected, hold_quit) #if USE_CARBON_EVENTS /* Handle new events */ if (!mac_convert_event_ref (eventRef, &er)) - switch (GetEventClass (eventRef)) - { - case kEventClassWindow: - if (GetEventKind (eventRef) == kEventWindowBoundsChanged) - { - WindowPtr window_ptr; - GetEventParameter(eventRef, kEventParamDirectObject, - typeWindowRef, NULL, sizeof(WindowPtr), - NULL, &window_ptr); - f = mac_window_to_frame (window_ptr); - if (f && !f->async_iconified) - x_real_positions (f, &f->left_pos, &f->top_pos); - SendEventToEventTarget (eventRef, toolbox_dispatcher); - } - break; - case kEventClassMouse: - if (GetEventKind (eventRef) == kEventMouseWheelMoved) - { - SInt32 delta; - Point point; - struct frame *f = mac_focus_frame (dpyinfo); - WindowPtr window_ptr; - -#if 0 - if (dpyinfo->x_focus_frame == NULL) - { - /* Beep if wheel move occurs when all the frames - are invisible. */ - SysBeep(1); - break; - } -#endif - - GetEventParameter(eventRef, kEventParamMouseWheelDelta, - typeSInt32, NULL, sizeof (SInt32), - NULL, &delta); - GetEventParameter(eventRef, kEventParamMouseLocation, - typeQDPoint, NULL, sizeof (Point), - NULL, &point); - inev.kind = WHEEL_EVENT; - inev.code = 0; - inev.modifiers = (mac_event_to_emacs_modifiers (eventRef) - | ((delta < 0) ? down_modifier - : up_modifier)); - window_ptr = FRAME_MAC_WINDOW (f); - SetPortWindowPort (window_ptr); - GlobalToLocal (&point); - XSETINT (inev.x, point.h); - XSETINT (inev.y, point.v); - XSETFRAME (inev.frame_or_window, - mac_window_to_frame (window_ptr)); - inev.timestamp = EventTimeToTicks (GetEventTime (eventRef))*(1000/60); - } - else - SendEventToEventTarget (eventRef, toolbox_dispatcher); - - break; - - default: - /* Send the event to the appropriate receiver. */ - SendEventToEventTarget (eventRef, toolbox_dispatcher); - } + { + /* There used to be a handler for the kEventMouseWheelMoved + event here. But as of Mac OS X 10.4, this kind of event + is not directly posted to the main event queue by + two-finger scrolling on the trackpad. Instead, some + private event is posted and it is converted to a wheel + event by the default handler for the application target. + The converted one can be received by a Carbon event + handler installed on a window target. */ + read_socket_inev = &inev; + SendEventToEventTarget (eventRef, toolbox_dispatcher); + read_socket_inev = NULL; + } else #endif /* USE_CARBON_EVENTS */ switch (er.what) @@ -9362,7 +9425,10 @@ XTread_socket (sd, expected, hold_quit) if ((!NILP (Vmac_pass_command_to_system) || !(er.modifiers & cmdKey)) && (!NILP (Vmac_pass_control_to_system) - || !(er.modifiers & controlKey))) + || !(er.modifiers & controlKey)) + && (!NILP (Vmac_command_key_is_meta) + && NILP (Vmac_option_modifier) + || !(er.modifiers & optionKey))) if (SendEventToEventTarget (eventRef, toolbox_dispatcher) != eventNotHandledErr) break; -- cgit v1.2.1