# HG changeset patch # User Katsumi Yamaoka # Date 1279061158 0 # Node ID f16404a62b75e0d34f7edf0ef0ba893dbbbf83f6 # Parent b3c31bb214858f3926b242eedb6121d2621d65d1# Parent 32e3de61d8a0c22e7d97240fbc3a428ef2b6e180 Merge from mainline. diff -r b3c31bb21485 -r f16404a62b75 etc/compilation.txt --- a/etc/compilation.txt Mon Jul 12 22:43:26 2010 +0000 +++ b/etc/compilation.txt Tue Jul 13 22:45:58 2010 +0000 @@ -93,6 +93,55 @@ "foo.adb", line 2(11): warning: file name does not match ... "src/swapping.c", line 30.34: 1506-342 (W) "/*" detected in comment. +* Cucumber + +symbol: cucumber + +Feature: This is an example for backtrace. + + Scenario: undefined step # features/cucumber.feature:3 + Given this is undefined # features/cucumber.feature:4 + + Scenario: assertion false (Test::Unit) # features/cucumber.feature:6 + Given this will generate 'assert false' # features/step_definitions/default_steps.rb:1 + is not true. (Test::Unit::AssertionFailedError) + /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block' + /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:500:in `_wrap_assertion' + /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block' + /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:63:in `assert' + /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:495:in `_wrap_assertion' + /home/gusev/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/test/unit/assertions.rb:61:in `assert' + ./features/step_definitions/default_steps.rb:2:in `/^this will generate 'assert false'$/' + features/cucumber.feature:7:in `Given this will generate 'assert false'' + + Scenario: assertion false (RSpec) # features/cucumber.feature:9 + Given this will generate 'should be_true' # features/step_definitions/default_steps.rb:5 + expected true to be false (Spec::Expectations::ExpectationNotMetError) + ./features/step_definitions/default_steps.rb:6:in `/^this will generate 'should be_true'$/' + features/cucumber.feature:10:in `Given this will generate 'should be_true'' + + Scenario: backtrace in step definition # features/cucumber.feature:12 + Given this will generate backtrace # features/step_definitions/default_steps.rb:9 + (RuntimeError) + ./features/step_definitions/default_steps.rb:10:in `/^this will generate backtrace$/' + features/cucumber.feature:13:in `Given this will generate backtrace' + + Scenario: deeep backtrace in step definition # features/cucumber.feature:15 + Given this will generate deep backtrace # features/step_definitions/default_steps.rb:13 + (RuntimeError) + ./features/step_definitions/default_steps.rb:18:in `deep' + ./features/step_definitions/default_steps.rb:14:in `/^this will generate deep backtrace$/' + features/cucumber.feature:16:in `Given this will generate deep backtrace' + +Failing Scenarios: +cucumber features/cucumber.feature:6 # Scenario: assertion false (Test::Unit) +cucumber features/cucumber.feature:9 # Scenario: assertion false (RSpec) +cucumber features/cucumber.feature:12 # Scenario: backtrace in step definition +cucumber features/cucumber.feature:15 # Scenario: deeep backtrace in step definition + +5 scenarios (4 failed, 1 undefined) +5 steps (4 failed, 1 undefined) +0m0.007s * EDG C/C++ @@ -318,6 +367,51 @@ Parse error: parse error, unexpected $ in main.php on line 59 Fatal error: Call to undefined function: mysql_pconnect() in db.inc on line 66 +* Ruby + +symbol: ruby + +plain-exception.rb:7:in `fun': unhandled exception + from plain-exception.rb:3:in `proxy' + from plain-exception.rb:12 + +* Ruby (Test::Unit) + +symbol: ruby-Test::Unit + +Loaded suite examples/test-unit +Started +FFFE +Finished in 0.023173 seconds. + + 1) Failure: +test_a_deep_assert(BacktracesTest) + [examples/test-unit.rb:28:in `here_is_a_deep_assert' + examples/test-unit.rb:19:in `test_a_deep_assert']: + is not true. + + 2) Failure: +test_assert(BacktracesTest) [examples/test-unit.rb:5]: + is not true. + + 3) Failure: +test_assert_raise(BacktracesTest) [examples/test-unit.rb:9]: +Exception raised: +Class: +Message: <""> +---Backtrace--- +examples/test-unit.rb:10:in `test_assert_raise' +examples/test-unit.rb:9:in `test_assert_raise' +--------------- + + 4) Error: +test_backtrace(BacktracesTest): +NoMethodError: undefined method `not_exists' for nil:NilClass + examples/test-unit.rb:24:in `some_function_call_from_nil' + examples/test-unit.rb:15:in `test_backtrace' + +4 tests, 3 assertions, 3 failures, 1 errors + * RXP symbol: rxp @@ -375,11 +469,11 @@ * GCOV (test coverage program) -symbol: gcov-file gcov-bb-file gcov-never-called-line gcov-called-line +symbol: gcov-file gcov-bb-file gcov-never-called-line gcov-called-line -: 0:Source:foo.c -: 0:Object:foo.bb - -: 1:/* $ gcc -fprofile-arcs -ftest-coverage foo.c + -: 1:/* $ gcc -fprofile-arcs -ftest-coverage foo.c -: 2: $ ./a.out -: 3: $ gcov foo.c -: 4: LANG=C gcov foo.c @@ -393,10 +487,10 @@ 1: 12: r = 1; #####: 13: else if (argc == 2) #####: 14: r = 2; - -: 15: else + -: 15: else #####: 16: r = 0; 1: 17: return r; - -: 18:} + -: 18:} * Podchecker error messages, per Pod::Checker diff -r b3c31bb21485 -r f16404a62b75 lisp/ChangeLog --- a/lisp/ChangeLog Mon Jul 12 22:43:26 2010 +0000 +++ b/lisp/ChangeLog Tue Jul 13 22:45:58 2010 +0000 @@ -1,3 +1,30 @@ +2010-07-13 Karl Fogel + + * bookmark.el (bookmark-show-annotation): Use `when' instead of `if'. + This is also from Thierry Volpiatto's patch in bug #6444. However, + because it was extraneous to the functional change in that patch, + and causes a re-indendation, I am committing it separately. + +2010-07-13 Karl Fogel + + * bookmark.el (bookmark-show-annotation): Ensure annotations show, + e.g. in Info bookmarks, by using `switch-to-buffer-other-window'. + Patch by Thierry Volpiatto (Bug#6444). + +2010-07-13 Chong Yidong + + * frame.el (make-frame): Fix typo in 2010-06-30 change (Bug#6625). + +2010-07-13 Adrian Robert + + * term/ns-win.el: Bind M-~ to 'ns-prev-frame (due to Matthew + Dempsky; bug#5084). Remove incorrect binding for S-tab. + (ns-alternatives-map): Change S-tab binding to backtab + (bug#6616). + + * simple.el (normal-erase-is-backspace-setup-frame): Set mode on + under ns. + 2010-07-12 Andreas Schwab * language/tai-viet.el ("TaiViet"): Try to fix re-encoding diff -r b3c31bb21485 -r f16404a62b75 lisp/bookmark.el --- a/lisp/bookmark.el Mon Jul 12 22:43:26 2010 +0000 +++ b/lisp/bookmark.el Tue Jul 13 22:45:58 2010 +0000 @@ -1733,15 +1733,15 @@ "Display the annotation for bookmark named BOOKMARK in a buffer, if an annotation exists." (let ((annotation (bookmark-get-annotation bookmark))) - (if (and annotation (not (string-equal annotation ""))) - (save-excursion - (let ((old-buf (current-buffer))) - (pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t) - (delete-region (point-min) (point-max)) - ;; (insert (concat "Annotation for bookmark '" bookmark "':\n\n")) - (insert annotation) - (goto-char (point-min)) - (pop-to-buffer old-buf)))))) + (when (and annotation (not (string-equal annotation ""))) + (save-excursion + (let ((old-buf (current-buffer))) + (pop-to-buffer (get-buffer-create "*Bookmark Annotation*") t) + (delete-region (point-min) (point-max)) + ;; (insert (concat "Annotation for bookmark '" bookmark "':\n\n")) + (insert annotation) + (goto-char (point-min)) + (switch-to-buffer-other-window old-buf)))))) (defun bookmark-show-all-annotations () diff -r b3c31bb21485 -r f16404a62b75 lisp/frame.el --- a/lisp/frame.el Mon Jul 12 22:43:26 2010 +0000 +++ b/lisp/frame.el Tue Jul 13 22:45:58 2010 +0000 @@ -736,11 +736,11 @@ (error "Don't know how to create a frame on window system %s" w)) ;; Add parameters from `window-system-default-frame-alist'. (dolist (p (cdr (assq w window-system-default-frame-alist))) - (unless (memq (car p) params) + (unless (assq (car p) params) (push p params))) ;; Add parameters from `default-frame-alist'. (dolist (p default-frame-alist) - (unless (memq (car p) params) + (unless (assq (car p) params) (push p params))) ;; Now make the frame. (run-hooks 'before-make-frame-hook) diff -r b3c31bb21485 -r f16404a62b75 lisp/simple.el --- a/lisp/simple.el Mon Jul 12 22:43:26 2010 +0000 +++ b/lisp/simple.el Tue Jul 13 22:45:58 2010 +0000 @@ -6522,6 +6522,7 @@ (if (if (eq normal-erase-is-backspace 'maybe) (and (not noninteractive) (or (memq system-type '(ms-dos windows-nt)) + (memq window-system '(ns)) (and (memq window-system '(x)) (fboundp 'x-backspace-delete-keys-p) (x-backspace-delete-keys-p)) diff -r b3c31bb21485 -r f16404a62b75 lisp/term/ns-win.el --- a/lisp/term/ns-win.el Mon Jul 12 22:43:26 2010 +0000 +++ b/lisp/term/ns-win.el Tue Jul 13 22:45:58 2010 +0000 @@ -186,14 +186,11 @@ ;;;; Keyboard mapping. -;; These tell read-char how to convert these special chars to ASCII. -(put 'S-tab 'ascii-character (logior 16 ?\t)) - (defvar ns-alternatives-map (let ((map (make-sparse-keymap))) ;; Map certain keypad keys into ASCII characters ;; that people usually expect. - (define-key map [S-tab] [25]) + (define-key map [S-tab] [backtab]) (define-key map [M-backspace] [?\M-\d]) (define-key map [M-delete] [?\M-\d]) (define-key map [M-tab] [?\M-\t]) @@ -208,6 +205,7 @@ (define-key global-map [?\s-,] 'customize) (define-key global-map [?\s-'] 'next-multiframe-window) (define-key global-map [?\s-`] 'other-frame) +(define-key global-map [?\s-~] 'ns-prev-frame) (define-key global-map [?\s--] 'center-line) (define-key global-map [?\s-:] 'ispell) (define-key global-map [?\s-\;] 'ispell-next) diff -r b3c31bb21485 -r f16404a62b75 src/ChangeLog --- a/src/ChangeLog Mon Jul 12 22:43:26 2010 +0000 +++ b/src/ChangeLog Tue Jul 13 22:45:58 2010 +0000 @@ -1,3 +1,51 @@ +2010-07-13 Eli Zaretskii + + Remove subprocesses #ifdefs. + * process.c : Move to the common part. + (Fwaiting_for_user_input_p): Move to the common part; return nil + if async subprocesses aren't supported. + * sysdep.c (wait_for_termination) [!MSDOS]: Don't compile on + MS-DOS. Remove "#ifdef subprocesses". + (sys_subshell, sys_select): Remove "#ifdef subprocesses". + (gettimeofday): Remove "#ifdef subprocesses". + (wait_without_blocking): Remove function. + (flush_pending_output, child_setup_tty): Don't compile on MS-DOS. + Remove "#ifdef subprocesses". + (child_setup_tty): Use WINDOWSNT instead of DOS_NT, since not + compiled on MS-DOS. + * callproc.c (Fcall_process) [!MSDOS]: Don't call + wait_for_termination on MS-DOS. + * emacs.c (shut_down_emacs): Remove "#ifndef subprocesses" from + initialization of inhibit_sentinels. + * keyboard.c (record_asynch_buffer_change): Remove "#ifdef + subprocesses" conditional. + * callproc.c (Fcall_process) [!subprocesses]: Don't call + wait_for_termination, since `buffer' cannot be an integer when + async subprocesses are not supported + * xdisp.c (decode_mode_spec): Use `MSDOS' instead of `subprocesses' + for ifdefing away the call to Fprocess_status. + + * process.c (add_keyboard_wait_descriptor) [!subprocesses]: Ifdef + away the entire body of the function. + +2010-07-13 Dan Nicolaescu + + Remove subprocesses #ifdefs from term.c. + * process.c (add_keyboard_wait_descriptor) + (delete_keyboard_wait_descriptor): Move to common section, do + nothing when subprocesses is not defined. + * term.c (Fsuspend_tty, Fresume_tty, init_tty): Remove subprocesses #ifdefs. + + Convert maybe_fatal to standard C. + * lisp.h (verror): Declare. + * eval.c (verror): New function containing the code from ... + (error): ... this. Call verror. + * term.c (vfatal): New function containing the code from ... + (fatal): ... this. Call vfatal. + (maybe_fatal): Convert to standard C, use variable number of + arguments. Declare as non-return. + (init_tty): Fix maybe_fatal call. + 2010-07-12 Dan Nicolaescu * xterm.c (x_scroll_bar_set_handle, x_scroll_bar_expose) diff -r b3c31bb21485 -r f16404a62b75 src/callproc.c --- a/src/callproc.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/callproc.c Tue Jul 13 22:45:58 2010 +0000 @@ -612,12 +612,6 @@ { if (fd[0] >= 0) emacs_close (fd[0]); -#ifndef subprocesses - /* If Emacs has been built with asynchronous subprocess support, - we don't need to do this, I think because it will then have - the facilities for handling SIGCHLD. */ - wait_without_blocking (); -#endif /* subprocesses */ return Qnil; } @@ -811,8 +805,10 @@ make_number (total_read)); } +#ifndef MSDOS /* Wait for it to terminate, unless it already has. */ wait_for_termination (pid); +#endif immediate_quit = 0; diff -r b3c31bb21485 -r f16404a62b75 src/emacs.c --- a/src/emacs.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/emacs.c Tue Jul 13 22:45:58 2010 +0000 @@ -2130,9 +2130,7 @@ stuff_buffered_input (stuff); -#ifdef subprocesses inhibit_sentinels = 1; -#endif kill_buffer_processes (Qnil); Fdo_auto_save (Qt, Qnil); diff -r b3c31bb21485 -r f16404a62b75 src/eval.c --- a/src/eval.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/eval.c Tue Jul 13 22:45:58 2010 +0000 @@ -1991,11 +1991,10 @@ return Qnil; } -/* dump an error message; called like printf */ - -/* VARARGS 1 */ + +/* dump an error message; called like vprintf */ void -error (const char *m, ...) +verror (const char *m, va_list ap) { char buf[200]; int size = 200; @@ -2009,14 +2008,8 @@ while (1) { - va_list ap; int used; - - /* A va_list can't be reused if we have to go around the loop - again; we need to "reinitialize" it each time. */ - va_start(ap, m); used = doprnt (buffer, size, m, m + mlen, ap); - va_end(ap); if (used < size) break; size *= 2; @@ -2035,6 +2028,19 @@ xsignal1 (Qerror, string); } + + +/* dump an error message; called like printf */ + +/* VARARGS 1 */ +void +error (const char *m, ...) +{ + va_list ap; + va_start (ap, m); + verror (m, ap); + va_end (ap); +} DEFUN ("commandp", Fcommandp, Scommandp, 1, 2, 0, doc: /* Non-nil if FUNCTION makes provisions for interactive calling. diff -r b3c31bb21485 -r f16404a62b75 src/keyboard.c --- a/src/keyboard.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/keyboard.c Tue Jul 13 22:45:58 2010 +0000 @@ -6901,18 +6901,15 @@ event.frame_or_window = Qnil; event.arg = Qnil; -#ifdef subprocesses /* We don't need a buffer-switch event unless Emacs is waiting for input. The purpose of the event is to make read_key_sequence look up the keymaps again. If we aren't in read_key_sequence, we don't need one, - and the event could cause trouble by messing up (input-pending-p). */ + and the event could cause trouble by messing up (input-pending-p). + Note: Fwaiting_for_user_input_p always returns nil when async + subprocesses aren't supported. */ tem = Fwaiting_for_user_input_p (); if (NILP (tem)) return; -#else - /* We never need these events if we have no asynchronous subprocesses. */ - return; -#endif /* Make sure no interrupt happens while storing the event. */ #ifdef SIGIO diff -r b3c31bb21485 -r f16404a62b75 src/lisp.h --- a/src/lisp.h Mon Jul 12 22:43:26 2010 +0000 +++ b/src/lisp.h Tue Jul 13 22:45:58 2010 +0000 @@ -2908,6 +2908,7 @@ extern void record_unwind_protect (Lisp_Object (*) (Lisp_Object), Lisp_Object); extern Lisp_Object unbind_to (int, Lisp_Object); extern void error (const char *, ...) NO_RETURN; +extern void verror (const char *, va_list) NO_RETURN; extern void do_autoload (Lisp_Object, Lisp_Object); extern Lisp_Object un_autoload (Lisp_Object); EXFUN (Ffetch_bytecode, 1); diff -r b3c31bb21485 -r f16404a62b75 src/process.c --- a/src/process.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/process.c Tue Jul 13 22:45:58 2010 +0000 @@ -304,6 +304,10 @@ /* Nonzero means delete a process right away if it exits. */ static int delete_exited_processes; +/* Nonzero means don't run process sentinels. This is used + when exiting. */ +int inhibit_sentinels; + #ifdef subprocesses /* Mask of bits indicating the descriptors that we wait for input on. */ @@ -381,10 +385,6 @@ /* Maximum number of bytes to send to a pty without an eof. */ static int pty_max_bytes; -/* Nonzero means don't run process sentinels. This is used - when exiting. */ -int inhibit_sentinels; - #ifdef HAVE_PTYS #ifdef HAVE_PTY_H #include @@ -5433,15 +5433,6 @@ unbind_to (count, Qnil); return nbytes; } - -DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p, - 0, 0, 0, - doc: /* Returns non-nil if Emacs is waiting for input from the user. -This is intended for use by asynchronous process output filters and sentinels. */) - (void) -{ - return (waiting_for_user_input_p ? Qt : Qnil); -} /* Sending data to subprocess */ @@ -6844,17 +6835,6 @@ -/* Add DESC to the set of keyboard input descriptors. */ - -void -add_keyboard_wait_descriptor (int desc) -{ - FD_SET (desc, &input_wait_mask); - FD_SET (desc, &non_process_wait_mask); - if (desc > max_keyboard_desc) - max_keyboard_desc = desc; -} - static int add_gpm_wait_descriptor_called_flag; void @@ -6869,25 +6849,6 @@ max_gpm_desc = desc; } -/* From now on, do not expect DESC to give keyboard input. */ - -void -delete_keyboard_wait_descriptor (int desc) -{ - int fd; - int lim = max_keyboard_desc; - - FD_CLR (desc, &input_wait_mask); - FD_CLR (desc, &non_process_wait_mask); - - if (desc == max_keyboard_desc) - for (fd = 0; fd < lim; fd++) - if (FD_ISSET (fd, &input_wait_mask) - && !FD_ISSET (fd, &non_keyboard_wait_mask) - && !FD_ISSET (fd, &gpm_wait_mask)) - max_keyboard_desc = fd; -} - void delete_gpm_wait_descriptor (int desc) { @@ -7147,6 +7108,40 @@ /* The following functions are needed even if async subprocesses are not supported. Some of them are no-op stubs in that case. */ +/* Add DESC to the set of keyboard input descriptors. */ + +void +add_keyboard_wait_descriptor (int desc) +{ +#ifdef subprocesses + FD_SET (desc, &input_wait_mask); + FD_SET (desc, &non_process_wait_mask); + if (desc > max_keyboard_desc) + max_keyboard_desc = desc; +#endif +} + +/* From now on, do not expect DESC to give keyboard input. */ + +void +delete_keyboard_wait_descriptor (int desc) +{ +#ifdef subprocesses + int fd; + int lim = max_keyboard_desc; + + FD_CLR (desc, &input_wait_mask); + FD_CLR (desc, &non_process_wait_mask); + + if (desc == max_keyboard_desc) + for (fd = 0; fd < lim; fd++) + if (FD_ISSET (fd, &input_wait_mask) + && !FD_ISSET (fd, &non_keyboard_wait_mask) + && !FD_ISSET (fd, &gpm_wait_mask)) + max_keyboard_desc = fd; +#endif /* subprocesses */ +} + /* Setup coding systems of PROCESS. */ void @@ -7275,6 +7270,19 @@ #endif /* subprocesses */ } +DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p, + 0, 0, 0, + doc: /* Returns non-nil if Emacs is waiting for input from the user. +This is intended for use by asynchronous process output filters and sentinels. */) + (void) +{ +#ifdef subprocesses + return (waiting_for_user_input_p ? Qt : Qnil); +#else + return Qnil; +#endif +} + /* Stop reading input from keyboard sources. */ void diff -r b3c31bb21485 -r f16404a62b75 src/sysdep.c --- a/src/sysdep.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/sysdep.c Tue Jul 13 22:45:58 2010 +0000 @@ -355,16 +355,6 @@ /* Ok to do nothing if this feature does not exist */ } -#ifndef subprocesses - -void -wait_without_blocking (void) -{ - croak ("wait_without_blocking"); - synch_process_alive = 0; -} - -#endif /* not subprocesses */ int wait_debugging; /* Set nonzero to make following function work under dbx (at least for bsd). */ @@ -373,6 +363,7 @@ wait_for_termination_signal (void) {} +#ifndef MSDOS /* Wait for subprocess with process id `pid' to terminate and make sure it will get eliminated (not remain forever as a zombie) */ @@ -381,7 +372,6 @@ { while (1) { -#ifdef subprocesses #if defined (BSD_SYSTEM) || defined (HPUX) /* Note that kill returns -1 even if the process is just a zombie now. But inevitably a SIGCHLD interrupt should be generated @@ -417,14 +407,9 @@ sigsuspend (&empty_mask); #endif /* not WINDOWSNT */ #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ -#else /* not subprocesses */ - break; -#endif /* not subprocesses */ } } -#ifdef subprocesses - /* * flush any pending output * (may flush input as well; it does not matter the way we use it) @@ -459,7 +444,7 @@ void child_setup_tty (int out) { -#ifndef DOS_NT +#ifndef WINDOWSNT struct emacs_tty s; EMACS_GET_TTY (out, &s); @@ -543,10 +528,10 @@ EMACS_SET_TTY (out, &s, 0); -#endif /* not DOS_NT */ +#endif /* not WINDOWSNT */ } - -#endif /* subprocesses */ +#endif /* MSDOS */ + /* Record a signal code and the handler for it. */ struct save_signal @@ -650,9 +635,7 @@ if (str) chdir ((char *) str); -#ifdef subprocesses close_process_descs (); /* Close Emacs's pipes/ptys */ -#endif #ifdef SET_EMACS_PRIORITY { @@ -1699,11 +1682,7 @@ int timeoutval; int *local_timeout; extern int proc_buffered_char[]; -#ifndef subprocesses - int process_tick = 0, update_tick = 0; -#else extern int process_tick, update_tick; -#endif unsigned char buf; #if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS) @@ -2433,7 +2412,6 @@ * Only needed when subprocesses are defined. */ -#ifdef subprocesses #ifndef HAVE_GETTIMEOFDAY #ifdef HAVE_TIMEVAL @@ -2451,8 +2429,7 @@ } #endif -#endif -#endif /* subprocess && !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */ +#endif /* !HAVE_GETTIMEOFDAY && HAVE_TIMEVAL */ /* * This function will go away as soon as all the stubs fixed. (fnf) diff -r b3c31bb21485 -r f16404a62b75 src/term.c --- a/src/term.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/term.c Tue Jul 13 22:45:58 2010 +0000 @@ -101,6 +101,10 @@ static void set_tty_hooks (struct terminal *terminal); static void dissociate_if_controlling_tty (int fd); static void delete_tty (struct terminal *); +static void maybe_fatal (int must_succeed, struct terminal *terminal, + const char *str1, const char *str2, ...) NO_RETURN; +static void vfatal (const char *str, va_list ap) NO_RETURN; + #define OUTPUT(tty, a) \ emacs_tputs ((tty), a, \ @@ -2427,10 +2431,7 @@ } reset_sys_modes (t->display_info.tty); - -#ifdef subprocesses delete_keyboard_wait_descriptor (fileno (f)); -#endif #ifndef MSDOS fclose (f); @@ -2498,9 +2499,7 @@ t->display_info.tty->input = t->display_info.tty->output; #endif -#ifdef subprocesses add_keyboard_wait_descriptor (fd); -#endif if (FRAMEP (t->display_info.tty->top_frame)) { @@ -3375,8 +3374,6 @@ #endif /* !DOS_NT */ } -static void maybe_fatal(); - /* Create a termcap display on the tty device with the given name and type. @@ -3521,9 +3518,7 @@ terminal->name = xstrdup (name); tty->type = xstrdup (terminal_type); -#ifdef subprocesses add_keyboard_wait_descriptor (0); -#endif Wcm_clear (tty); @@ -3748,7 +3743,7 @@ if (FrameRows (tty) < 3 || FrameCols (tty) < 3) maybe_fatal (must_succeed, terminal, - "Screen size %dx%d is too small" + "Screen size %dx%d is too small", "Screen size %dx%d is too small", FrameCols (tty), FrameRows (tty)); @@ -3924,24 +3919,39 @@ return terminal; } + +static void +vfatal (const char *str, va_list ap) +{ + fprintf (stderr, "emacs: "); + vfprintf (stderr, str, ap); + if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n')) + fprintf (stderr, "\n"); + va_end (ap); + fflush (stderr); + exit (1); +} + + /* Auxiliary error-handling function for init_tty. Delete TERMINAL, then call error or fatal with str1 or str2, respectively, according to MUST_SUCCEED. */ static void -maybe_fatal (must_succeed, terminal, str1, str2, arg1, arg2) - int must_succeed; - struct terminal *terminal; - char *str1, *str2, *arg1, *arg2; +maybe_fatal (int must_succeed, struct terminal *terminal, + const char *str1, const char *str2, ...) { + va_list ap; + va_start (ap, str2); if (terminal) delete_tty (terminal); if (must_succeed) - fatal (str2, arg1, arg2); + vfatal (str2, ap); else - error (str1, arg1, arg2); - + verror (str1, ap); + + va_end (ap); abort (); } @@ -3950,13 +3960,8 @@ { va_list ap; va_start (ap, str); - fprintf (stderr, "emacs: "); - vfprintf (stderr, str, ap); - if (!(strlen (str) > 0 && str[strlen (str) - 1] == '\n')) - fprintf (stderr, "\n"); + vfatal (str, ap); va_end (ap); - fflush (stderr); - exit (1); } @@ -4005,9 +4010,7 @@ if (tty->input) { -#ifdef subprocesses delete_keyboard_wait_descriptor (fileno (tty->input)); -#endif if (tty->input != stdin) fclose (tty->input); } diff -r b3c31bb21485 -r f16404a62b75 src/xdisp.c --- a/src/xdisp.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/xdisp.c Tue Jul 13 22:45:58 2010 +0000 @@ -19597,7 +19597,7 @@ obj = Fget_buffer_process (Fcurrent_buffer ()); if (NILP (obj)) return "no process"; -#ifdef subprocesses +#ifndef MSDOS obj = Fsymbol_name (Fprocess_status (obj)); #endif break; diff -r b3c31bb21485 -r f16404a62b75 src/xterm.c --- a/src/xterm.c Mon Jul 12 22:43:26 2010 +0000 +++ b/src/xterm.c Tue Jul 13 22:45:58 2010 +0000 @@ -10183,11 +10183,9 @@ xsettings_initialize (dpyinfo); -#ifdef subprocesses /* This is only needed for distinguishing keyboard and process input. */ if (connection != 0) add_keyboard_wait_descriptor (connection); -#endif #ifdef F_SETOWN fcntl (connection, F_SETOWN, getpid ());