diff options
-rw-r--r-- | src/ChangeLog | 30 | ||||
-rw-r--r-- | src/Makefile.in | 19 | ||||
-rw-r--r-- | src/gtkutil.c | 2 | ||||
-rw-r--r-- | src/lisp.h | 1 | ||||
-rw-r--r-- | src/macfns.c | 6 | ||||
-rw-r--r-- | src/macterm.c | 12 | ||||
-rw-r--r-- | src/macterm.h | 5 | ||||
-rw-r--r-- | src/mactoolbox.c | 7 | ||||
-rw-r--r-- | src/process.c | 48 | ||||
-rw-r--r-- | src/s/darwin.h | 3 |
10 files changed, 101 insertions, 32 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b561ceb73f5..3db5a7d4e19 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,33 @@ +2008-07-17 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * gtkutil.c: Include <config.h> instead of "config.h". + + * lisp.h (Foverlay_buffer): Add EXFUN. + + * process.c (create_process) [!WINDOWSNT && FD_CLOEXEC]: Wait for + child process to complete child_setup. Undo 2005-09-21 change. + + * s/darwin.h: Mention setsid after vfork. + +2008-07-17 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * Makefile.in (frame.o, keyboard.o, xdisp.o, xfaces.o): + Depend on macgui.h. + + * macfns.c (Fx_server_version): Don't use gestaltSystemVersionMajor, + gestaltSystemVersionMinor, or gestaltSystemVersionBugFix. + + * macterm.c (keycode_to_xkeysym_table): Add entries for f17, f18, + and f19. + [MAC_OSX] (fn_keycode_to_keycode_table): Likewise. + + * macterm.h (gestaltSystemVersionMajor, gestaltSystemVersionMinor) + (gestaltSystemVersionBugFix) [MAC_OS_X_VERSION_MAX_ALLOWED < 1040]: + Remove enumerators. + + * mactoolbox.c [USE_MAC_TSM] (mac_handle_text_input_event): + Check if FACE_FROM_ID returns NULL. + 2008-07-17 David Robinow <drobinow@gmail.com> (tiny change) * w32inevt.c (change_frame_size): Remove extern declaration. diff --git a/src/Makefile.in b/src/Makefile.in index 93890de5669..f1d8297e189 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -1103,8 +1103,9 @@ filelock.o: filelock.c buffer.h character.h charset.h coding.h systime.h \ epaths.h $(config_h) filemode.o: filemode.c $(config_h) frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \ - blockinput.h atimer.h systime.h buffer.h character.h fontset.h font.h \ - msdos.h dosfns.h dispextern.h w32term.h macterm.h termchar.h $(config_h) + blockinput.h atimer.h systime.h buffer.h character.h fontset.h font.h \ + msdos.h dosfns.h dispextern.h w32term.h macterm.h macgui.h termchar.h \ + $(config_h) fringe.o: fringe.c dispextern.h frame.h window.h buffer.h termhooks.h $(config_h) font.o: font.c dispextern.h frame.h window.h ccl.h character.h charset.h \ font.h $(config_h) @@ -1122,8 +1123,8 @@ insdel.o: insdel.c window.h buffer.h $(INTERVAL_SRC) blockinput.h character.h \ dispextern.h atimer.h systime.h region-cache.h $(config_h) keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h character.h \ commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \ - systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h \ - atimer.h xterm.h puresize.h msdos.h keymap.h w32term.h macterm.h nsterm.h \ + systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h atimer.h \ + xterm.h puresize.h msdos.h keymap.h w32term.h macterm.h macgui.h nsterm.h \ $(config_h) keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \ atimer.h systime.h puresize.h character.h intervals.h keymap.h window.h \ @@ -1190,16 +1191,16 @@ widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \ window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \ disptab.h keyboard.h dispextern.h msdos.h composite.h \ keymap.h blockinput.h atimer.h systime.h $(INTERVAL_SRC) \ - xterm.h w32term.h macterm.h nsterm.h $(config_h) + xterm.h w32term.h macterm.h macgui.h nsterm.h $(config_h) xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h \ coding.h termchar.h frame.h window.h disptab.h termhooks.h character.h \ charset.h $(config_h) keyboard.h $(INTERVAL_SRC) region-cache.h xterm.h \ - w32term.h macterm.h nsterm.h msdos.h composite.h fontset.h blockinput.h \ - atimer.h systime.h keymap.h font.h + w32term.h macterm.h macgui.h nsterm.h msdos.h composite.h fontset.h \ + blockinput.h atimer.h systime.h keymap.h font.h xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \ window.h character.h charset.h msdos.h dosfns.h composite.h atimer.h \ - systime.h keyboard.h fontset.h w32term.h macterm.h nsterm.h $(INTERVAL_SRC) \ - termchar.h termhooks.h font.h $(config_h) + systime.h keyboard.h fontset.h w32term.h macterm.h macgui.h nsterm.h \ + $(INTERVAL_SRC) termchar.h termhooks.h font.h $(config_h) xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \ $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \ character.h charset.h coding.h gtkutil.h $(config_h) termhooks.h \ diff --git a/src/gtkutil.c b/src/gtkutil.c index 996d3f49892..578e9737f39 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -17,7 +17,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ -#include "config.h" +#include <config.h> #ifdef USE_GTK #include <string.h> diff --git a/src/lisp.h b/src/lisp.h index 7a0d2088f13..58fef2efff0 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2850,6 +2850,7 @@ extern char *no_switch_window P_ ((Lisp_Object window)); EXFUN (Fset_buffer_multibyte, 1); EXFUN (Foverlay_start, 1); EXFUN (Foverlay_end, 1); +EXFUN (Foverlay_buffer, 1); extern void adjust_overlays_for_insert P_ ((EMACS_INT, EMACS_INT)); extern void adjust_overlays_for_delete P_ ((EMACS_INT, EMACS_INT)); extern void fix_start_end_in_overlays P_ ((int, int)); diff --git a/src/macfns.c b/src/macfns.c index 7bf50b3a684..cb1e74c15f8 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -2936,11 +2936,11 @@ If omitted or nil, that stands for the selected frame's display. */) { if (response >= 0x00001040) { - err = Gestalt (gestaltSystemVersionMajor, &major); + err = Gestalt ('sys1', &major); if (err == noErr) - err = Gestalt (gestaltSystemVersionMinor, &minor); + err = Gestalt ('sys2', &minor); if (err == noErr) - err = Gestalt (gestaltSystemVersionBugFix, &bugfix); + err = Gestalt ('sys3', &bugfix); } else { diff --git a/src/macterm.c b/src/macterm.c index b20857317d9..a387faa7d4d 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -9789,12 +9789,12 @@ static const unsigned char keycode_to_xkeysym_table[] = { /*0x38*/ 0, 0, 0, 0, /*0x3C*/ 0, 0, 0, 0, - /*0x40*/ 0, 0xae /*kp-decimal*/, 0, 0xaa /*kp-multiply*/, + /*0x40*/ 0xce /*f17*/, 0xae /*kp-decimal*/, 0, 0xaa /*kp-multiply*/, /*0x44*/ 0, 0xab /*kp-add*/, 0, 0x0b /*clear*/, /*0x48*/ 0, 0, 0, 0xaf /*kp-divide*/, - /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp-subtract*/, 0, + /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp-subtract*/, 0xcf /*f18*/, - /*0x50*/ 0, 0xbd /*kp-equal*/, 0xb0 /*kp-0*/, 0xb1 /*kp-1*/, + /*0x50*/ 0xd0 /*f19*/, 0xbd /*kp-equal*/, 0xb0 /*kp-0*/, 0xb1 /*kp-1*/, /*0x54*/ 0xb2 /*kp-2*/, 0xb3 /*kp-3*/, 0xb4 /*kp-4*/, 0xb5 /*kp-5*/, /*0x58*/ 0xb6 /*kp-6*/, 0xb7 /*kp-7*/, 0, 0xb8 /*kp-8*/, /*0x5C*/ 0xb9 /*kp-9*/, 0, 0, 0, @@ -9826,12 +9826,12 @@ static const unsigned char fn_keycode_to_keycode_table[] = { /*0x38*/ 0, 0, 0, 0, /*0x3C*/ 0, 0, 0, 0, - /*0x40*/ 0, 0x2f /*kp-decimal -> '.'*/, 0, 0x23 /*kp-multiply -> 'p'*/, + /*0x40*/ 0x40 /*f17 = f17*/, 0x2f /*kp-decimal -> '.'*/, 0, 0x23 /*kp-multiply -> 'p'*/, /*0x44*/ 0, 0x2c /*kp-add -> '/'*/, 0, 0x16 /*clear -> '6'*/, /*0x48*/ 0, 0, 0, 0x1d /*kp-/ -> '0'*/, - /*0x4C*/ 0x24 /*kp-enter -> return*/, 0, 0x29 /*kp-subtract -> ';'*/, 0, + /*0x4C*/ 0x24 /*kp-enter -> return*/, 0, 0x29 /*kp-subtract -> ';'*/, 0x4f /*f18 = f18*/, - /*0x50*/ 0, 0x1b /*kp-equal -> '-'*/, 0x2e /*kp-0 -> 'm'*/, 0x26 /*kp-1 -> 'j'*/, + /*0x50*/ 0x50 /*f19 = f19*/, 0x1b /*kp-equal -> '-'*/, 0x2e /*kp-0 -> 'm'*/, 0x26 /*kp-1 -> 'j'*/, /*0x54*/ 0x28 /*kp-2 -> 'k'*/, 0x25 /*kp-3 -> 'l'*/, 0x20 /*kp-4 -> 'u'*/, 0x22 /*kp-5 ->'i'*/, /*0x58*/ 0x1f /*kp-6 -> 'o'*/, 0x1a /*kp-7 -> '7'*/, 0, 0x1c /*kp-8 -> '8'*/, /*0x5C*/ 0x19 /*kp-9 -> '9'*/, 0, 0, 0, diff --git a/src/macterm.h b/src/macterm.h index 24c57ae12f8..148f073e4ab 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -575,6 +575,10 @@ enum { }; #endif +#if 0 +/* We can't determine the availability of these enumerators by + MAC_OS_X_VERSION_MAX_ALLOWED, because they are defined in + MacOSX10.3.9.sdk for Mac OS X 10.4, but not in Mac OS X 10.3. */ #if MAC_OS_X_VERSION_MAX_ALLOWED < 1040 /* Gestalt selectors */ enum { @@ -583,6 +587,7 @@ enum { gestaltSystemVersionBugFix = 'sys3' }; #endif +#endif #ifdef MAC_OSX #if MAC_OS_X_VERSION_MAX_ALLOWED < 1020 diff --git a/src/mactoolbox.c b/src/mactoolbox.c index a73578d5205..c6e5f8bcf8a 100644 --- a/src/mactoolbox.c +++ b/src/mactoolbox.c @@ -573,7 +573,7 @@ mac_handle_text_input_event (next_handler, event, data) int hpos, vpos, x, y; struct glyph_row *row; struct glyph *glyph; - XFontStruct *font; + struct face *face; f = mac_focus_frame (&one_mac_display_info); w = XWINDOW (f->selected_window); @@ -598,9 +598,10 @@ mac_handle_text_input_event (next_handler, event, data) + row->visible_height + f->top_pos + FRAME_OUTER_TO_INNER_DIFF_Y (f)); - font = FACE_FROM_ID (f, glyph->face_id)->font; - if (font) + face = FACE_FROM_ID (f, glyph->face_id); + if (face && face->font) { + XFontStruct *font = face->font; Fixed point_size = Long2Fix (font->mac_fontsize); short height = row->visible_height; short ascent = row->ascent; diff --git a/src/process.c b/src/process.c index 0a6e9f302be..0878051f733 100644 --- a/src/process.c +++ b/src/process.c @@ -1851,6 +1851,9 @@ create_process (process, new_argv, current_dir) int inchannel, outchannel; pid_t pid; int sv[2]; +#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) + int wait_child_setup[2]; +#endif #ifdef POSIX_SIGNALS sigset_t procmask; sigset_t blocked; @@ -1924,6 +1927,25 @@ create_process (process, new_argv, current_dir) forkin = sv[0]; } +#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) + { + int tem; + + tem = pipe (wait_child_setup); + if (tem < 0) + report_file_error ("Creating pipe", Qnil); + tem = fcntl (wait_child_setup[1], F_GETFD, 0); + if (tem >= 0) + tem = fcntl (wait_child_setup[1], F_SETFD, tem | FD_CLOEXEC); + if (tem < 0) + { + emacs_close (wait_child_setup[0]); + emacs_close (wait_child_setup[1]); + report_file_error ("Setting file descriptor flags", Qnil); + } + } +#endif + #if 0 /* Replaced by close_process_descs */ set_exclusive_use (inchannel); @@ -2158,6 +2180,9 @@ create_process (process, new_argv, current_dir) pid = child_setup (xforkin, xforkout, xforkout, new_argv, 1, current_dir); #else /* not WINDOWSNT */ +#ifdef FD_CLOEXEC + emacs_close (wait_child_setup[0]); +#endif child_setup (xforkin, xforkout, xforkout, new_argv, 1, current_dir); #endif /* not WINDOWSNT */ @@ -2211,6 +2236,20 @@ create_process (process, new_argv, current_dir) else #endif XPROCESS (process)->tty_name = Qnil; + +#if !defined (WINDOWSNT) && defined (FD_CLOEXEC) + /* Wait for child_setup to complete in case that vfork is + actually defined as fork. The descriptor wait_child_setup[1] + of a pipe is closed at the child side either by close-on-exec + on successful execvp or the _exit call in child_setup. */ + { + char dummy; + + emacs_close (wait_child_setup[1]); + emacs_read (wait_child_setup[0], &dummy, 1); + emacs_close (wait_child_setup[0]); + } +#endif } /* Restore the signal state whether vfork succeeded or not. @@ -4666,15 +4705,6 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display, #endif Atemp = input_wait_mask; -#if 0 - /* On Mac OS X 10.0, the SELECT system call always says input is - present (for reading) at stdin, even when none is. This - causes the call to SELECT below to return 1 and - status_notify not to be called. As a result output of - subprocesses are incorrectly discarded. - */ - FD_CLR (0, &Atemp); -#endif IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask); EMACS_SET_SECS_USECS (timeout, 0, 0); diff --git a/src/s/darwin.h b/src/s/darwin.h index 73b7aade95f..75afe67380c 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -268,7 +268,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* The following solves the problem that Emacs hangs when evaluating (make-comint "test0" "/nodir/nofile" nil "") when /nodir/nofile - does not exist. */ + does not exist. Also, setsid is not allowed in the vfork child's + context as of Darwin 9/Mac OS X 10.5. */ #undef HAVE_WORKING_VFORK #define vfork fork |