Now on revision 109884. ------------------------------------------------------------ revno: 109884 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-09-04 23:56:55 -0700 message: ChangeLog fixes diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2012-09-03 22:12:02 +0000 +++ lisp/gnus/ChangeLog 2012-09-05 06:56:55 +0000 @@ -1,7 +1,5 @@ 2012-09-03 Lars Ingebrigtsen - * dgnushack.el: XEmacs 21.5 compilation fix. - * gnus-notifications.el (gnus-notifications-notify): Use it. * gnus-fun.el (gnus-funcall-no-warning): New function to silence @@ -2300,8 +2298,6 @@ 2011-06-30 Lars Magne Ingebrigtsen - * dgnushack.el: Autoload sha1 on XEmacs. - * gnus-group.el (gnus-read-ephemeral-emacs-bug-group): Take an optional quit window configuration. ------------------------------------------------------------ revno: 109883 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-09-04 20:37:32 -0700 message: * xdisp.c (set_message): Simplify and reindent last change. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-05 00:30:14 +0000 +++ src/ChangeLog 2012-09-05 03:37:32 +0000 @@ -1,3 +1,7 @@ +2012-09-05 Paul Eggert + + * xdisp.c (set_message): Simplify and reindent last change. + 2012-09-05 Juanma Barranquero * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies. === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-04 21:21:00 +0000 +++ src/xdisp.c 2012-09-05 03:37:32 +0000 @@ -10601,12 +10601,12 @@ message_buf_print = 0; help_echo_showing_p = 0; - if (NILP (Vinhibit_debug_on_message) && - STRINGP (Vdebug_on_message) && - fast_string_match (Vdebug_on_message, string) >= 0) { - specbind (Qinhibit_debug_on_message, Qt); - call_debugger (Fcons (Qerror, Fcons (string, Qnil))); - } + if (NILP (Vinhibit_debug_on_message) && STRINGP (Vdebug_on_message) + && fast_string_match (Vdebug_on_message, string) >= 0) + { + specbind (Qinhibit_debug_on_message, Qt); + call_debugger (list2 (Qerror, string)); + } unbind_to (count, Qnil); } ------------------------------------------------------------ revno: 109882 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2012-09-05 02:30:14 +0200 message: src/makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-04 21:21:00 +0000 +++ src/ChangeLog 2012-09-05 00:30:14 +0000 @@ -1,3 +1,7 @@ +2012-09-05 Juanma Barranquero + + * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies. + 2012-09-04 Lars Ingebrigtsen * eval.c (call_debugger): Make the function non-static so that we === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2012-09-02 02:22:33 +0000 +++ src/makefile.w32-in 2012-09-05 00:30:14 +0000 @@ -1365,6 +1365,7 @@ $(NT_INC)/sys/stat.h \ $(NT_INC)/unistd.h \ $(GNU_LIB)/allocator.h \ + $(GNU_LIB)/execinfo.h \ $(GNU_LIB)/ignore-value.h \ $(GNU_LIB)/utimens.h \ $(BLOCKINPUT_H) \ ------------------------------------------------------------ revno: 109881 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2012-09-05 02:17:57 +0200 message: nt/config.nt: Sync with autogen/config.in. diff: === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-04 17:34:54 +0000 +++ nt/ChangeLog 2012-09-05 00:17:57 +0000 @@ -1,3 +1,7 @@ +2012-09-05 Juanma Barranquero + + * config.nt: Sync with autogen/config.in. + 2012-09-04 Paul Eggert Simplify redefinition of 'abort' (Bug#12316). === modified file 'nt/config.nt' --- nt/config.nt 2012-09-02 02:00:47 +0000 +++ nt/config.nt 2012-09-05 00:17:57 +0000 @@ -165,6 +165,13 @@ or signaling SIGFPE/SIGILL. */ #undef FLOAT_CHECK_DOMAIN +/* Enable compile-time and run-time bounds-checking, and some warnings, + without upsetting glibc 2.15+. */ + #if defined __OPTIMIZE__ && __OPTIMIZE__ + # define _FORTIFY_SOURCE 2 + #endif + + /* Define to 1 if futimesat mishandles a NULL file name. */ #undef FUTIMESAT_NULL_BUG @@ -1468,9 +1475,6 @@ /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS -/* enable compile-time and run-time bounds-checking, and some warnings */ -#undef _FORTIFY_SOURCE - /* Define to 1 if Gnulib overrides 'struct stat' on Windows so that struct stat.st_size becomes 64-bit. */ #undef _GL_WINDOWS_64_BIT_ST_SIZE @@ -1547,10 +1551,12 @@ declarations. Define as empty for no equivalent. */ #undef __restrict_arr -/* Some platforms redefine this. */ +/* Define to longjmp if _setjmp and _longjmp do not work. Because longjmp may + alter signal masks, callers of _longjmp should not assume that it leaves + signal masks alone. */ #undef _longjmp -/* Some platforms redefine this. */ +/* Define to setjmp if _setjmp and _longjmp do not work. See _longjmp. */ #undef _setjmp /* Some platforms that do not use configure define this to include extra ------------------------------------------------------------ revno: 109880 committer: Lars Ingebrigtsen branch nick: trunk timestamp: Tue 2012-09-04 23:21:00 +0200 message: Implement `debug-on-message'. This allows tracking down what piece of code is outputting stuff in the echo area. * eval.c (call_debugger): Make the function non-static so that we can call it from set_message. * xdisp.c (set_message): Implement the new variable `debug-on-message'. (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-09-02 04:47:28 +0000 +++ doc/lispref/ChangeLog 2012-09-04 21:21:00 +0000 @@ -1,3 +1,7 @@ +2012-09-04 Lars Ingebrigtsen + + * debugging.texi (Explicit Debug): Document `debug-on-message'. + 2012-09-02 Chong Yidong * windows.texi (Window Configurations): Recommend against using === modified file 'doc/lispref/debugging.texi' --- doc/lispref/debugging.texi 2012-05-27 01:34:14 +0000 +++ doc/lispref/debugging.texi 2012-09-04 21:21:00 +0000 @@ -298,6 +298,11 @@ program!) The most common suitable places are inside a @code{progn} or an implicit @code{progn} (@pxref{Sequencing}). + If you don't know exactly where in the source code you want to put +the debug statement, but you want to display a backtrace when a +certain message is displayed, you can set @code{debug-on-message} to a +regular expression matching the desired message. + @node Using Debugger @subsection Using the Debugger === modified file 'etc/NEWS' --- etc/NEWS 2012-09-04 18:29:04 +0000 +++ etc/NEWS 2012-09-04 21:21:00 +0000 @@ -1916,6 +1916,10 @@ *** Set `debug-on-event' to enter the debugger on events like SIGUSR1. This can be useful when `inhibit-quit' is set. +*** Set `debug-on-message' to enter the debugger when a certain +message is displayed in the echo area. This can be useful when trying +to work out which code is doing something. + ** The new function `server-eval-at' allows evaluation of Lisp forms on named Emacs server instances. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-04 18:29:04 +0000 +++ src/ChangeLog 2012-09-04 21:21:00 +0000 @@ -1,3 +1,11 @@ +2012-09-04 Lars Ingebrigtsen + + * eval.c (call_debugger): Make the function non-static so that we + can call it from set_message. + + * xdisp.c (set_message): Implement the new variable `debug-on-message'. + (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'. + 2012-09-04 Paul Eggert Give more-useful info on a fatal error (Bug#12328). === modified file 'src/eval.c' --- src/eval.c 2012-09-04 17:34:54 +0000 +++ src/eval.c 2012-09-04 21:21:00 +0000 @@ -191,7 +191,7 @@ /* Call the Lisp debugger, giving it argument ARG. */ -static Lisp_Object +Lisp_Object call_debugger (Lisp_Object arg) { bool debug_while_redisplaying; === modified file 'src/lisp.h' --- src/lisp.h 2012-09-04 18:29:04 +0000 +++ src/lisp.h 2012-09-04 21:21:00 +0000 @@ -3076,6 +3076,7 @@ extern _Noreturn void verror (const char *, va_list) ATTRIBUTE_FORMAT_PRINTF (1, 0); extern Lisp_Object un_autoload (Lisp_Object); +extern Lisp_Object call_debugger (Lisp_Object arg); extern void init_eval_once (void); extern Lisp_Object safe_call (ptrdiff_t, Lisp_Object, ...); extern Lisp_Object safe_call1 (Lisp_Object, Lisp_Object); === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-04 17:34:54 +0000 +++ src/xdisp.c 2012-09-04 21:21:00 +0000 @@ -364,6 +364,7 @@ Lisp_Object Qcenter; static Lisp_Object Qmargin, Qpointer; static Lisp_Object Qline_height; +Lisp_Object Qinhibit_debug_on_message; /* These setters are used only in this file, so they can be private. */ static inline void @@ -10571,7 +10572,6 @@ return 0; } - /* Set the current message to a substring of S or STRING. If STRING is a Lisp string, set the message to the first NBYTES @@ -10590,6 +10590,8 @@ set_message (const char *s, Lisp_Object string, ptrdiff_t nbytes, int multibyte_p) { + ptrdiff_t count = SPECPDL_INDEX (); + message_enable_multibyte = ((s && multibyte_p) || (STRINGP (string) && STRING_MULTIBYTE (string))); @@ -10598,6 +10600,15 @@ (intptr_t) s, string, nbytes, multibyte_p); message_buf_print = 0; help_echo_showing_p = 0; + + if (NILP (Vinhibit_debug_on_message) && + STRINGP (Vdebug_on_message) && + fast_string_match (Vdebug_on_message, string) >= 0) { + specbind (Qinhibit_debug_on_message, Qt); + call_debugger (Fcons (Qerror, Fcons (string, Qnil))); + } + + unbind_to (count, Qnil); } @@ -29299,6 +29310,15 @@ Vglyphless_char_display = Fmake_char_table (Qglyphless_char_display, Qnil); Fset_char_table_extra_slot (Vglyphless_char_display, make_number (0), Qempty_box); + + DEFVAR_LISP ("debug-on-message", Vdebug_on_message, + doc: /* If non-nil, debug if a message matching this regexp is displayed. */); + Vdebug_on_message = Qnil; + + DEFVAR_LISP ("inhibit-debug-on-message", Vinhibit_debug_on_message, + doc: /* If non-nil, inhibit `debug-on-message' from entering the debugger. */); + Vinhibit_debug_on_message = Qnil; + DEFSYM(Qinhibit_debug_on_message, "inhibit-debug-on-message"); } ------------------------------------------------------------ revno: 109879 fixes bug: http://debbugs.gnu.org/12328 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-09-04 11:29:04 -0700 message: Give more-useful info on a fatal error (Bug#12328). * doc/emacs/trouble.texi (Crashing): New section, documenting this. * etc/NEWS: Document the change. * src/alloc.c [ENABLE_CHECKING]: Do not include . (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead of doing the work ourselves. * src/emacs.c (fatal_error_signal): Let fatal_error_backtrace do most of the work. (fatal_error_backtrace): New function, taken from the guts of the old fatal_error_signal, but with a new option to output a backtrace. (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful info about the signal than just its number. * src/lisp.h (fatal_error_backtrace, emacs_backtrace): New decls. * src/sysdep.c: Include (emacs_backtrace): New function, taken partly from the previous code of the 'die' function. (emacs_abort): Call fatal_error_backtrace rather than abort. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2012-08-28 16:01:59 +0000 +++ doc/emacs/ChangeLog 2012-09-04 18:29:04 +0000 @@ -1,3 +1,8 @@ +2012-09-04 Paul Eggert + + Give more-useful info on a fatal error (Bug#12328). + * trouble.texi (Crashing): New section, documenting this. + 2012-08-24 Michael Albinus * cmdargs.texi (General Variables): Setting === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2012-08-07 03:31:53 +0000 +++ doc/emacs/emacs.texi 2012-09-04 18:29:04 +0000 @@ -1136,6 +1136,7 @@ * Screen Garbled:: Garbage on the screen. * Text Garbled:: Garbage in the text. * Memory Full:: How to cope when you run out of memory. +* Crashing:: What Emacs does when it crashes. * After a Crash:: Recovering editing in an Emacs session that crashed. * Emergency Escape:: What to do if Emacs stops responding. @@ -1320,7 +1321,7 @@ If you find GNU Emacs useful, please @strong{send a donation} to the Free Software Foundation to support our work. Donations to the Free Software Foundation are tax deductible in the US. If you use GNU Emacs -at your workplace, please suggest that the company make a donation. +at your workplace, please suggest that the company make a donation. For more information on how you can help, see @url{http://www.gnu.org/help/help.html}. === modified file 'doc/emacs/trouble.texi' --- doc/emacs/trouble.texi 2012-05-27 01:25:06 +0000 +++ doc/emacs/trouble.texi 2012-09-04 18:29:04 +0000 @@ -149,6 +149,7 @@ * Screen Garbled:: Garbage on the screen. * Text Garbled:: Garbage in the text. * Memory Full:: How to cope when you run out of memory. +* Crashing:: What Emacs does when it crashes. * After a Crash:: Recovering editing in an Emacs session that crashed. * Emergency Escape:: What to do if Emacs stops responding. @end menu @@ -277,6 +278,44 @@ out of memory, because the buffer menu needs a fair amount of memory itself, and the reserve supply may not be enough. +@node Crashing +@subsection When Emacs Crashes + + Emacs is not supposed to crash, but if it does, before it exits it +reports some information about the crash to the standard error stream +@code{stderr}. This report may be useful to someone who later debugs +the same version of Emacs on the same platform. The format of this +report depends on the platform, and some platforms support backtraces. +Here is an example, generated on x86-64 GNU/Linux with version 2.15 of +the GNU C Library: + +@example +Fatal error 11: Segmentation fault +Backtrace: +emacs[0x5094e4] +emacs[0x4ed3e6] +emacs[0x4ed504] +/lib64/libpthread.so.0[0x375220efe0] +/lib64/libpthread.so.0(read+0xe)[0x375220e08e] +emacs[0x509af6] +emacs[0x5acc26] +emacs[0x5adbfb] +emacs[0x56566b] +emacs[0x59bac3] +emacs[0x565151] +... +@end example + +@noindent +The number @samp{11} is the system signal number that corresponds to +the problem, a segmentation fault here. The hexadecimal program +addresses can be useful in debugging sessions. For example, the GDB +command @samp{list *0x509af6} prints the source-code lines +corresponding to the @samp{emacs[0x509af6]} entry in the backtrace. + +The three dots at the end indicate that Emacs suppressed further +backtrace entries, in the interest of brevity. + @node After a Crash @subsection Recovery After a Crash === modified file 'etc/ChangeLog' --- etc/ChangeLog 2012-09-01 01:04:26 +0000 +++ etc/ChangeLog 2012-09-04 18:29:04 +0000 @@ -1,3 +1,8 @@ +2012-09-04 Paul Eggert + + Give more-useful info on a fatal error (Bug#12328). + * NEWS: Document the change. + 2012-09-01 Paul Eggert Better seeds for (random). === modified file 'etc/NEWS' --- etc/NEWS 2012-09-04 17:40:25 +0000 +++ etc/NEWS 2012-09-04 18:29:04 +0000 @@ -97,6 +97,11 @@ file-attributes and format-time-string, have been changed accordingly. Old-format time stamps are still accepted. +** Emacs now generates backtraces on fatal errors. +On encountering a fatal error, Emacs now outputs a textual description +of the fatal signal, and a short backtrace on platforms like glibc +that support backtraces. + ** New functions `system-users', `system-groups' return lists of the user name, group names known to the system (where possible). === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-04 17:40:25 +0000 +++ src/ChangeLog 2012-09-04 18:29:04 +0000 @@ -1,3 +1,22 @@ +2012-09-04 Paul Eggert + + Give more-useful info on a fatal error (Bug#12328). + * alloc.c [ENABLE_CHECKING]: Do not include . + (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead + of doing the work ourselves. + * emacs.c (fatal_error_signal): Let fatal_error_backtrace + do most of the work. + (fatal_error_backtrace): New function, taken from the guts + of the old fatal_error_signal, but with a new option to output + a backtrace. + (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful + info about the signal than just its number. + * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls. + * sysdep.c: Include + (emacs_backtrace): New function, taken partly from the previous + code of the 'die' function. + (emacs_abort): Call fatal_error_backtrace rather than abort. + 2012-09-04 Stefan Monnier * lread.c (readevalloop): Call internal-macroexpand-for-load to perform === modified file 'src/alloc.c' --- src/alloc.c 2012-09-04 17:34:54 +0000 +++ src/alloc.c 2012-09-04 18:29:04 +0000 @@ -6685,21 +6685,14 @@ #ifdef ENABLE_CHECKING -# include - bool suppress_checking; void die (const char *msg, const char *file, int line) { - enum { NPOINTERS_MAX = 500 }; - void *buffer[NPOINTERS_MAX]; - int npointers; fprintf (stderr, "\r\n%s:%d: Emacs fatal error: %s\r\n", file, line, msg); - npointers = backtrace (buffer, NPOINTERS_MAX); - backtrace_symbols_fd (buffer, npointers, STDERR_FILENO); - emacs_abort (); + fatal_error_backtrace (SIGABRT, INT_MAX); } #endif === modified file 'src/emacs.c' --- src/emacs.c 2012-09-04 17:34:54 +0000 +++ src/emacs.c 2012-09-04 18:29:04 +0000 @@ -298,6 +298,14 @@ fatal_error_signal (int sig) { SIGNAL_THREAD_CHECK (sig); + fatal_error_backtrace (sig, 10); +} + +/* Report a fatal error due to signal SIG, output a backtrace of at + most BACKTRACE_LIMIT lines, and exit. */ +_Noreturn void +fatal_error_backtrace (int sig, int backtrace_limit) +{ fatal_error_code = sig; signal (sig, SIG_DFL); @@ -312,6 +320,7 @@ Fkill_emacs (make_number (sig)); shut_down_emacs (sig, Qnil); + emacs_backtrace (backtrace_limit); } /* Signal the same code; this time it will really be fatal. @@ -323,6 +332,9 @@ #endif kill (getpid (), fatal_error_code); + + /* This shouldn't be executed, but it prevents a warning. */ + exit (1); } #ifdef SIGDANGER @@ -1992,7 +2004,7 @@ { reset_all_sys_modes (); if (sig && sig != SIGTERM) - fprintf (stderr, "Fatal error (%d)", sig); + fprintf (stderr, "Fatal error %d: %s", sig, strsignal (sig)); } } #else === modified file 'src/lisp.h' --- src/lisp.h 2012-09-04 17:34:54 +0000 +++ src/lisp.h 2012-09-04 18:29:04 +0000 @@ -3266,6 +3266,7 @@ #ifdef FLOAT_CATCH_SIGILL extern void fatal_error_signal (int); #endif +extern _Noreturn void fatal_error_backtrace (int, int); extern Lisp_Object Qkill_emacs; #if HAVE_SETLOCALE void fixup_locale (void); @@ -3412,6 +3413,7 @@ extern EMACS_INT get_random (void); extern void seed_random (void *, ptrdiff_t); extern void init_random (void); +extern void emacs_backtrace (int); extern _Noreturn void emacs_abort (void) NO_INLINE; extern int emacs_open (const char *, int, int); extern int emacs_close (int); === modified file 'src/sysdep.c' --- src/sysdep.c 2012-09-04 17:34:54 +0000 +++ src/sysdep.c 2012-09-04 18:29:04 +0000 @@ -21,6 +21,7 @@ #define SYSTIME_INLINE EXTERN_INLINE +#include #include #include #include @@ -1856,12 +1857,30 @@ } #endif +/* If a backtrace is available, output the top lines of it to stderr. + Do not output more than BACKTRACE_LIMIT or BACKTRACE_LIMIT_MAX lines. + This function may be called from a signal handler, so it should + not invoke async-unsafe functions like malloc. */ +void +emacs_backtrace (int backtrace_limit) +{ + enum { BACKTRACE_LIMIT_MAX = 500 }; + void *buffer[BACKTRACE_LIMIT_MAX + 1]; + int bounded_limit = min (backtrace_limit, BACKTRACE_LIMIT_MAX); + int npointers = backtrace (buffer, bounded_limit + 1); + if (npointers) + ignore_value (write (STDERR_FILENO, "\nBacktrace:\n", 12)); + backtrace_symbols_fd (buffer, bounded_limit, STDERR_FILENO); + if (bounded_limit < npointers) + ignore_value (write (STDERR_FILENO, "...\n", 4)); +} + #ifndef HAVE_NTGUI /* Using emacs_abort lets GDB return from a breakpoint here. */ void emacs_abort (void) { - abort (); + fatal_error_backtrace (SIGABRT, 10); } #endif ------------------------------------------------------------ revno: 109878 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-09-04 13:40:25 -0400 message: Macro-expand interpreted code during load. * src/lread.c (readevalloop): Call internal-macroexpand-for-load to perform eager (load-time) macro-expansion. * src/lisp.mk (lisp): Add macroexp. * lisp/loadup.el: Load macroexp. Remove hack. * lisp/emacs-lisp/macroexp.el (macroexp--eval-if-compile): New function. (macroexp--expand-all): Use it to get better warnings. (macroexp--backtrace, macroexp--trim-backtrace-frame) (internal-macroexpand-for-load): New functions. (macroexp--pending-eager-loads): New var. (emacs-startup-hook): New hack to replace one in loadup.el. * lisp/emacs-lisp/cl-macs.el (cl--compiler-macro-list*) (cl--compiler-macro-cXXr): Move to top, before they can be used. (cl-psetf): Simplify. (cl-defstruct): Add indent rule. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-04 16:00:10 +0000 +++ etc/NEWS 2012-09-04 17:40:25 +0000 @@ -601,6 +601,13 @@ * Lisp changes in Emacs 24.3 +** Interpreted files get eagerly macro-expanded during load. +This can significantly speed up execution of non-byte-compiled code, but can +also bump into harmless and previously unnoticed cyclic dependencies. +These should not be fatal: they will simply cause the macro-calls to be left +for later expansion (as before), but will also result in a warning describing +the cycle. + ** New minor mode `read-only-mode' to replace toggle-read-only (now obsolete). ** New functions `autoloadp' and `autoload-do-load'. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-04 16:00:10 +0000 +++ lisp/ChangeLog 2012-09-04 17:40:25 +0000 @@ -1,3 +1,17 @@ +2012-09-04 Stefan Monnier + + * loadup.el: Load macroexp. Remove hack. + * emacs-lisp/macroexp.el (macroexp--eval-if-compile): New function. + (macroexp--expand-all): Use it to get better warnings. + (macroexp--backtrace, macroexp--trim-backtrace-frame) + (internal-macroexpand-for-load): New functions. + (macroexp--pending-eager-loads): New var. + (emacs-startup-hook): New hack to replace one in loadup.el. + * emacs-lisp/cl-macs.el (cl--compiler-macro-list*) + (cl--compiler-macro-cXXr): Move to top, before they can be used. + (cl-psetf): Simplify. + (cl-defstruct): Add indent rule. + 2012-09-04 Lars Ingebrigtsen * mail/smtpmail.el (smtpmail-send-it): Prefer the From: header @@ -21,10 +35,8 @@ (temp-buffer-window-show-hook): New hooks. (temp-buffer-window-setup, temp-buffer-window-show) (with-temp-buffer-window): New functions. - (fit-window-to-buffer): Remove unused optional argument - OVERRIDE. - (special-display-popup-frame): Make sure the window used shows - BUFFER. + (fit-window-to-buffer): Remove unused optional argument OVERRIDE. + (special-display-popup-frame): Make sure the window used shows BUFFER. * help.el (temp-buffer-resize-mode): Fix doc-string. (resize-temp-buffer-window): New optional argument WINDOW. @@ -166,8 +178,8 @@ 2012-08-29 Michael Albinus * eshell/esh-ext.el (eshell-external-command): Do not examine - remote shell scripts. See - . + remote shell scripts. + See . * net/tramp-sh.el (tramp-remote-path): Add "/sbin" and "/usr/local/sbin". === modified file 'lisp/emacs-lisp/cl-loaddefs.el' --- lisp/emacs-lisp/cl-loaddefs.el 2012-08-30 12:16:38 +0000 +++ lisp/emacs-lisp/cl-loaddefs.el 2012-09-04 17:40:25 +0000 @@ -249,8 +249,7 @@ ;;;*** -;;;### (autoloads (cl--compiler-macro-cXXr cl--compiler-macro-list* -;;;;;; cl--compiler-macro-adjoin cl-defsubst cl-compiler-macroexpand +;;;### (autoloads (cl--compiler-macro-adjoin cl-defsubst cl-compiler-macroexpand ;;;;;; cl-define-compiler-macro cl-assert cl-check-type cl-typep ;;;;;; cl-deftype cl-defstruct cl-callf2 cl-callf cl-letf* cl-letf ;;;;;; cl-rotatef cl-shiftf cl-remf cl-psetf cl-declare cl-the cl-locally @@ -260,9 +259,20 @@ ;;;;;; cl-do cl-loop cl-return-from cl-return cl-block cl-etypecase ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp -;;;;;; cl-gensym) "cl-macs" "cl-macs.el" "9676d5517e8b9246c09fe78984c68bef") +;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) +;;;;;; "cl-macs" "cl-macs.el" "e09b4be5072a8b52d40af6e073876e76") ;;; Generated autoloads from cl-macs.el +(autoload 'cl--compiler-macro-list* "cl-macs" "\ + + +\(fn FORM ARG &rest OTHERS)" nil nil) + +(autoload 'cl--compiler-macro-cXXr "cl-macs" "\ + + +\(fn FORM X)" nil nil) + (autoload 'cl-gensym "cl-macs" "\ Generate a new uninterned symbol. The name is made by appending a number to PREFIX, default \"G\". @@ -659,6 +669,8 @@ (put 'cl-defstruct 'doc-string-elt '2) +(put 'cl-defstruct 'lisp-indent-function '1) + (autoload 'cl-deftype "cl-macs" "\ Define NAME as a new data type. The type name can then be used in `cl-typecase', `cl-check-type', etc. @@ -722,16 +734,6 @@ \(fn FORM A LIST &rest KEYS)" nil nil) -(autoload 'cl--compiler-macro-list* "cl-macs" "\ - - -\(fn FORM ARG &rest OTHERS)" nil nil) - -(autoload 'cl--compiler-macro-cXXr "cl-macs" "\ - - -\(fn FORM X)" nil nil) - ;;;*** ;;;### (autoloads (cl-tree-equal cl-nsublis cl-sublis cl-nsubst-if-not === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2012-08-10 19:34:36 +0000 +++ lisp/emacs-lisp/cl-macs.el 2012-09-04 17:40:25 +0000 @@ -58,6 +58,33 @@ ;;; Initialization. +;; Place compiler macros at the beginning, otherwise uses of the corresponding +;; functions can lead to recursive-loads that prevent the calls from +;; being optimized. + +;;;###autoload +(defun cl--compiler-macro-list* (_form arg &rest others) + (let* ((args (reverse (cons arg others))) + (form (car args))) + (while (setq args (cdr args)) + (setq form `(cons ,(car args) ,form))) + form)) + +;;;###autoload +(defun cl--compiler-macro-cXXr (form x) + (let* ((head (car form)) + (n (symbol-name (car form))) + (i (- (length n) 2))) + (if (not (string-match "c[ad]+r\\'" n)) + (if (and (fboundp head) (symbolp (symbol-function head))) + (cl--compiler-macro-cXXr (cons (symbol-function head) (cdr form)) + x) + (error "Compiler macro for cXXr applied to non-cXXr form")) + (while (> i (match-beginning 0)) + (setq x (list (if (eq (aref n i) ?a) 'car 'cdr) x)) + (setq i (1- i))) + x))) + ;;; Some predicates for analyzing Lisp forms. ;; These are used by various ;; macro expanders to optimize the results in certain common cases. @@ -1905,8 +1932,6 @@ (cl-do-proclaim (pop specs) nil))) nil) - - ;;; The standard modify macros. ;; `setf' is now part of core Elisp, defined in gv.el. @@ -1929,7 +1954,7 @@ (or p (error "Odd number of arguments to cl-psetf")) (pop p)) (if simple - `(progn (setf ,@args) nil) + `(progn (setq ,@args) nil) (setq args (reverse args)) (let ((expr `(setf ,(cadr args) ,(car args)))) (while (setq args (cddr args)) @@ -2119,7 +2144,7 @@ value, that slot cannot be set via `setf'. \(fn NAME SLOTS...)" - (declare (doc-string 2) + (declare (doc-string 2) (indent 1) (debug (&define ;Makes top-level form not be wrapped. [&or symbolp @@ -2597,14 +2622,6 @@ `(if (cl-member ,a ,list ,@keys) ,list (cons ,a ,list)) form)) -;;;###autoload -(defun cl--compiler-macro-list* (_form arg &rest others) - (let* ((args (reverse (cons arg others))) - (form (car args))) - (while (setq args (cdr args)) - (setq form `(cons ,(car args) ,form))) - form)) - (defun cl--compiler-macro-get (_form sym prop &optional def) (if def `(cl-getf (symbol-plist ,sym) ,prop ,def) @@ -2616,21 +2633,6 @@ (cl--make-type-test temp (cl--const-expr-val type))) form)) -;;;###autoload -(defun cl--compiler-macro-cXXr (form x) - (let* ((head (car form)) - (n (symbol-name (car form))) - (i (- (length n) 2))) - (if (not (string-match "c[ad]+r\\'" n)) - (if (and (fboundp head) (symbolp (symbol-function head))) - (cl--compiler-macro-cXXr (cons (symbol-function head) (cdr form)) - x) - (error "Compiler macro for cXXr applied to non-cXXr form")) - (while (> i (match-beginning 0)) - (setq x (list (if (eq (aref n i) ?a) 'car 'cdr) x)) - (setq i (1- i))) - x))) - (dolist (y '(cl-first cl-second cl-third cl-fourth cl-fifth cl-sixth cl-seventh cl-eighth cl-ninth cl-tenth === modified file 'lisp/emacs-lisp/macroexp.el' --- lisp/emacs-lisp/macroexp.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/macroexp.el 2012-09-04 17:40:25 +0000 @@ -100,6 +100,17 @@ (error (message "Compiler-macro error for %S: %S" (car form) err) form))) +(defun macroexp--eval-if-compile (&rest _forms) + "Pseudo function used internally by macroexp to delay warnings. +The purpose is to delay warnings to bytecomp.el, so they can use things +like `byte-compile-log-warning' to get better file-and-line-number data +and also to avoid outputting the warning during normal execution." + nil) +(put 'macroexp--eval-if-compile 'byte-compile + (lambda (form) + (mapc (lambda (x) (funcall (eval x))) (cdr form)) + (byte-compile-constant nil))) + (defun macroexp--expand-all (form) "Expand all macros in FORM. This is an internal version of `macroexpand-all'. @@ -112,14 +123,17 @@ (macroexpand (macroexp--all-forms form 1) macroexpand-all-environment) ;; Normal form; get its expansion, and then expand arguments. - (let ((new-form (macroexpand form macroexpand-all-environment))) - (when (and (not (eq form new-form)) ;It was a macro call. - (car-safe form) - (symbolp (car form)) - (get (car form) 'byte-obsolete-info) - (fboundp 'byte-compile-warn-obsolete)) - (byte-compile-warn-obsolete (car form))) - (setq form new-form)) + (let ((new-form + (macroexpand form macroexpand-all-environment))) + (setq form + (if (and (not (eq form new-form)) ;It was a macro call. + (car-safe form) + (symbolp (car form)) + (get (car form) 'byte-obsolete-info)) + `(progn (macroexp--eval-if-compile + (lambda () (byte-compile-warn-obsolete ',(car form)))) + ,new-form) + new-form))) (pcase form (`(cond . ,clauses) (macroexp--cons 'cond (macroexp--all-clauses clauses) form)) @@ -323,6 +337,86 @@ "Return non-nil if EXP can be copied without extra cost." (or (symbolp exp) (macroexp-const-p exp))) +;;; Load-time macro-expansion. + +;; Because macro-expansion used to be more lazy, eager macro-expansion +;; tends to bump into previously harmless/unnoticeable cyclic-dependencies. +;; So, we have to delay macro-expansion like we used to when we detect +;; such a cycle, and we also want to help coders resolve those cycles (since +;; they can be non-obvious) by providing a usefully trimmed backtrace +;; (hopefully) highlighting the problem. + +(defun macroexp--backtrace () + "Return the Elisp backtrace, more recent frames first." + (let ((bt ()) + (i 0)) + (while + (let ((frame (backtrace-frame i))) + (when frame + (push frame bt) + (setq i (1+ i))))) + (nreverse bt))) + +(defun macroexp--trim-backtrace-frame (frame) + (pcase frame + (`(,_ macroexpand (,head . ,_) . ,_) `(macroexpand (,head …))) + (`(,_ internal-macroexpand-for-load (,head ,second . ,_) . ,_) + (if (or (symbolp second) + (and (eq 'quote (car-safe second)) + (symbolp (cadr second)))) + `(macroexpand-all (,head ,second …)) + '(macroexpand-all …))) + (`(,_ load-with-code-conversion ,name . ,_) + `(load ,(file-name-nondirectory name))))) + +(defvar macroexp--pending-eager-loads nil + "Stack of files currently undergoing eager macro-expansion.") + +(defun internal-macroexpand-for-load (form) + ;; Called from the eager-macroexpansion in readevalloop. + (cond + ;; Don't repeat the same warning for every top-level element. + ((eq 'skip (car macroexp--pending-eager-loads)) form) + ;; If we detect a cycle, skip macro-expansion for now, and output a warning + ;; with a trimmed backtrace. + ((and load-file-name (member load-file-name macroexp--pending-eager-loads)) + (let* ((bt (delq nil + (mapcar #'macroexp--trim-backtrace-frame + (macroexp--backtrace)))) + (elem `(load ,(file-name-nondirectory load-file-name))) + (tail (member elem (cdr (member elem bt))))) + (if tail (setcdr tail (list '…))) + (if (eq (car-safe (car bt)) 'macroexpand-all) (setq bt (cdr bt))) + (message "Warning: Eager macro-expansion skipped due to cycle:\n %s" + (mapconcat #'prin1-to-string (nreverse bt) " => ")) + (push 'skip macroexp--pending-eager-loads) + form)) + (t + (condition-case err + (let ((macroexp--pending-eager-loads + (cons load-file-name macroexp--pending-eager-loads))) + (macroexpand-all form)) + (error + ;; Hopefully this shouldn't happen thanks to the cycle detection, + ;; but in case it does happen, let's catch the error and give the + ;; code a chance to macro-expand later. + (message "Eager macro-expansion failure: %S" err) + form))))) + +;; ¡¡¡ Big Ugly Hack !!! +;; src/bootstrap-emacs is mostly used to compile .el files, so it needs +;; macroexp, bytecomp, cconv, and byte-opt to be fast. Generally this is done +;; by compiling those files first, but this only makes a difference if those +;; files are not preloaded. But macroexp.el is preloaded so we reload it if +;; the current version is interpreted and there's a compiled version available. +(eval-when-compile + (add-hook 'emacs-startup-hook + (lambda () + (and (not (byte-code-function-p + (symbol-function 'macroexpand-all))) + (locate-library "macroexp.elc") + (load "macroexp.elc"))))) + (provide 'macroexp) ;;; macroexp.el ends here === modified file 'lisp/emacs-lisp/pcase.el' --- lisp/emacs-lisp/pcase.el 2012-07-26 01:27:33 +0000 +++ lisp/emacs-lisp/pcase.el 2012-09-04 17:40:25 +0000 @@ -60,6 +60,8 @@ ;; is in a loop, the repeated macro-expansion becomes terribly costly, so we ;; memoize previous macro expansions to try and avoid recomputing them ;; over and over again. +;; FIXME: Now that macroexpansion is also performed when loading an interpreted +;; file, this is not a real problem any more. (defconst pcase--memoize (make-hash-table :weakness 'key :test 'eq)) ;; (defconst pcase--memoize-1 (make-hash-table :test 'eq)) ;; (defconst pcase--memoize-2 (make-hash-table :weakness 'key :test 'equal)) === modified file 'lisp/loadup.el' --- lisp/loadup.el 2012-08-08 07:19:58 +0000 +++ lisp/loadup.el 2012-09-04 17:40:25 +0000 @@ -102,6 +102,19 @@ (setq load-source-file-function 'load-with-code-conversion) (load "files") +;; Load-time macro-expansion can only take effect after setting +;; load-source-file-function because of where it is called in lread.c. +(load "emacs-lisp/macroexp") +(if (byte-code-function-p (symbol-function 'macroexpand-all)) + nil + ;; Since loaddefs is not yet loaded, macroexp's uses of pcase will simply + ;; fail until pcase is explicitly loaded. This also means that we have to + ;; disable eager macro-expansion while loading pcase. + (let ((macroexp--pending-eager-loads '(skip))) + (load "emacs-lisp/pcase")) + ;; Re-load macroexp so as to eagerly macro-expand its uses of pcase. + (load "emacs-lisp/macroexp")) + (load "cus-face") (load "faces") ; after here, `defface' may be used. @@ -266,21 +279,6 @@ ;For other systems, you must edit ../src/Makefile.in. (load "site-load" t) -;; ¡¡¡ Big Ugly Hack !!! -;; src/bootstrap-emacs is mostly used to compile .el files, so it needs -;; macroexp, bytecomp, cconv, and byte-opt to be fast. Generally this is done -;; by compiling those files first, but this only makes a difference if those -;; files are not preloaded. As it so happens, macroexp.el tends to be -;; accidentally preloaded in src/bootstrap-emacs because cl.el and cl-macs.el -;; require it. So let's unload it here, if needed, to make sure the -;; byte-compiled version is used. -(if (or (not (fboundp 'macroexpand-all)) - (byte-code-function-p (symbol-function 'macroexpand-all))) - nil - (fmakunbound 'macroexpand-all) - (setq features (delq 'macroexp features)) - (autoload 'macroexpand-all "macroexp")) - ;; Determine which last version number to use ;; based on the executables that now exist. (if (and (or (equal (nth 3 command-line-args) "dump") === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-04 17:34:54 +0000 +++ src/ChangeLog 2012-09-04 17:40:25 +0000 @@ -1,3 +1,9 @@ +2012-09-04 Stefan Monnier + + * lread.c (readevalloop): Call internal-macroexpand-for-load to perform + eager (load-time) macro-expansion. + * lisp.mk (lisp): Add macroexp. + 2012-09-04 Paul Eggert Simplify redefinition of 'abort' (Bug#12316). === modified file 'src/lisp.mk' --- src/lisp.mk 2012-08-08 07:19:58 +0000 +++ src/lisp.mk 2012-09-04 17:40:25 +0000 @@ -65,6 +65,7 @@ $(lispsource)/format.elc \ $(lispsource)/bindings.elc \ $(lispsource)/files.elc \ + $(lispsource)/emacs-lisp/macroexp.elc \ $(lispsource)/cus-face.elc \ $(lispsource)/faces.elc \ $(lispsource)/button.elc \ === modified file 'src/lread.c' --- src/lread.c 2012-09-04 17:34:54 +0000 +++ src/lread.c 2012-09-04 17:40:25 +0000 @@ -1680,6 +1680,17 @@ int whole_buffer = 0; /* 1 on the first time around. */ int first_sexp = 1; + Lisp_Object macroexpand = intern ("internal-macroexpand-for-load"); + + if (NILP (Ffboundp (macroexpand)) + /* Don't macroexpand in .elc files, since it should have been done + already. We actually don't know whether we're in a .elc file or not, + so we use circumstancial evidence: .el files normally go through + Vload_source_file_function -> load-with-code-conversion + -> eval-buffer. */ + || EQ (readcharfun, Qget_file_char) + || EQ (readcharfun, Qget_emacs_mule_file_char)) + macroexpand = Qnil; if (MARKERP (readcharfun)) { @@ -1809,6 +1820,8 @@ unbind_to (count1, Qnil); /* Now eval what we just read. */ + if (!NILP (macroexpand)) + val = call1 (macroexpand, val); val = eval_sub (val); if (printflag) ------------------------------------------------------------ revno: 109877 fixes bug: http://debbugs.gnu.org/12316 committer: Paul Eggert branch nick: trunk timestamp: Tue 2012-09-04 10:34:54 -0700 message: Simplify redefinition of 'abort' (Bug#12316). Do not try to redefine the 'abort' function. Instead, redo the code so that it calls 'emacs_abort' rather than 'abort'. This removes the need for the NO_ABORT configure-time macro and makes it easier to change the abort code to do a backtrace. * configure.ac (NO_ABRT): Remove. * admin/CPP-DEFINES (NO_ABORT): Remove. * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove. * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort. * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]: Remove; sysdep.c's emacs_abort now takes its place. * src/lisp.h (emacs_abort): New decl. All calls from Emacs code to 'abort' changed to use 'emacs_abort'. * src/msdos.c (dos_abort) [defined abort]: Remove; not used. (abort) [!defined abort]: Rename to ... (emacs_abort): ... new name. * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking the place of the old 'abort' in emacs.c. * src/w32.c, src/w32fns.c (abort): Do not #undef. * src/w32.c (emacs_abort): Rename from w32_abort. diff: === modified file 'ChangeLog' --- ChangeLog 2012-09-04 06:25:44 +0000 +++ ChangeLog 2012-09-04 17:34:54 +0000 @@ -1,5 +1,8 @@ 2012-09-04 Paul Eggert + Simplify redefinition of 'abort' (Bug#12316). + * configure.ac (NO_ABRT): Remove. + * configure.ac (_setjmp, _longjmp): Check by compiling instead of by guessing. The guesses were wrong for recent versions of Solaris, such as Solaris 11. === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2012-08-18 21:36:13 +0000 +++ admin/CPP-DEFINES 2012-09-04 17:34:54 +0000 @@ -428,7 +428,6 @@ MAIL_USE_SYSTEM_LOCK MAXPATHLEN NLIST_STRUCT -NO_ABORT NO_EDITRES NO_MATHERR NO_TERMIO === modified file 'admin/ChangeLog' --- admin/ChangeLog 2012-08-28 19:26:41 +0000 +++ admin/ChangeLog 2012-09-04 17:34:54 +0000 @@ -1,3 +1,8 @@ +2012-09-04 Paul Eggert + + Simplify redefinition of 'abort' (Bug#12316). + * CPP-DEFINES (NO_ABORT): Remove. + 2012-08-28 Glenn Morris * bzrmerge.el (bzrmerge-merges): Allow unversioned files in the tree. === modified file 'configure.ac' --- configure.ac 2012-09-04 06:25:44 +0000 +++ configure.ac 2012-09-04 17:34:54 +0000 @@ -3351,12 +3351,6 @@ AC_DEFINE(BROKEN_PTY_READ_AFTER_EAGAIN, 1, [Define on FreeBSD to work around an issue when reading from a PTY.]) ;; - - dnl Define the following so emacs symbols will not conflict with those - dnl in the System framework. Otherwise -prebind will not work. - darwin) - AC_DEFINE(NO_ABORT, 1, [Do not define abort in emacs.c.]) - ;; esac case $opsys in === modified file 'nt/ChangeLog' --- nt/ChangeLog 2012-09-02 02:00:47 +0000 +++ nt/ChangeLog 2012-09-04 17:34:54 +0000 @@ -1,3 +1,8 @@ +2012-09-04 Paul Eggert + + Simplify redefinition of 'abort' (Bug#12316). + * inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove. + 2012-09-02 Juanma Barranquero * config.nt: Sync with autogen/config.in. === modified file 'nt/inc/ms-w32.h' --- nt/inc/ms-w32.h 2012-09-01 06:38:52 +0000 +++ nt/inc/ms-w32.h 2012-09-04 17:34:54 +0000 @@ -334,16 +334,7 @@ #include #endif -/* stdlib.h must be included after redefining malloc & friends, but - before redefining abort. Isn't library redefinition funny? */ #include - -/* Redefine abort. */ -#ifdef HAVE_NTGUI -#define abort w32_abort -extern _Noreturn void w32_abort (void); -#endif - #include /* Define for those source files that do not include enough NT system files. */ === modified file 'nt/inc/unistd.h' --- nt/inc/unistd.h 2011-02-27 19:48:31 +0000 +++ nt/inc/unistd.h 2012-09-04 17:34:54 +0000 @@ -3,8 +3,12 @@ #ifndef _UNISTD_H #define _UNISTD_H +/* On Microsoft platforms, declares 'environ'; on POSIX + platforms, does. Every file in Emacs that includes + also includes , so there's no need to declare + 'environ' here. */ + extern ssize_t readlink (const char *, char *, size_t); extern int symlink (char const *, char const *); #endif /* _UNISTD_H */ - === modified file 'src/.gdbinit' --- src/.gdbinit 2012-08-20 17:32:31 +0000 +++ src/.gdbinit 2012-09-04 17:34:54 +0000 @@ -1222,14 +1222,9 @@ set $tem = (struct Lisp_String *) $ptr set $tem = (char *) $tem->data - # Don't let abort actually run, as it will make stdio stop working and - # therefore the `pr' command above as well. - if $tem[0] == 'w' && $tem[1] == 'i' && $tem[2] == 'n' && $tem[3] == 'd' - # The windows-nt build replaces abort with its own function. - break w32_abort - else - break abort - end + # Don't let emacs_abort actually run, as it will make stdio stop + # working and therefore the 'pr' command above as well. + break emacs_abort end # x_error_quitter is defined only on X. But window-system is set up === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-04 17:15:45 +0000 +++ src/ChangeLog 2012-09-04 17:34:54 +0000 @@ -1,3 +1,23 @@ +2012-09-04 Paul Eggert + + Simplify redefinition of 'abort' (Bug#12316). + Do not try to redefine the 'abort' function. Instead, redo + the code so that it calls 'emacs_abort' rather than 'abort'. + This removes the need for the NO_ABORT configure-time macro + and makes it easier to change the abort code to do a backtrace. + * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort. + * emacs.c (abort) [!DOS_NT && !NO_ABORT]: + Remove; sysdep.c's emacs_abort now takes its place. + * lisp.h (emacs_abort): New decl. All calls from Emacs code to + 'abort' changed to use 'emacs_abort'. + * msdos.c (dos_abort) [defined abort]: Remove; not used. + (abort) [!defined abort]: Rename to ... + (emacs_abort): ... new name. + * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking + the place of the old 'abort' in emacs.c. + * w32.c, w32fns.c (abort): Do not #undef. + * w32.c (emacs_abort): Rename from w32_abort. + 2012-09-04 Eli Zaretskii * w32uniscribe.c (uniscribe_shape): Reverse the sign of === modified file 'src/alloc.c' --- src/alloc.c 2012-09-04 06:34:19 +0000 +++ src/alloc.c 2012-09-04 17:34:54 +0000 @@ -613,7 +613,7 @@ register unsigned char *val; int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0; if (SIZE_MAX - overhead < size) - abort (); + emacs_abort (); val = malloc (size + overhead); if (val && check_depth == 1) @@ -638,7 +638,7 @@ register unsigned char *val = (unsigned char *) block; int overhead = ++check_depth == 1 ? XMALLOC_OVERRUN_CHECK_OVERHEAD : 0; if (SIZE_MAX - overhead < size) - abort (); + emacs_abort (); if (val && check_depth == 1 @@ -649,7 +649,7 @@ size_t osize = xmalloc_get_size (val); if (memcmp (xmalloc_overrun_check_trailer, val + osize, XMALLOC_OVERRUN_CHECK_SIZE)) - abort (); + emacs_abort (); memset (val + osize, 0, XMALLOC_OVERRUN_CHECK_SIZE); val -= XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE; memset (val, 0, XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE); @@ -686,7 +686,7 @@ size_t osize = xmalloc_get_size (val); if (memcmp (xmalloc_overrun_check_trailer, val + osize, XMALLOC_OVERRUN_CHECK_SIZE)) - abort (); + emacs_abort (); #ifdef XMALLOC_CLEAR_FREE_MEMORY val -= XMALLOC_OVERRUN_CHECK_SIZE + XMALLOC_OVERRUN_SIZE_SIZE; memset (val, 0xff, osize + XMALLOC_OVERRUN_CHECK_OVERHEAD); @@ -1272,7 +1272,7 @@ { fprintf (stderr, "Freeing `%p' which wasn't allocated with malloc\n", ptr); - abort (); + emacs_abort (); } else { @@ -1331,7 +1331,7 @@ fprintf (stderr, "Region in use is %p...%p, %td bytes, type %d\n", m->start, m->end, (char *) m->end - (char *) m->start, m->type); - abort (); + emacs_abort (); } if (!dont_register_blocks) @@ -1369,7 +1369,7 @@ fprintf (stderr, "Realloc of %p which wasn't allocated with malloc\n", ptr); - abort (); + emacs_abort (); } mem_delete (m); @@ -1391,7 +1391,7 @@ if (m != MEM_NIL) { fprintf (stderr, "Realloc returns memory that is already in use\n"); - abort (); + emacs_abort (); } /* Can't handle zero size regions in the red-black tree. */ @@ -1804,7 +1804,7 @@ if (!PURE_POINTER_P (s) && s->data && nbytes != SDATA_NBYTES (SDATA_OF_STRING (s))) - abort (); + emacs_abort (); return nbytes; } @@ -1878,7 +1878,7 @@ while (s != NULL) { if ((uintptr_t) s < 1024) - abort (); + emacs_abort (); s = NEXT_FREE_LISP_STRING (s); } } @@ -2107,7 +2107,7 @@ back-pointer so that we know it's free. */ #ifdef GC_CHECK_STRING_BYTES if (string_bytes (s) != SDATA_NBYTES (data)) - abort (); + emacs_abort (); #else data->u.nbytes = STRING_BYTES (s); #endif @@ -2218,7 +2218,7 @@ /* Check that the string size recorded in the string is the same as the one recorded in the sdata structure. */ if (s && string_bytes (s) != SDATA_NBYTES (from)) - abort (); + emacs_abort (); #endif /* GC_CHECK_STRING_BYTES */ nbytes = s ? STRING_BYTES (s) : SDATA_NBYTES (from); @@ -2231,7 +2231,7 @@ if (memcmp (string_overrun_cookie, (char *) from_end - GC_STRING_OVERRUN_COOKIE_SIZE, GC_STRING_OVERRUN_COOKIE_SIZE)) - abort (); + emacs_abort (); #endif /* Non-NULL S means it's alive. Copy its data. */ @@ -2488,7 +2488,7 @@ struct Lisp_String *s; if (nchars < 0) - abort (); + emacs_abort (); if (!nbytes) return empty_multibyte_string; @@ -2809,7 +2809,7 @@ else if (type == CONSTYPE_HEAP) val = Fcons (objp[i], val); else - abort (); + emacs_abort (); } return val; } @@ -3919,7 +3919,7 @@ while (c != MEM_NIL) { if (start >= c->start && start < c->end) - abort (); + emacs_abort (); parent = c; c = start < c->start ? c->left : c->right; } @@ -3938,7 +3938,7 @@ #ifdef GC_MALLOC_CHECK x = _malloc_internal (sizeof *x); if (x == NULL) - abort (); + emacs_abort (); #else x = xmalloc (sizeof *x); #endif @@ -4613,7 +4613,7 @@ break; default: - abort (); + emacs_abort (); } if (!NILP (obj)) @@ -4810,7 +4810,7 @@ if (!survives_gc_p (p->var[i])) /* FIXME: It's not necessarily a bug. It might just be that the GCPRO is unnecessary or should release the object sooner. */ - abort (); + emacs_abort (); } #elif GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES @@ -5351,7 +5351,7 @@ { staticvec[staticidx++] = varaddress; if (staticidx >= NSTATICS) - abort (); + emacs_abort (); } @@ -5406,7 +5406,7 @@ Lisp_Object retval = Qnil; if (abort_on_gc) - abort (); + emacs_abort (); /* Can't GC if pure storage overflowed because we can't determine if something is a pure object or not. */ @@ -5887,7 +5887,7 @@ do { \ m = mem_find (po); \ if (m == MEM_NIL) \ - abort (); \ + emacs_abort (); \ } while (0) /* Check that the object pointed to by PO is live, using predicate @@ -5895,7 +5895,7 @@ #define CHECK_LIVE(LIVEP) \ do { \ if (!LIVEP (m, po)) \ - abort (); \ + emacs_abort (); \ } while (0) /* Check both of the above conditions. */ @@ -5943,7 +5943,7 @@ if (m == MEM_NIL && !SUBRP (obj) && po != &buffer_defaults && po != &buffer_local_symbols) - abort (); + emacs_abort (); #endif /* GC_CHECK_MARKED_OBJECTS */ if (ptr->header.size & PSEUDOVECTOR_FLAG) @@ -5966,7 +5966,7 @@ if (b == po) break; if (b == NULL) - abort (); + emacs_abort (); } #endif /* GC_CHECK_MARKED_OBJECTS */ mark_buffer ((struct buffer *) ptr); @@ -6042,7 +6042,7 @@ break; case PVEC_FREE: - abort (); + emacs_abort (); default: mark_vectorlike (ptr); @@ -6089,7 +6089,7 @@ And if it's forwarded to a C variable, either it's not a Lisp_Object var, or it's staticpro'd already. */ break; - default: abort (); + default: emacs_abort (); } if (!PURE_POINTER_P (XSTRING (ptr->name))) MARK_STRING (XSTRING (ptr->name)); @@ -6143,7 +6143,7 @@ break; default: - abort (); + emacs_abort (); } break; @@ -6165,7 +6165,7 @@ obj = ptr->u.cdr; cdr_count++; if (cdr_count == mark_object_loop_halt) - abort (); + emacs_abort (); goto loop; } @@ -6178,7 +6178,7 @@ break; default: - abort (); + emacs_abort (); } #undef CHECK_LIVE @@ -6247,7 +6247,7 @@ break; default: - abort (); + emacs_abort (); } return survives_p || PURE_POINTER_P ((void *) XPNTR (obj)); @@ -6699,7 +6699,7 @@ file, line, msg); npointers = backtrace (buffer, NPOINTERS_MAX); backtrace_symbols_fd (buffer, npointers, STDERR_FILENO); - abort (); + emacs_abort (); } #endif === modified file 'src/bidi.c' --- src/bidi.c 2012-08-23 20:31:52 +0000 +++ src/bidi.c 2012-09-04 17:34:54 +0000 @@ -105,7 +105,7 @@ if (ch == BIDI_EOB) return NEUTRAL_B; if (ch < 0 || ch > MAX_CHAR) - abort (); + emacs_abort (); default_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch)); /* Every valid character code, even those that are unassigned by the @@ -113,7 +113,7 @@ DerivedBidiClass.txt file. Therefore, if we ever get UNKNOWN_BT (= zero) code from CHAR_TABLE_REF, that's a bug. */ if (default_type == UNKNOWN_BT) - abort (); + emacs_abort (); if (override == NEUTRAL_DIR) return default_type; @@ -141,7 +141,7 @@ else if (override == R2L) return STRONG_R; else - abort (); /* can't happen: handled above */ + emacs_abort (); /* can't happen: handled above */ } } } @@ -183,7 +183,7 @@ case NEUTRAL_ON: return NEUTRAL; default: - abort (); + emacs_abort (); } } @@ -199,7 +199,7 @@ if (c == BIDI_EOB) return c; if (c < 0 || c > MAX_CHAR) - abort (); + emacs_abort (); val = CHAR_TABLE_REF (bidi_mirror_table, c); if (INTEGERP (val)) @@ -215,7 +215,7 @@ /* Minimal test we must do in optimized builds, to prevent weird crashes further down the road. */ if (v < 0 || v > MAX_CHAR) - abort (); + emacs_abort (); return v; } @@ -373,7 +373,7 @@ int current_scan_dir = bidi_it->scan_dir; if (idx < bidi_cache_start || idx >= bidi_cache_idx) - abort (); + emacs_abort (); bidi_copy_it (bidi_it, &bidi_cache[idx]); bidi_it->scan_dir = current_scan_dir; @@ -518,7 +518,7 @@ /* We should never cache on backward scans. */ if (bidi_it->scan_dir == -1) - abort (); + emacs_abort (); idx = bidi_cache_search (bidi_it->charpos, -1, 1); if (idx < 0) @@ -537,7 +537,7 @@ idx = bidi_cache_start; } if (bidi_it->nchars <= 0) - abort (); + emacs_abort (); bidi_copy_it (&bidi_cache[idx], bidi_it); if (!resolved) bidi_cache[idx].resolved_level = -1; @@ -592,7 +592,7 @@ bidi_peek_at_next_level (struct bidi_it *bidi_it) { if (bidi_cache_idx == bidi_cache_start || bidi_cache_last_idx == -1) - abort (); + emacs_abort (); return bidi_cache[bidi_cache_last_idx + bidi_it->scan_dir].resolved_level; } @@ -629,7 +629,7 @@ bidi_pop_it (struct bidi_it *bidi_it) { if (bidi_cache_start <= 0) - abort (); + emacs_abort (); /* Reset the next free cache slot index to what it was before the call to bidi_push_it. */ @@ -640,7 +640,7 @@ /* Pop the previous cache start from the stack. */ if (bidi_cache_sp <= 0) - abort (); + emacs_abort (); bidi_cache_start = bidi_cache_start_stack[--bidi_cache_sp]; /* Invalidate the last-used cache slot data. */ @@ -762,12 +762,12 @@ { bidi_type_table = uniprop_table (intern ("bidi-class")); if (NILP (bidi_type_table)) - abort (); + emacs_abort (); staticpro (&bidi_type_table); bidi_mirror_table = uniprop_table (intern ("mirroring")); if (NILP (bidi_mirror_table)) - abort (); + emacs_abort (); staticpro (&bidi_mirror_table); Qparagraph_start = intern ("paragraph-start"); @@ -885,7 +885,7 @@ else { if (!CHAR_HEAD_P (*p)) - abort (); + emacs_abort (); while (pos < end) { @@ -965,7 +965,7 @@ /* We don't expect to find ourselves in the middle of a display property. Hopefully, it will never be needed. */ if (charpos > *disp_pos) - abort (); + emacs_abort (); /* Text covered by `display' properties and overlays with display properties or display strings is handled as a single character that represents the entire run of characters @@ -995,7 +995,7 @@ } *nchars = disp_end_pos - *disp_pos; if (*nchars <= 0) - abort (); + emacs_abort (); if (string->s) *ch_len = bidi_count_bytes (string->s, *disp_pos, bytepos, disp_end_pos, string->unibyte); @@ -1160,7 +1160,7 @@ dir = L2R; /* We should never be called at EOB or before BEGV. */ else if (bidi_it->charpos >= end || bytepos < begbyte) - abort (); + emacs_abort (); if (dir == L2R) { @@ -1298,7 +1298,7 @@ && no_default_p && bidi_it->paragraph_dir == NEUTRAL_DIR); } else - abort (); + emacs_abort (); /* Contrary to UAX#9 clause P3, we only default the paragraph direction to L2R if we have no previous usable paragraph @@ -1325,7 +1325,7 @@ bidi_type_t ch_type; if (!bidi_initialized) - abort (); + emacs_abort (); ch_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch)); return (ch_type == LRE || ch_type == LRO || ch_type == RLE || ch_type == RLO @@ -1378,10 +1378,10 @@ /* Advance to the next character, skipping characters covered by display strings (nchars > 1). */ if (bidi_it->nchars <= 0) - abort (); + emacs_abort (); bidi_it->charpos += bidi_it->nchars; if (bidi_it->ch_len == 0) - abort (); + emacs_abort (); bidi_it->bytepos += bidi_it->ch_len; } @@ -1581,7 +1581,7 @@ } if (bidi_it->nchars <= 0) - abort (); + emacs_abort (); if (level == prev_level) /* empty embedding */ saved_it.ignore_bn_limit = bidi_it->charpos + bidi_it->nchars; else /* this embedding is non-empty */ @@ -1644,7 +1644,7 @@ || type == RLE || type == RLO || type == PDF) - abort (); + emacs_abort (); if (new_level != prev_level || bidi_it->type == NEUTRAL_B) @@ -1685,7 +1685,7 @@ else if (bidi_it->sor == L2R) type = STRONG_L; else /* shouldn't happen! */ - abort (); + emacs_abort (); } if (type == WEAK_EN /* W2 */ && bidi_it->last_strong.type_after_w1 == STRONG_AL) @@ -1767,7 +1767,7 @@ : bidi_it->string.s); if (bidi_it->nchars <= 0) - abort (); + emacs_abort (); next_char = (bidi_it->charpos + bidi_it->nchars >= eob ? BIDI_EOB @@ -1875,7 +1875,7 @@ || type == NEUTRAL_S || type == NEUTRAL_WS || type == NEUTRAL_ON)) - abort (); + emacs_abort (); if ((type != NEUTRAL_B /* Don't risk entering the long loop below if we are already at paragraph end. */ @@ -1930,7 +1930,7 @@ bidi_type_t next_type; if (bidi_it->scan_dir == -1) - abort (); + emacs_abort (); bidi_copy_it (&saved_it, bidi_it); /* Scan the text forward until we find the first non-neutral @@ -1979,7 +1979,7 @@ break; case WEAK_BN: if (!bidi_explicit_dir_char (bidi_it->ch)) - abort (); /* can't happen: BNs are skipped */ + emacs_abort (); /* can't happen: BNs are skipped */ /* FALLTHROUGH */ case NEUTRAL_B: /* Marched all the way to the end of this level run. @@ -1998,7 +1998,7 @@ } break; default: - abort (); + emacs_abort (); } type = bidi_resolve_neutral_1 (saved_it.prev_for_neutral.type, next_type, current_level); @@ -2023,7 +2023,7 @@ /* This should always be called during a forward scan. */ if (bidi_it->scan_dir != 1) - abort (); + emacs_abort (); /* Reset the limit until which to ignore BNs if we step out of the area where we found only empty levels. */ @@ -2107,7 +2107,7 @@ if (bidi_it->scan_dir > 0) { if (bidi_it->nchars <= 0) - abort (); + emacs_abort (); next_char_pos = bidi_it->charpos + bidi_it->nchars; } else if (bidi_it->charpos >= bob) @@ -2143,7 +2143,7 @@ if (bidi_it->scan_dir == -1) /* If we are going backwards, the iterator state is already cached from previous scans, and should be fully resolved. */ - abort (); + emacs_abort (); if (type == UNKNOWN_BT) type = bidi_type_of_next_char (bidi_it); @@ -2156,7 +2156,7 @@ || (type == WEAK_BN && prev_level == level)) { if (bidi_it->next_for_neutral.type == UNKNOWN_BT) - abort (); + emacs_abort (); /* If the cached state shows a neutral character, it was not resolved by bidi_resolve_neutral, so do it now. */ @@ -2170,7 +2170,7 @@ || type == WEAK_BN || type == WEAK_EN || type == WEAK_AN)) - abort (); + emacs_abort (); bidi_it->type = type; bidi_check_type (bidi_it->type); @@ -2192,7 +2192,7 @@ int dpp = bidi_it->disp_prop; if (bidi_it->nchars <= 0) - abort (); + emacs_abort (); do { ch = bidi_fetch_char (bpos += clen, cpos += nc, &disp_pos, &dpp, &bs, fwp, &clen, &nc); @@ -2301,8 +2301,9 @@ { int new_level; + /* If we are at end of level, its edges must be cached. */ if (end_flag) - abort (); /* if we are at end of level, its edges must be cached */ + emacs_abort (); bidi_cache_iterator_state (bidi_it, 1); do { @@ -2320,7 +2321,7 @@ struct gcpro gcpro1; if (bidi_it->charpos < 0 || bidi_it->bytepos < 0) - abort (); + emacs_abort (); if (bidi_it->scan_dir == 0) { @@ -2431,7 +2432,7 @@ = bidi_at_paragraph_end (bidi_it->charpos + bidi_it->nchars, bidi_it->bytepos + bidi_it->ch_len); if (bidi_it->nchars <= 0) - abort (); + emacs_abort (); if (sep_len >= 0) { bidi_it->new_paragraph = 1; === modified file 'src/blockinput.h' --- src/blockinput.h 2012-01-19 07:21:25 +0000 +++ src/blockinput.h 2012-09-04 17:34:54 +0000 @@ -89,7 +89,7 @@ do_pending_atimers (); \ } \ else if (interrupt_input_blocked < 0) \ - abort (); \ + emacs_abort (); \ } \ while (0) @@ -124,4 +124,3 @@ extern void reinvoke_input_signal (void); #endif /* EMACS_BLOCKINPUT_H */ - === modified file 'src/buffer.c' --- src/buffer.c 2012-09-03 09:22:43 +0000 +++ src/buffer.c 2012-09-04 17:34:54 +0000 @@ -1242,7 +1242,7 @@ result = Fdefault_value (variable); break; } - default: abort (); + default: emacs_abort (); } return result; @@ -2671,7 +2671,7 @@ /* Make sure no markers were put on the chain while the chain value was incorrect. */ if (BUF_MARKERS (current_buffer)) - abort (); + emacs_abort (); BUF_MARKERS (current_buffer) = markers; @@ -3413,7 +3413,7 @@ } } if (p != overlay_str_buf + total) - abort (); + emacs_abort (); if (pstr) *pstr = overlay_str_buf; return total; @@ -4596,7 +4596,7 @@ case_Lisp_Int: predicate = Qintegerp; break; case Lisp_String: predicate = Qstringp; break; case Lisp_Symbol: predicate = Qsymbolp; break; - default: abort (); + default: emacs_abort (); } wrong_type_argument (predicate, newval); @@ -5277,7 +5277,7 @@ /* Need more room? */ if (idx >= MAX_PER_BUFFER_VARS) - abort (); + emacs_abort (); last_per_buffer_idx = idx; Vbuffer_alist = Qnil; @@ -5418,7 +5418,7 @@ if (PER_BUFFER_IDX (offset) == 0) /* Did a DEFVAR_PER_BUFFER without initializing the corresponding slot of buffer_local_flags */ - abort (); + emacs_abort (); } === modified file 'src/buffer.h' --- src/buffer.h 2012-08-28 06:20:08 +0000 +++ src/buffer.h 2012-09-04 17:34:54 +0000 @@ -1149,7 +1149,7 @@ We assume you know which buffer it's pointing into. */ #define OVERLAY_POSITION(P) \ - (MARKERP (P) ? marker_position (P) : (abort (), 0)) + (MARKERP (P) ? marker_position (P) : (emacs_abort (), 0)) /*********************************************************************** @@ -1189,7 +1189,7 @@ #define PER_BUFFER_VALUE_P(B, IDX) \ (((IDX) < 0 || IDX >= last_per_buffer_idx) \ - ? (abort (), 0) \ + ? (emacs_abort (), 0) \ : ((B)->local_flags[IDX] != 0)) /* Set whether per-buffer variable with index IDX has a buffer-local @@ -1198,7 +1198,7 @@ #define SET_PER_BUFFER_VALUE_P(B, IDX, VAL) \ do { \ if ((IDX) < 0 || (IDX) >= last_per_buffer_idx) \ - abort (); \ + emacs_abort (); \ (B)->local_flags[IDX] = (VAL); \ } while (0) === modified file 'src/bytecode.c' --- src/bytecode.c 2012-08-28 06:20:08 +0000 +++ src/bytecode.c 2012-09-04 17:34:54 +0000 @@ -435,7 +435,7 @@ #ifdef BYTE_CODE_SAFE #define CHECK_RANGE(ARG) \ - if (ARG >= bytestr_length) abort () + if (ARG >= bytestr_length) emacs_abort () #else /* not BYTE_CODE_SAFE */ @@ -508,7 +508,7 @@ if (FRAME_X_P (f) && FRAME_FONT (f)->direction != 0 && FRAME_FONT (f)->direction != 1) - abort (); + emacs_abort (); } #endif @@ -600,9 +600,9 @@ { #ifdef BYTE_CODE_SAFE if (top > stacke) - abort (); + emacs_abort (); else if (top < stack.bottom - 1) - abort (); + emacs_abort (); #endif #ifdef BYTE_CODE_METER @@ -1875,7 +1875,7 @@ /* Actually this is Bstack_ref with offset 0, but we use Bdup for that instead. */ /* CASE (Bstack_ref): */ - abort (); + emacs_abort (); /* Handy byte-codes for lexical binding. */ CASE (Bstack_ref1): @@ -1928,11 +1928,11 @@ #ifdef BYTE_CODE_SAFE if (op < Bconstant) { - abort (); + emacs_abort (); } if ((op -= Bconstant) >= const_length) { - abort (); + emacs_abort (); } PUSH (vectorp[op]); #else @@ -1951,7 +1951,7 @@ #ifdef BYTE_CODE_SAFE error ("binding stack not balanced (serious byte compiler bug)"); #else - abort (); + emacs_abort (); #endif return result; === modified file 'src/character.c' --- src/character.c 2012-08-26 08:41:36 +0000 +++ src/character.c 2012-09-04 17:34:54 +0000 @@ -541,7 +541,7 @@ int len = MULTIBYTE_LENGTH (ptr, endp); if (len == 0) - abort (); + emacs_abort (); ptr += len; chars++; } === modified file 'src/charset.c' --- src/charset.c 2012-08-26 08:41:36 +0000 +++ src/charset.c 2012-09-04 17:34:54 +0000 @@ -636,7 +636,7 @@ else { if (! CHARSET_UNIFIED_P (charset)) - abort (); + emacs_abort (); map = CHARSET_UNIFY_MAP (charset); } if (STRINGP (map)) @@ -2025,10 +2025,10 @@ c = XFASTINT (ch); charset = CHAR_CHARSET (c); if (! charset) - abort (); + emacs_abort (); code = ENCODE_CHAR (charset, c); if (code == CHARSET_INVALID_CODE (charset)) - abort (); + emacs_abort (); dimension = CHARSET_DIMENSION (charset); for (val = Qnil; dimension > 0; dimension--) { === modified file 'src/cm.c' --- src/cm.c 2012-01-19 07:21:25 +0000 +++ src/cm.c 2012-09-04 17:34:54 +0000 @@ -119,7 +119,7 @@ if (curX (tty) == FrameCols (tty)) { if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1) - abort (); + emacs_abort (); if (tty->termscript) putc ('\r', tty->termscript); putc ('\r', tty->output); === modified file 'src/coding.c' --- src/coding.c 2012-08-28 05:49:02 +0000 +++ src/coding.c 2012-09-04 17:34:54 +0000 @@ -2051,7 +2051,7 @@ break; default: - abort (); + emacs_abort (); } CODING_DECODE_CHAR (coding, src, src_base, src_end, CHARSET_FROM_ID (charset_ID), code, c); @@ -2345,7 +2345,7 @@ int i; if (charbuf_end - charbuf < cmp_status->length) - abort (); + emacs_abort (); for (i = 0; i < cmp_status->length; i++) *charbuf++ = cmp_status->carryover[i]; coding->annotated = 1; @@ -2619,7 +2619,7 @@ preferred_charset_id = -1; break; default: - abort (); + emacs_abort (); } charbuf += -c - 1; continue; @@ -3482,7 +3482,7 @@ if (cmp_status->state != COMPOSING_NO) { if (charbuf_end - charbuf < cmp_status->length) - abort (); + emacs_abort (); for (i = 0; i < cmp_status->length; i++) *charbuf++ = cmp_status->carryover[i]; coding->annotated = 1; @@ -3864,7 +3864,7 @@ break; default: - abort (); + emacs_abort (); } if (cmp_status->state == COMPOSING_NO @@ -4419,7 +4419,7 @@ preferred_charset_id = -1; break; default: - abort (); + emacs_abort (); } charbuf += -c - 1; continue; @@ -4933,7 +4933,7 @@ } } if (code == CHARSET_INVALID_CODE (charset)) - abort (); + emacs_abort (); if (charset == charset_kanji) { int c1, c2; @@ -5023,7 +5023,7 @@ } } if (code == CHARSET_INVALID_CODE (charset)) - abort (); + emacs_abort (); if (charset == charset_big5) { int c1, c2; @@ -7190,7 +7190,7 @@ *buf++ = XINT (XCAR (components)); } else - abort (); + emacs_abort (); *head -= len; } } @@ -9428,7 +9428,7 @@ && changed[coding_priorities[j]]) j++; if (j == coding_category_max) - abort (); + emacs_abort (); priorities[i] = coding_priorities[j]; } === modified file 'src/conf_post.h' --- src/conf_post.h 2012-08-20 16:48:10 +0000 +++ src/conf_post.h 2012-09-04 17:34:54 +0000 @@ -178,9 +178,6 @@ #endif #include -/* If you think about removing the line below, note that the - MS-Windows build relies on it for declaration of 'environ' needed - by a few source files. */ #include #if __GNUC__ >= 3 /* On GCC 3.0 we might get a warning. */ === modified file 'src/data.c' --- src/data.c 2012-08-27 17:23:48 +0000 +++ src/data.c 2012-09-04 17:34:54 +0000 @@ -108,7 +108,7 @@ to try and do that by checking the tagbits, but nowadays all tagbits are potentially valid. */ /* if ((unsigned int) XTYPE (value) >= Lisp_Type_Limit) - * abort (); */ + * emacs_abort (); */ xsignal2 (Qwrong_type_argument, predicate, value); } @@ -182,7 +182,7 @@ case Lisp_Misc_Float: return Qfloat; } - abort (); + emacs_abort (); case Lisp_Vectorlike: if (WINDOW_CONFIGURATIONP (object)) @@ -217,7 +217,7 @@ return Qfloat; default: - abort (); + emacs_abort (); } } @@ -551,7 +551,7 @@ /* In set_internal, we un-forward vars when their value is set to Qunbound. */ return Qt; - default: abort (); + default: emacs_abort (); } return (EQ (valcontents, Qunbound) ? Qnil : Qt); @@ -864,7 +864,7 @@ don't think anything will break. --lorentey */ return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset + (char *)FRAME_KBOARD (SELECTED_FRAME ())); - default: abort (); + default: emacs_abort (); } } @@ -950,7 +950,7 @@ break; default: - abort (); /* goto def; */ + emacs_abort (); /* goto def; */ } } @@ -1055,7 +1055,7 @@ /* FALLTHROUGH */ case SYMBOL_FORWARDED: return do_symval_forwarding (SYMBOL_FWD (sym)); - default: abort (); + default: emacs_abort (); } } @@ -1265,7 +1265,7 @@ store_symval_forwarding (/* sym, */ innercontents, newval, buf); break; } - default: abort (); + default: emacs_abort (); } return; } @@ -1316,7 +1316,7 @@ /* For other variables, get the current value. */ return do_symval_forwarding (valcontents); } - default: abort (); + default: emacs_abort (); } } @@ -1414,7 +1414,7 @@ else return Fset (symbol, value); } - default: abort (); + default: emacs_abort (); } } @@ -1538,7 +1538,7 @@ else if (BUFFER_OBJFWDP (valcontents.fwd)) return variable; break; - default: abort (); + default: emacs_abort (); } if (sym->constant) @@ -1611,7 +1611,7 @@ error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); break; - default: abort (); + default: emacs_abort (); } if (sym->constant) @@ -1718,7 +1718,7 @@ if (blv->frame_local) return variable; break; - default: abort (); + default: emacs_abort (); } /* Get rid of this buffer's alist element, if any. */ @@ -1800,7 +1800,7 @@ error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); break; - default: abort (); + default: emacs_abort (); } if (sym->constant) @@ -1877,7 +1877,7 @@ } return Qnil; } - default: abort (); + default: emacs_abort (); } } @@ -1912,7 +1912,7 @@ case SYMBOL_FORWARDED: /* All BUFFER_OBJFWD slots become local if they are set. */ return (BUFFER_OBJFWDP (SYMBOL_FWD (sym)) ? Qt : Qnil); - default: abort (); + default: emacs_abort (); } } @@ -1956,7 +1956,7 @@ return SYMBOL_BLV (sym)->where; else return Qnil; - default: abort (); + default: emacs_abort (); } } @@ -2272,7 +2272,7 @@ return Qnil; default: - abort (); + emacs_abort (); } } === modified file 'src/dired.c' --- src/dired.c 2012-08-28 00:33:56 +0000 +++ src/dired.c 2012-09-04 17:34:54 +0000 @@ -275,7 +275,7 @@ /* Some bug somewhere. */ if (nchars > nbytes) - abort (); + emacs_abort (); STRING_SET_CHARS (fullname, nchars); if (nchars == nbytes) === modified file 'src/dispnew.c' --- src/dispnew.c 2012-09-01 06:38:52 +0000 +++ src/dispnew.c 2012-09-04 17:34:54 +0000 @@ -297,7 +297,7 @@ void __executable_start (void) { - abort (); + emacs_abort (); } #endif @@ -347,7 +347,7 @@ /* Detect the case that more matrices are freed than were allocated. */ if (--glyph_matrix_count < 0) - abort (); + emacs_abort (); /* Free glyph memory if MATRIX owns it. */ if (matrix->pool == NULL) @@ -2339,9 +2339,9 @@ /* Check that nothing is left allocated. */ if (glyph_matrix_count) - abort (); + emacs_abort (); if (glyph_pool_count) - abort (); + emacs_abort (); } @@ -3024,7 +3024,7 @@ { if (!glyph_row_slice_p (window_matrix->rows + i, frame_matrix->rows + j)) - abort (); + emacs_abort (); ++i, ++j; } } @@ -3453,7 +3453,7 @@ if (!last_seen_p && MATRIX_ROW_BOTTOM_Y (row) >= yb) last_seen_p = 1; else if (last_seen_p && row->enabled_p) - abort (); + emacs_abort (); } } @@ -4809,7 +4809,7 @@ struct glyph_matrix *desired_matrix = frame->desired_matrix; if (!current_matrix) - abort (); + emacs_abort (); /* Compute hash codes of all the lines. Also calculate number of changed lines, number of unchanged lines at the beginning, and @@ -5477,7 +5477,7 @@ else if (part == ON_RIGHT_MARGIN) area = RIGHT_MARGIN_AREA; else - abort (); + emacs_abort (); for (i = 0; row->enabled_p && i < w->current_matrix->nrows; ++i, ++row) if (wy >= row->y && wy < MATRIX_ROW_BOTTOM_Y (row)) @@ -6277,7 +6277,7 @@ /* Convert the initial frame to use the new display. */ if (f->output_method != output_initial) - abort (); + emacs_abort (); f->output_method = t->type; f->terminal = t; === modified file 'src/editfns.c' --- src/editfns.c 2012-09-02 07:10:10 +0000 +++ src/editfns.c 2012-09-04 17:34:54 +0000 @@ -4263,7 +4263,7 @@ } if (bufsize < p - buf) - abort (); + emacs_abort (); if (maybe_combine_byte) nchars = multibyte_chars_in_text ((unsigned char *) buf, p - buf); @@ -4603,7 +4603,7 @@ len1_byte, end2, start2_byte + len2_byte) || count_combining_after (BYTE_POS_ADDR (start1_byte), len1_byte, end2, start2_byte + len2_byte)) - abort (); + emacs_abort (); } else { @@ -4615,7 +4615,7 @@ len2_byte, end1, start1_byte + len1_byte) || count_combining_after (BYTE_POS_ADDR (start1_byte), len1_byte, end2, start2_byte + len2_byte)) - abort (); + emacs_abort (); } #endif === modified file 'src/emacs.c' --- src/emacs.c 2012-09-02 17:10:35 +0000 +++ src/emacs.c 2012-09-04 17:34:54 +0000 @@ -340,22 +340,6 @@ force_auto_save_soon (); } #endif - -/* We define abort, rather than using it from the library, - so that GDB can return from a breakpoint here. - MSDOS has its own definition in msdos.c. */ - -#if ! defined (DOS_NT) && ! defined (NO_ABORT) - -void -abort (void) -{ - kill (getpid (), SIGABRT); - /* This shouldn't be executed, but it prevents a warning. */ - exit (1); -} -#endif - /* Code for dealing with Lisp access to the Unix command line. */ @@ -1892,7 +1876,7 @@ } if (best < 0) - abort (); + emacs_abort (); /* Copy the highest priority remaining option, with its args, to NEW. Unless it is a duplicate of the previous one. */ === modified file 'src/eval.c' --- src/eval.c 2012-09-02 17:10:35 +0000 +++ src/eval.c 2012-09-04 17:34:54 +0000 @@ -1493,7 +1493,7 @@ immediate_quit = handling_signal = 0; abort_on_gc = 0; if (gc_in_progress || waiting_for_input) - abort (); + emacs_abort (); #if 0 /* rms: I don't know why this was here, but it is surely wrong for an error that is handled. */ @@ -1590,7 +1590,7 @@ xsignal (Lisp_Object error_symbol, Lisp_Object data) { Fsignal (error_symbol, data); - abort (); + emacs_abort (); } /* Like xsignal, but takes 0, 1, 2, or 3 args instead of a list. */ @@ -2043,7 +2043,7 @@ struct gcpro gcpro1, gcpro2, gcpro3; if (handling_signal) - abort (); + emacs_abort (); if (SYMBOLP (form)) { @@ -2207,7 +2207,7 @@ is supported by this code. We need to either rewrite the subr to use a different argument protocol, or add more cases to this switch. */ - abort (); + emacs_abort (); } } } @@ -2850,7 +2850,7 @@ /* If a subr takes more than 8 arguments without using MANY or UNEVALLED, we need to extend this function to support it. Until this is done, there is no way to call the function. */ - abort (); + emacs_abort (); } } } @@ -2981,7 +2981,7 @@ lexenv = Qnil; } else - abort (); + emacs_abort (); i = optional = rest = 0; for (; CONSP (syms_left); syms_left = XCDR (syms_left)) @@ -3195,7 +3195,7 @@ set_internal (symbol, value, Qnil, 1); break; } - default: abort (); + default: emacs_abort (); } } === modified file 'src/fileio.c' --- src/fileio.c 2012-08-28 06:20:08 +0000 +++ src/fileio.c 2012-09-04 17:34:54 +0000 @@ -1294,7 +1294,7 @@ if (!(IS_DIRECTORY_SEP (target[0]) && IS_DIRECTORY_SEP (target[1]))) #endif /* WINDOWSNT */ { - if (!drive) abort (); + if (!drive) emacs_abort (); target -= 2; target[0] = DRIVE_LETTER (drive); target[1] = ':'; === modified file 'src/fns.c' --- src/fns.c 2012-09-02 16:56:31 +0000 +++ src/fns.c 2012-09-04 17:34:54 +0000 @@ -2953,7 +2953,7 @@ encoded, length, NILP (no_line_break), !NILP (BVAR (current_buffer, enable_multibyte_characters))); if (encoded_length > allength) - abort (); + emacs_abort (); if (encoded_length < 0) { @@ -3009,7 +3009,7 @@ encoded, length, NILP (no_line_break), STRING_MULTIBYTE (string)); if (encoded_length > allength) - abort (); + emacs_abort (); if (encoded_length < 0) { @@ -3154,7 +3154,7 @@ decoded, length, multibyte, &inserted_chars); if (decoded_length > allength) - abort (); + emacs_abort (); if (decoded_length < 0) { @@ -3204,7 +3204,7 @@ decoded_length = base64_decode_1 (SSDATA (string), decoded, length, 0, NULL); if (decoded_length > length) - abort (); + emacs_abort (); else if (decoded_length >= 0) decoded_string = make_unibyte_string (decoded, decoded_length); else @@ -3960,7 +3960,7 @@ else if (EQ (h->weak, Qkey_and_value)) remove_p = !(key_known_to_survive_p && value_known_to_survive_p); else - abort (); + emacs_abort (); next = HASH_NEXT (h, i); @@ -4256,7 +4256,7 @@ break; default: - abort (); + emacs_abort (); } return hash; === modified file 'src/frame.c' --- src/frame.c 2012-09-01 06:38:52 +0000 +++ src/frame.c 2012-09-04 17:34:54 +0000 @@ -214,7 +214,7 @@ case output_ns: return Qns; default: - abort (); + emacs_abort (); } } @@ -620,7 +620,7 @@ #ifdef MSDOS if (sf->output_method != output_msdos_raw && sf->output_method != output_termcap) - abort (); + emacs_abort (); #else /* not MSDOS */ #ifdef WINDOWSNT /* This should work now! */ @@ -767,7 +767,7 @@ Lisp_Object focus; if (!FRAMEP (XCAR (tail))) - abort (); + emacs_abort (); focus = FRAME_FOCUS_FRAME (XFRAME (XCAR (tail))); @@ -897,7 +897,7 @@ /* There must always be at least one frame in Vframe_list. */ if (! CONSP (Vframe_list)) - abort (); + emacs_abort (); /* If this frame is dead, it won't be in Vframe_list, and we'll loop forever. Forestall that. */ @@ -975,7 +975,7 @@ /* There must always be at least one frame in Vframe_list. */ if (! CONSP (Vframe_list)) - abort (); + emacs_abort (); prev = Qnil; for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail)) @@ -984,7 +984,7 @@ f = XCAR (tail); if (!FRAMEP (f)) - abort (); + emacs_abort (); if (EQ (frame, f) && !NILP (prev)) return prev; @@ -1385,7 +1385,7 @@ this = XCAR (frames); if (!FRAMEP (this)) - abort (); + emacs_abort (); f1 = XFRAME (this); if (kb == FRAME_KBOARD (f1)) @@ -1421,7 +1421,7 @@ this = XCAR (frames); if (!FRAMEP (this)) - abort (); + emacs_abort (); f1 = XFRAME (this); /* Consider only frames on the same kboard @@ -1447,7 +1447,7 @@ that is prohibited at the top; you can't delete surrogate minibuffer frames. */ if (NILP (frame_with_minibuf)) - abort (); + emacs_abort (); kset_default_minibuffer_frame (kb, frame_with_minibuf); } @@ -2108,7 +2108,7 @@ swap_in_global_binding (sym); break; } - default: abort (); + default: emacs_abort (); } } @@ -3835,7 +3835,7 @@ } default: - abort (); + emacs_abort (); } } else === modified file 'src/frame.h' --- src/frame.h 2012-09-02 10:53:46 +0000 +++ src/frame.h 2012-09-04 17:34:54 +0000 @@ -981,7 +981,7 @@ ((FRAMEP (selected_frame) \ && FRAME_LIVE_P (XFRAME (selected_frame))) \ ? XFRAME (selected_frame) \ - : (abort (), (struct frame *) 0)) + : (emacs_abort (), (struct frame *) 0)) /*********************************************************************** === modified file 'src/ftfont.c' --- src/ftfont.c 2012-07-20 07:29:04 +0000 +++ src/ftfont.c 2012-09-04 17:34:54 +0000 @@ -1630,7 +1630,7 @@ FT_Glyph_Metrics *m; if (FT_Load_Glyph (ft_face, g->code, FT_LOAD_DEFAULT) != 0) - abort (); + emacs_abort (); m = &ft_face->glyph->metrics; if (flt_font_ft->matrix) { === modified file 'src/gtkutil.c' --- src/gtkutil.c 2012-09-03 08:13:33 +0000 +++ src/gtkutil.c 2012-09-04 17:34:54 +0000 @@ -254,7 +254,7 @@ free_widget_value (widget_value *wv) { if (wv->free_list) - abort (); + emacs_abort (); if (malloc_cpt > 25) { @@ -3519,7 +3519,7 @@ } /* Should never end up here */ - abort (); + emacs_abort (); } /* Remove pointer at IDX from id_to_widget. @@ -4087,7 +4087,7 @@ else { fprintf (stderr, "internal error: GTK_IMAGE_PIXBUF failed\n"); - abort (); + emacs_abort (); } } else if (store_type == GTK_IMAGE_ICON_NAME) @@ -4102,7 +4102,7 @@ else { fprintf (stderr, "internal error: store_type is %d\n", store_type); - abort (); + emacs_abort (); } } if (wmenuimage) === modified file 'src/image.c' --- src/image.c 2012-09-04 06:34:19 +0000 +++ src/image.c 2012-09-04 17:34:54 +0000 @@ -841,7 +841,7 @@ break; default: - abort (); + emacs_abort (); break; } === modified file 'src/indent.c' --- src/indent.c 2012-08-18 06:06:39 +0000 +++ src/indent.c 2012-09-04 17:34:54 +0000 @@ -122,7 +122,7 @@ int i; if (widthtab->header.size != 256) - abort (); + emacs_abort (); for (i = 0; i < 256; i++) if (character_width (i, disptab) @@ -144,7 +144,7 @@ bset_width_table (buf, Fmake_vector (make_number (256), make_number (0))); widthtab = XVECTOR (BVAR (buf, width_table)); if (widthtab->header.size != 256) - abort (); + emacs_abort (); for (i = 0; i < 256; i++) XSETFASTINT (widthtab->contents[i], character_width (i, disptab)); === modified file 'src/insdel.c' --- src/insdel.c 2012-09-02 07:10:10 +0000 +++ src/insdel.c 2012-09-04 17:34:54 +0000 @@ -69,13 +69,13 @@ for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) { if (tail->buffer->text != current_buffer->text) - abort (); + emacs_abort (); if (tail->charpos > Z) - abort (); + emacs_abort (); if (tail->bytepos > Z_BYTE) - abort (); + emacs_abort (); if (multibyte && ! CHAR_HEAD_P (FETCH_BYTE (tail->bytepos))) - abort (); + emacs_abort (); } } @@ -808,7 +808,7 @@ #ifdef BYTE_COMBINING_DEBUG if (count_combining_before (string, nbytes, PT, PT_BYTE) || count_combining_after (string, nbytes, PT, PT_BYTE)) - abort (); + emacs_abort (); #endif /* Record deletion of the surrounding text that combines with @@ -943,7 +943,7 @@ the text that has been stored by copy_text. */ if (count_combining_before (GPT_ADDR, outgoing_nbytes, PT, PT_BYTE) || count_combining_after (GPT_ADDR, outgoing_nbytes, PT, PT_BYTE)) - abort (); + emacs_abort (); #endif record_insert (PT, nchars); @@ -1126,7 +1126,7 @@ the text that has been stored by copy_text. */ if (count_combining_before (GPT_ADDR, outgoing_nbytes, PT, PT_BYTE) || count_combining_after (GPT_ADDR, outgoing_nbytes, PT, PT_BYTE)) - abort (); + emacs_abort (); #endif record_insert (PT, nchars); @@ -1187,7 +1187,7 @@ #ifdef BYTE_COMBINING_DEBUG if (count_combining_before (GPT_ADDR, len_byte, from, from_byte) || count_combining_after (GPT_ADDR, len_byte, from, from_byte)) - abort (); + emacs_abort (); #endif if (STRINGP (prev_text)) @@ -1370,7 +1370,7 @@ the text that has been stored by copy_text. */ if (count_combining_before (GPT_ADDR, outgoing_insbytes, from, from_byte) || count_combining_after (GPT_ADDR, outgoing_insbytes, from, from_byte)) - abort (); + emacs_abort (); #endif if (! EQ (BVAR (current_buffer, undo_list), Qt)) @@ -1496,7 +1496,7 @@ the text that has been stored by copy_text. */ if (count_combining_before (GPT_ADDR, insbytes, from, from_byte) || count_combining_after (GPT_ADDR, insbytes, from, from_byte)) - abort (); + emacs_abort (); #endif GAP_SIZE -= insbytes; @@ -1704,7 +1704,7 @@ #ifdef BYTE_COMBINING_DEBUG if (count_combining_before (BUF_BYTE_ADDRESS (current_buffer, to_byte), Z_BYTE - to_byte, from, from_byte)) - abort (); + emacs_abort (); #endif if (ret_string || ! EQ (BVAR (current_buffer, undo_list), Qt)) === modified file 'src/intervals.c' --- src/intervals.c 2012-09-02 07:10:10 +0000 +++ src/intervals.c 2012-09-04 17:34:54 +0000 @@ -199,13 +199,13 @@ i0_sym = XCAR (i0_cdr); i0_cdr = XCDR (i0_cdr); if (!CONSP (i0_cdr)) - return 0; /* abort (); */ + return 0; i1_val = i1->plist; while (CONSP (i1_val) && !EQ (XCAR (i1_val), i0_sym)) { i1_val = XCDR (i1_val); if (!CONSP (i1_val)) - return 0; /* abort (); */ + return 0; i1_val = XCDR (i1_val); } @@ -223,7 +223,7 @@ i1_cdr = XCDR (i1_cdr); if (!CONSP (i1_cdr)) - return 0; /* abort (); */ + return 0; i1_cdr = XCDR (i1_cdr); } @@ -1253,7 +1253,7 @@ else if (STRINGP (owner)) set_string_intervals (owner, parent); else - abort (); + emacs_abort (); return; } @@ -1408,7 +1408,7 @@ start, length); else { - IF_LINT (if (length < - TYPE_MAXIMUM (ptrdiff_t)) abort ();) + lint_assume (- TYPE_MAXIMUM (ptrdiff_t) <= length); adjust_intervals_for_deletion (buffer, start, -length); } } @@ -1468,7 +1468,7 @@ /* This must be the rightmost or last interval and cannot be merged right. The caller should have known. */ - abort (); + emacs_abort (); } /* Merge interval I with its lexicographic predecessor. The resulting @@ -1524,7 +1524,7 @@ /* This must be the leftmost or first interval and cannot be merged left. The caller should have known. */ - abort (); + emacs_abort (); } /* Create a copy of SOURCE but with the default value of UP. */ @@ -2170,7 +2170,7 @@ else if (STRINGP (object)) i = find_interval (string_intervals (object), pos); else - abort (); + emacs_abort (); if (!i || (i->position + LENGTH (i) <= pos)) return 0; @@ -2209,7 +2209,7 @@ /* Perhaps we should just change `position' to the limit. */ if (position > BUF_ZV (buffer) || position < BUF_BEGV (buffer)) - abort (); + emacs_abort (); /* Ignore narrowing, so that a local map continues to be valid even if the visible region contains no characters and hence no properties. */ === modified file 'src/keyboard.c' --- src/keyboard.c 2012-09-02 16:56:31 +0000 +++ src/keyboard.c 2012-09-04 17:34:54 +0000 @@ -1023,7 +1023,7 @@ pop_kboard (); /* The pop should not change the kboard. */ if (single_kboard && current_kboard != prev) - abort (); + emacs_abort (); } return Qnil; } @@ -2605,13 +2605,13 @@ Lisp_Object last = KVAR (kb, kbd_queue); /* We shouldn't get here if we were in single-kboard mode! */ if (single_kboard) - abort (); + emacs_abort (); if (CONSP (last)) { while (CONSP (XCDR (last))) last = XCDR (last); if (!NILP (XCDR (last))) - abort (); + emacs_abort (); } if (!CONSP (last)) kset_kbd_queue (kb, Fcons (c, Qnil)); @@ -2784,7 +2784,7 @@ if (current_kboard->kbd_queue_has_data) { if (!CONSP (KVAR (current_kboard, kbd_queue))) - abort (); + emacs_abort (); c = XCAR (KVAR (current_kboard, kbd_queue)); kset_kbd_queue (current_kboard, XCDR (KVAR (current_kboard, kbd_queue))); @@ -2851,7 +2851,7 @@ while (CONSP (XCDR (last))) last = XCDR (last); if (!NILP (XCDR (last))) - abort (); + emacs_abort (); } if (!CONSP (last)) kset_kbd_queue (kb, Fcons (c, Qnil)); @@ -3560,7 +3560,7 @@ struct input_event *hold_quit) { if (event->kind == NO_EVENT) - abort (); + emacs_abort (); if (hold_quit && hold_quit->kind != NO_EVENT) return; @@ -3955,7 +3955,7 @@ #else /* We're getting selection request events, but we don't have a window system. */ - abort (); + emacs_abort (); #endif } @@ -4192,7 +4192,7 @@ else /* We were promised by the above while loop that there was something for us to read! */ - abort (); + emacs_abort (); input_pending = readable_events (0); @@ -4261,7 +4261,7 @@ #else /* We're getting selection request events, but we don't have a window system. */ - abort (); + emacs_abort (); #endif } } @@ -5614,7 +5614,7 @@ else if (FRAMEP (event->frame_or_window)) f = XFRAME (event->frame_or_window); else - abort (); + emacs_abort (); if (FRAME_WINDOW_P (f)) fuzz = double_click_fuzz; @@ -5721,7 +5721,7 @@ else /* Every mouse event should either have the down_modifier or the up_modifier set. */ - abort (); + emacs_abort (); { /* Get the symbol we should use for the mouse click. */ @@ -5782,7 +5782,7 @@ else if (FRAMEP (event->frame_or_window)) fr = XFRAME (event->frame_or_window); else - abort (); + emacs_abort (); fuzz = FRAME_WINDOW_P (fr) ? double_click_fuzz : double_click_fuzz / 8; @@ -5802,7 +5802,7 @@ else /* Every wheel event should either have the down_modifier or the up_modifier set. */ - abort (); + emacs_abort (); if (event->kind == HORIZ_WHEEL_EVENT) symbol_num += 2; @@ -5971,7 +5971,7 @@ { char *name = find_user_signal_name (event->code); if (!name) - abort (); + emacs_abort (); return intern (name); } @@ -6052,7 +6052,7 @@ /* The 'kind' field of the event is something we don't recognize. */ default: - abort (); + emacs_abort (); } } @@ -6229,7 +6229,7 @@ /* Only the event queue may use the `up' modifier; it should always be turned into a click or drag event before presented to lisp code. */ if (modifiers & up_modifier) - abort (); + emacs_abort (); if (modifiers & alt_modifier) { *p++ = 'A'; *p++ = '-'; } if (modifiers & ctrl_modifier) { *p++ = 'C'; *p++ = '-'; } @@ -6324,7 +6324,7 @@ Qnil); if (modifiers & ~INTMASK) - abort (); + emacs_abort (); XSETFASTINT (mask, modifiers); elements = Fcons (unmodified, Fcons (mask, Qnil)); @@ -7001,7 +7001,7 @@ if (terminal->type != output_termcap && terminal->type != output_msdos_raw) - abort (); + emacs_abort (); /* XXX I think the following code should be moved to separate hook functions in system-dependent files. */ @@ -10902,7 +10902,7 @@ #endif /* not MSDOS */ fflush (stdout); if (((c = getchar ()) & ~040) == 'Y') - abort (); + emacs_abort (); while (c != '\n') c = getchar (); #ifdef MSDOS printf ("\r\nContinuing...\r\n"); @@ -10983,7 +10983,7 @@ #ifdef POLL_FOR_INPUT /* May be > 1 if in recursive minibuffer. */ if (poll_suppress_count == 0) - abort (); + emacs_abort (); #endif #endif if (FRAMEP (internal_last_event_frame) @@ -11341,7 +11341,7 @@ for (kbp = &all_kboards; *kbp != kb; kbp = &(*kbp)->next_kboard) if (*kbp == NULL) - abort (); + emacs_abort (); *kbp = kb->next_kboard; /* Prevent a dangling reference to KB. */ @@ -11352,7 +11352,7 @@ current_kboard = FRAME_KBOARD (XFRAME (selected_frame)); single_kboard = 0; if (current_kboard == kb) - abort (); + emacs_abort (); } wipe_kboard (kb); === modified file 'src/keymap.c' --- src/keymap.c 2012-09-02 03:50:29 +0000 +++ src/keymap.c 2012-09-04 17:34:54 +0000 @@ -2923,7 +2923,7 @@ char *title, *p; if (!SYMBOLP (modes[i])) - abort (); + emacs_abort (); p = title = alloca (42 + SCHARS (SYMBOL_NAME (modes[i]))); *p++ = '\f'; === modified file 'src/lisp.h' --- src/lisp.h 2012-09-02 17:10:35 +0000 +++ src/lisp.h 2012-09-04 17:34:54 +0000 @@ -2288,7 +2288,7 @@ #define UNGCPRO \ ((--gcpro_level != gcpro1.level) \ - ? (abort (), 0) \ + ? (emacs_abort (), 0) \ : ((gcprolist = gcpro1.next), 0)) #endif /* DEBUG_GCPRO */ @@ -3412,6 +3412,7 @@ extern EMACS_INT get_random (void); extern void seed_random (void *, ptrdiff_t); extern void init_random (void); +extern _Noreturn void emacs_abort (void) NO_INLINE; extern int emacs_open (const char *, int, int); extern int emacs_close (int); extern ptrdiff_t emacs_read (int, char *, ptrdiff_t); === modified file 'src/lread.c' --- src/lread.c 2012-09-02 16:56:31 +0000 +++ src/lread.c 2012-09-04 17:34:54 +0000 @@ -1694,7 +1694,7 @@ /* We assume START is nil when input is not from a buffer. */ if (! NILP (start) && !b) - abort (); + emacs_abort (); specbind (Qstandard_input, readcharfun); /* GCPROs readcharfun. */ specbind (Qcurrent_load_list, Qnil); @@ -3671,7 +3671,7 @@ /* Creating a non-pure string from a string literal not implemented yet. We could just use make_string here and live with the extra copy. */ - abort (); + emacs_abort (); return Fintern (make_pure_c_string (str, len), obarray); } === modified file 'src/marker.c' --- src/marker.c 2012-07-29 11:20:43 +0000 +++ src/marker.c 2012-09-04 17:34:54 +0000 @@ -59,7 +59,7 @@ bytepos - BUF_BEG_BYTE (b)); if (charpos - 1 != nchars) - abort (); + emacs_abort (); } #else /* not MARKER_DEBUG */ @@ -67,7 +67,7 @@ #define byte_char_debug_check(b, charpos, bytepos) do { } while (0) #endif /* MARKER_DEBUG */ - + void clear_charpos_cache (struct buffer *b) { @@ -142,7 +142,7 @@ ptrdiff_t best_below, best_below_byte; if (charpos < BUF_BEG (b) || charpos > BUF_Z (b)) - abort (); + emacs_abort (); best_above = BUF_Z (b); best_above_byte = BUF_Z_BYTE (b); @@ -296,7 +296,7 @@ ptrdiff_t best_below, best_below_byte; if (bytepos < BUF_BEG_BYTE (b) || bytepos > BUF_Z_BYTE (b)) - abort (); + emacs_abort (); best_above = BUF_Z (b); best_above_byte = BUF_Z_BYTE (b); @@ -506,7 +506,7 @@ else { register ptrdiff_t charpos, bytepos; - + CHECK_NUMBER_COERCE_MARKER (position); charpos = clip_to_bounds (restricted ? BUF_BEGV (b) : BUF_BEG (b), XINT (position), @@ -570,8 +570,8 @@ if (b) { - attach_marker - (m, b, + attach_marker + (m, b, clip_to_bounds (BUF_BEGV (b), charpos, BUF_ZV (b)), clip_to_bounds (BUF_BEGV_BYTE (b), bytepos, BUF_ZV_BYTE (b))); } @@ -605,12 +605,12 @@ { if (*prev == BUF_MARKERS (b)) { - /* Deleting first marker from the buffer's chain. Crash + /* Deleting first marker from the buffer's chain. Crash if new first marker in chain does not say it belongs to the same buffer, or at least that they have the same base buffer. */ if (tail->next && b->text != tail->next->buffer->text) - abort (); + emacs_abort (); } *prev = tail->next; /* We have removed the marker from the chain; === modified file 'src/menu.c' --- src/menu.c 2012-09-01 06:38:52 +0000 +++ src/menu.c 2012-09-04 17:34:54 +0000 @@ -733,7 +733,7 @@ /* All items should be contained in panes. */ if (panes_seen == 0) - abort (); + emacs_abort (); item_name = AREF (menu_items, i + MENU_ITEMS_ITEM_NAME); enable = AREF (menu_items, i + MENU_ITEMS_ITEM_ENABLE); @@ -807,7 +807,7 @@ else if (EQ (type, QCtoggle)) wv->button_type = BUTTON_TYPE_TOGGLE; else - abort (); + emacs_abort (); wv->selected = !NILP (selected); if (! STRINGP (help)) === modified file 'src/minibuf.c' --- src/minibuf.c 2012-09-02 16:56:31 +0000 +++ src/minibuf.c 2012-09-04 17:34:54 +0000 @@ -110,7 +110,7 @@ /* I don't think that any frames may validly have a null minibuffer window anymore. */ if (NILP (sf->minibuffer_window)) - abort (); + emacs_abort (); /* Under X, we come here with minibuf_window being the minibuffer window of the unused termcap window created in === modified file 'src/msdos.c' --- src/msdos.c 2012-09-02 17:10:35 +0000 +++ src/msdos.c 2012-09-04 17:34:54 +0000 @@ -796,7 +796,7 @@ /* The default face for the frame should always be realized and cached. */ if (!fp) - abort (); + emacs_abort (); } screen_face = face; fg = fp->foreground; @@ -1393,7 +1393,7 @@ static void IT_delete_glyphs (struct frame *f, int n) { - abort (); + emacs_abort (); } /* set-window-configuration on window.c needs this. */ @@ -3013,7 +3013,7 @@ const char *p; if (!enable) - abort (); + emacs_abort (); IT_menu_make_room (menu); menu->submenu[menu->count] = IT_menu_create (); @@ -4119,7 +4119,7 @@ FD_ZERO (efds); if (nfds != 1) - abort (); + emacs_abort (); /* If we are looking only for the terminal, with no timeout, just read it and wait -- that's more efficient. */ @@ -4214,26 +4214,8 @@ } #endif -#ifdef abort -#undef abort -void -dos_abort (char *file, int line) -{ - char buffer1[200], buffer2[400]; - int i, j; - - sprintf (buffer1, "", file, line); - for (i = j = 0; buffer1[i]; i++) { - buffer2[j++] = buffer1[i]; - buffer2[j++] = 0x70; - } - dosmemput (buffer2, j, (int)ScreenPrimary); - ScreenSetCursor (2, 0); - abort (); -} -#else -void -abort (void) +void +emacs_abort (void) { dos_ttcooked (); ScreenSetCursor (10, 0); @@ -4249,7 +4231,6 @@ #endif /* __DJGPP_MINOR__ >= 2 */ exit (2); } -#endif void syms_of_msdos (void) === modified file 'src/nsfont.m' --- src/nsfont.m 2012-08-19 00:53:29 +0000 +++ src/nsfont.m 2012-09-04 17:34:54 +0000 @@ -1330,7 +1330,7 @@ font_info->glyphs[block] = xmalloc (0x100 * sizeof (unsigned short)); if (!unichars || !(font_info->glyphs[block])) - abort (); + emacs_abort (); /* create a string containing all Unicode characters in this block */ for (idx = block<<8, i = 0; i < 0x100; idx++, i++) @@ -1405,7 +1405,7 @@ font_info->metrics[block] = xzalloc (0x100 * sizeof (struct font_metrics)); if (!(font_info->metrics[block])) - abort (); + emacs_abort (); metrics = font_info->metrics[block]; for (g = block<<8, i =0; i<0x100 && g < numGlyphs; g++, i++, metrics++) === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-08-28 16:05:17 +0000 +++ src/nsmenu.m 2012-09-04 17:34:54 +0000 @@ -948,7 +948,7 @@ else if (EQ (type, QCradio)) wv->button_type = BUTTON_TYPE_RADIO; else - abort (); + emacs_abort (); wv->selected = !NILP (selected); === modified file 'src/nsterm.m' --- src/nsterm.m 2012-08-28 16:01:59 +0000 +++ src/nsterm.m 2012-09-04 17:34:54 +0000 @@ -3340,7 +3340,7 @@ break; default: - abort (); + emacs_abort (); } /* Draw box if not done already. */ @@ -3475,7 +3475,7 @@ if (++apploopnr != 1) { - abort (); + emacs_abort (); } [NSApp run]; --apploopnr; @@ -3515,7 +3515,7 @@ [outerpool release]; outerpool = [[NSAutoreleasePool alloc] init]; - + send_appdefined = YES; if (nr > 0) { @@ -3568,7 +3568,7 @@ emacs_event = &event; if (++apploopnr != 1) { - abort(); + emacs_abort (); } [NSApp run]; --apploopnr; @@ -3586,7 +3586,7 @@ { int t; if ([ev type] != NSApplicationDefined) - abort (); + emacs_abort (); t = [ev data1]; last_appdefined_event = 0; @@ -4053,7 +4053,7 @@ { fprintf (stderr, "Failed to create pipe: %s\n", emacs_strerror (errno)); - abort (); + emacs_abort (); } fcntl (selfds[0], F_SETFL, O_NONBLOCK|fcntl (selfds[0], F_GETFL)); @@ -4273,7 +4273,7 @@ } else // force a stack trace to happen { - abort(); + emacs_abort (); } } @@ -4534,10 +4534,10 @@ /* Don't open files from the command line unconditionally, Cocoa parses the command line wrong, --option value tries to open value if --option is the last option. */ - while ((file = [files nextObject]) != nil) + while ((file = [files nextObject]) != nil) if (ns_do_open_file || not_in_argv (file)) [ns_pending_files addObject: file]; - + [self replyToOpenOrPrint: NSApplicationDelegateReplySuccess]; } @@ -4604,7 +4604,7 @@ /* NSTRACE (fd_handler); */ - for (;;) + for (;;) { [pool release]; pool = [[NSAutoreleasePool alloc] init]; @@ -4889,7 +4889,7 @@ is_right_key = (flags & NSRightCommandKeyMask) == NSRightCommandKeyMask; is_left_key = (flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask || (! is_right_key && (flags & NSCommandKeyMask) == NSCommandKeyMask); - + if (is_right_key) emacs_event->modifiers |= parse_solitary_modifier (EQ (ns_right_command_modifier, Qleft) @@ -5853,7 +5853,7 @@ NSTRACE (menuDown); if (context_menu_value == -1) context_menu_value = [sender tag]; - else + else { NSInteger tag = [sender tag]; find_and_call_menu_selection (emacsframe, emacsframe->menu_bar_items_used, @@ -6180,7 +6180,7 @@ Lisp_Object str = Qnil; struct frame *f = SELECTED_FRAME (); struct buffer *curbuf = XBUFFER (XWINDOW (f->selected_window)->buffer); - + if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) return NSAccessibilityTextFieldRole; @@ -6193,13 +6193,13 @@ { if (! NILP (BVAR (curbuf, mark_active))) str = ns_get_local_selection (QPRIMARY, QUTF8_STRING); - + if (NILP (str)) { ptrdiff_t start_byte = BUF_BEGV_BYTE (curbuf); ptrdiff_t byte_range = BUF_ZV_BYTE (curbuf) - start_byte; ptrdiff_t range = BUF_ZV (curbuf) - BUF_BEGV (curbuf); - + if (! NILP (BVAR (curbuf, enable_multibyte_characters))) str = make_uninit_multibyte_string (range, byte_range); else @@ -6209,9 +6209,9 @@ memcpy (SDATA (str), BYTE_POS_ADDR (start_byte), byte_range); } } - - - if (! NILP (str)) + + + if (! NILP (str)) { if (CONSP (str) && SYMBOLP (XCAR (str))) { @@ -6226,7 +6226,7 @@ return nsStr; } } - + return [super accessibilityAttributeValue:attribute]; } #endif /* NS_IMPL_COCOA */ === modified file 'src/print.c' --- src/print.c 2012-08-28 06:20:08 +0000 +++ src/print.c 2012-09-04 17:34:54 +0000 @@ -2060,7 +2060,7 @@ { int len; /* We're in trouble if this happens! - Probably should just abort () */ + Probably should just emacs_abort (). */ strout ("#ai_addrlen); datagram_address[s].len = lres->ai_addrlen; if (is_server) @@ -3973,7 +3973,7 @@ FD_CLR (inchannel, &connect_wait_mask); FD_CLR (inchannel, &write_mask); if (--num_pending_connects < 0) - abort (); + emacs_abort (); } #endif if (inchannel == max_process_desc) @@ -4752,7 +4752,7 @@ Cleanup occurs c/o status_notify after SIGCLD. */ no_avail = 1; /* Cannot depend on values returned */ #else - abort (); + emacs_abort (); #endif } else @@ -4993,7 +4993,7 @@ FD_CLR (channel, &connect_wait_mask); FD_CLR (channel, &write_mask); if (--num_pending_connects < 0) - abort (); + emacs_abort (); proc = chan_process[channel]; if (NILP (proc)) @@ -6354,7 +6354,7 @@ #endif /* not HAVE_SHUTDOWN */ new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0); if (new_outfd < 0) - abort (); + emacs_abort (); old_outfd = XPROCESS (proc)->outfd; if (!proc_encode_coding_system[new_outfd]) === modified file 'src/ralloc.c' --- src/ralloc.c 2012-08-28 16:01:59 +0000 +++ src/ralloc.c 2012-09-04 17:34:54 +0000 @@ -237,7 +237,7 @@ } if (! heap) - abort (); + emacs_abort (); /* If we can't fit SIZE bytes in that heap, try successive later heaps. */ @@ -330,7 +330,7 @@ /* This heap should have no blocs in it. */ if (last_heap->first_bloc != NIL_BLOC || last_heap->last_bloc != NIL_BLOC) - abort (); + emacs_abort (); /* Return the last heap, with its header, to the system. */ excess = (char *)last_heap->end - (char *)last_heap->start; @@ -355,7 +355,7 @@ which returns the entire last heap to the system, seems unlikely to trigger this mode of failure. */ if (last_heap->end != (*real_morecore) (0)) - abort (); + emacs_abort (); } } } @@ -452,7 +452,7 @@ /* No need to ever call this if arena is frozen, bug somewhere! */ if (r_alloc_freeze_level) - abort (); + emacs_abort (); while (b) { @@ -576,7 +576,7 @@ /* No need to ever call this if arena is frozen, bug somewhere! */ if (r_alloc_freeze_level) - abort (); + emacs_abort (); if (bloc == NIL_BLOC || size == bloc->size) return 1; @@ -588,7 +588,7 @@ } if (heap == NIL_HEAP) - abort (); + emacs_abort (); old_size = bloc->size; bloc->size = size; @@ -937,7 +937,7 @@ dead_bloc = find_bloc (ptr); if (dead_bloc == NIL_BLOC) - abort (); /* Double free? PTR not originally used to allocate? */ + emacs_abort (); /* Double free? PTR not originally used to allocate? */ free_bloc (dead_bloc); *ptr = 0; @@ -979,7 +979,7 @@ bloc = find_bloc (ptr); if (bloc == NIL_BLOC) - abort (); /* Already freed? PTR not originally used to allocate? */ + emacs_abort (); /* Already freed? PTR not originally used to allocate? */ if (size < bloc->size) { @@ -1152,7 +1152,7 @@ } if (bloc == NIL_BLOC || bloc->variable != old) - abort (); /* Already freed? OLD not originally used to allocate? */ + emacs_abort (); /* Already freed? OLD not originally used to allocate? */ /* Update variable to point to the new location. */ bloc->variable = new; @@ -1193,7 +1193,7 @@ first_heap->start = first_heap->bloc_start = virtual_break_value = break_value = (*real_morecore) (0); if (break_value == NIL) - abort (); + emacs_abort (); extra_bytes = ROUNDUP (50000); #endif === modified file 'src/region-cache.c' --- src/region-cache.c 2012-08-15 16:21:41 +0000 +++ src/region-cache.c 2012-09-04 17:34:54 +0000 @@ -194,7 +194,7 @@ if (BOUNDARY_POS (c, low) > pos || (low + 1 < c->cache_len && BOUNDARY_POS (c, low + 1) <= pos)) - abort (); + emacs_abort (); return low; } @@ -217,12 +217,12 @@ if (pos < 0 || pos > c->cache_len) - abort (); + emacs_abort (); /* We mustn't ever try to put the gap before the dummy start boundary. That must always be start-relative. */ if (pos == 0) - abort (); + emacs_abort (); /* Need we move the gap right? */ while (gap_start < pos) @@ -291,24 +291,24 @@ { /* i must be a valid cache index. */ if (i < 0 || i > c->cache_len) - abort (); + emacs_abort (); /* We must never want to insert something before the dummy first boundary. */ if (i == 0) - abort (); + emacs_abort (); /* We must only be inserting things in order. */ if (! (BOUNDARY_POS (c, i - 1) < pos && (i == c->cache_len || pos < BOUNDARY_POS (c, i)))) - abort (); + emacs_abort (); /* The value must be different from the ones around it. However, we temporarily create boundaries that establish the same value as the subsequent boundary, so we're not going to flag that case. */ if (BOUNDARY_VALUE (c, i - 1) == value) - abort (); + emacs_abort (); move_cache_gap (c, i, 1); @@ -331,16 +331,16 @@ /* Gotta be in range. */ if (start < 0 || end > c->cache_len) - abort (); + emacs_abort (); /* Gotta be in order. */ if (start > end) - abort (); + emacs_abort (); /* Can't delete the dummy entry. */ if (start == 0 && end >= 1) - abort (); + emacs_abort (); /* Minimize gap motion. If we're deleting nothing, do nothing. */ if (len == 0) @@ -380,10 +380,10 @@ ptrdiff_t start, ptrdiff_t end, int value) { if (start > end) - abort (); + emacs_abort (); if (start < c->buffer_beg || end > c->buffer_end) - abort (); + emacs_abort (); /* Eliminate this case; then we can assume that start and end-1 are both the locations of real characters in the buffer. */ === modified file 'src/scroll.c' --- src/scroll.c 2012-07-05 18:35:48 +0000 +++ src/scroll.c 2012-09-04 17:34:54 +0000 @@ -195,13 +195,13 @@ { cost = p1->writecost + first_insert_cost[i]; if ((int) p1->insertcount > i) - abort (); + emacs_abort (); cost1 = p1->insertcost + next_insert_cost[i - p1->insertcount]; } p->insertcost = min (cost, cost1) + draw_cost[i] + extra_cost; p->insertcount = (cost < cost1) ? 1 : p1->insertcount + 1; if ((int) p->insertcount > i) - abort (); + emacs_abort (); /* Calculate the cost if we do a delete line after outputting this line. === modified file 'src/search.c' --- src/search.c 2012-08-17 17:08:30 +0000 +++ src/search.c 2012-09-04 17:34:54 +0000 @@ -1009,7 +1009,7 @@ if (!EQ (noerror, Qt)) { if (lim < BEGV || lim > ZV) - abort (); + emacs_abort (); SET_PT_BOTH (lim, lim_byte); return Qnil; #if 0 /* This would be clean, but maybe programs depend on @@ -1022,7 +1022,7 @@ } if (np < BEGV || np > ZV) - abort (); + emacs_abort (); SET_PT (np); @@ -2770,7 +2770,7 @@ } else /* last_thing_searched must always be Qt, a buffer, or Qnil. */ - abort (); + emacs_abort (); len = 2 * i + 2; } === modified file 'src/sound.c' --- src/sound.c 2012-07-29 08:18:29 +0000 +++ src/sound.c 2012-09-04 17:34:54 +0000 @@ -843,7 +843,7 @@ } } else - abort (); + emacs_abort (); } @@ -1138,7 +1138,7 @@ } } else - abort (); + emacs_abort (); } === modified file 'src/sysdep.c' --- src/sysdep.c 2012-09-01 01:13:50 +0000 +++ src/sysdep.c 2012-09-04 17:34:54 +0000 @@ -1856,6 +1856,15 @@ } #endif +#ifndef HAVE_NTGUI +/* Using emacs_abort lets GDB return from a breakpoint here. */ +void +emacs_abort (void) +{ + abort (); +} +#endif + int emacs_open (const char *path, int oflag, int mode) { === modified file 'src/term.c' --- src/term.c 2012-08-31 10:53:19 +0000 +++ src/term.c 2012-09-04 17:34:54 +0000 @@ -1498,7 +1498,7 @@ { glyph->resolved_level = it->bidi_it.resolved_level; if ((it->bidi_it.type & 7) != it->bidi_it.type) - abort (); + emacs_abort (); glyph->bidi_type = it->bidi_it.type; } else @@ -1695,7 +1695,7 @@ { glyph->resolved_level = it->bidi_it.resolved_level; if ((it->bidi_it.type & 7) != it->bidi_it.type) - abort (); + emacs_abort (); glyph->bidi_type = it->bidi_it.type; } else @@ -1780,7 +1780,7 @@ { glyph->resolved_level = it->bidi_it.resolved_level; if ((it->bidi_it.type & 7) != it->bidi_it.type) - abort (); + emacs_abort (); glyph->bidi_type = it->bidi_it.type; } else @@ -2250,7 +2250,7 @@ struct terminal *t; if (!name) - abort (); + emacs_abort (); for (t = terminal_list; t; t = t->next_terminal) { @@ -2798,7 +2798,7 @@ struct tty_output *t = xzalloc (sizeof *t); if (! FRAME_TERMCAP_P (f)) - abort (); + emacs_abort (); t->display_info = FRAME_TERMINAL (f)->display_info.tty; @@ -2811,7 +2811,7 @@ tty_free_frame_resources (struct frame *f) { if (! FRAME_TERMCAP_P (f)) - abort (); + emacs_abort (); if (FRAME_FACE_CACHE (f)) free_frame_faces (f); @@ -2827,7 +2827,7 @@ tty_free_frame_resources (struct frame *f) { if (! FRAME_TERMCAP_P (f) && ! FRAME_MSDOS_P (f)) - abort (); + emacs_abort (); if (FRAME_FACE_CACHE (f)) free_frame_faces (f); @@ -3108,7 +3108,7 @@ #ifndef TERMINFO if (strlen (tty->termcap_term_buffer) >= buffer_size) - abort (); + emacs_abort (); buffer_size = strlen (tty->termcap_term_buffer); #endif tty->termcap_strings_buffer = area = xmalloc (buffer_size); @@ -3467,7 +3467,7 @@ verror (str1, ap); va_end (ap); - abort (); + emacs_abort (); } void @@ -3494,7 +3494,7 @@ return; if (terminal->type != output_termcap) - abort (); + emacs_abort (); tty = terminal->display_info.tty; @@ -3508,7 +3508,7 @@ if (! p) /* This should not happen. */ - abort (); + emacs_abort (); p->next = tty->next; tty->next = 0; === modified file 'src/termchar.h' --- src/termchar.h 2012-06-09 16:44:44 +0000 +++ src/termchar.h 2012-09-04 17:34:54 +0000 @@ -207,6 +207,6 @@ (((f)->output_method == output_termcap \ || (f)->output_method == output_msdos_raw) \ ? (f)->terminal->display_info.tty \ - : (abort (), (struct tty_display_info *) 0)) + : (emacs_abort (), (struct tty_display_info *) 0)) #define CURTTY() FRAME_TTY (SELECTED_FRAME()) === modified file 'src/terminal.c' --- src/terminal.c 2012-08-18 00:07:52 +0000 +++ src/terminal.c 2012-09-04 17:34:54 +0000 @@ -294,7 +294,7 @@ for (tp = &terminal_list; *tp != terminal; tp = &(*tp)->next_terminal) if (! *tp) - abort (); + emacs_abort (); *tp = terminal->next_terminal; xfree (terminal->keyboard_coding); @@ -411,7 +411,7 @@ case output_ns: return Qns; default: - abort (); + emacs_abort (); } } @@ -519,7 +519,7 @@ init_initial_terminal (void) { if (initialized || terminal_list || tty_list) - abort (); + emacs_abort (); initial_terminal = create_terminal (); initial_terminal->type = output_initial; @@ -538,7 +538,7 @@ delete_initial_terminal (struct terminal *terminal) { if (terminal != initial_terminal) - abort (); + emacs_abort (); delete_terminal (terminal); initial_terminal = NULL; === modified file 'src/terminfo.c' --- src/terminfo.c 2012-01-19 07:21:25 +0000 +++ src/terminfo.c 2012-09-04 17:34:54 +0000 @@ -46,7 +46,7 @@ /* Emacs always should pass a null OUTSTRING and zero LEN. */ if (outstring || len) - abort (); + emacs_abort (); temp = tparm (string, arg1, arg2, arg3, arg4); return xstrdup (temp); === modified file 'src/tparam.c' --- src/tparam.c 2012-07-05 06:32:41 +0000 +++ src/tparam.c 2012-09-04 17:34:54 +0000 @@ -247,7 +247,7 @@ break; default: - abort (); + emacs_abort (); } } else === modified file 'src/w32.c' --- src/w32.c 2012-09-02 17:10:35 +0000 +++ src/w32.c 2012-09-04 17:34:54 +0000 @@ -1273,9 +1273,9 @@ /* Ensure HOME and SHELL are defined. */ if (getenv ("HOME") == NULL) - abort (); + emacs_abort (); if (getenv ("SHELL") == NULL) - abort (); + emacs_abort (); /* Set dir and shell from environment variables. */ strcpy (dflt_passwd.pw_dir, getenv ("HOME")); @@ -1788,9 +1788,9 @@ char modname[MAX_PATH]; if (!GetModuleFileName (NULL, modname, MAX_PATH)) - abort (); + emacs_abort (); if ((p = strrchr (modname, '\\')) == NULL) - abort (); + emacs_abort (); *p = 0; if ((p = strrchr (modname, '\\')) && xstrcasecmp (p, "\\bin") == 0) @@ -1902,13 +1902,13 @@ /* FIXME: Do we need to resolve possible symlinks in startup_dir? Does it matter anywhere in Emacs? */ if (!GetCurrentDirectory (MAXPATHLEN, startup_dir)) - abort (); + emacs_abort (); { static char modname[MAX_PATH]; if (!GetModuleFileName (NULL, modname, MAX_PATH)) - abort (); + emacs_abort (); argv[0] = modname; } @@ -1930,7 +1930,7 @@ p = getenv ("emacs_dir"); if (p == NULL) - abort (); + emacs_abort (); strcpy (root_dir, p); root_dir[parse_root (root_dir, NULL)] = '\0'; dostounix_filename (root_dir); @@ -3287,7 +3287,7 @@ doesn't resolve aliasing due to subst commands, or recognize hard links. */ if (!w32_get_long_filename ((char *)name, fullname, MAX_PATH)) - abort (); + emacs_abort (); parse_root (fullname, &p); /* Normal W32 filesystems are still case insensitive. */ @@ -5587,7 +5587,7 @@ if (fd_info[ fd ].cp != NULL) { DebPrint (("sys_socket: fd_info[%d] apparently in use!\n", fd)); - abort (); + emacs_abort (); } fd_info[ fd ].cp = cp; @@ -5966,7 +5966,7 @@ { if (fd_info[fd].flags & FILE_SOCKET) { - if (winsock_lib == NULL) abort (); + if (winsock_lib == NULL) emacs_abort (); pfn_shutdown (SOCK_HANDLE (fd), 2); rc = pfn_closesocket (SOCK_HANDLE (fd)); @@ -6084,7 +6084,7 @@ || (fd_info[fd].flags & FILE_READ) == 0) { DebPrint (("_sys_read_ahead: internal error: fd %d is not a pipe, serial port, or socket!\n", fd)); - abort (); + emacs_abort (); } cp->status = STATUS_READ_IN_PROGRESS; @@ -6220,7 +6220,7 @@ /* re-read CR carried over from last read */ if (fd_info[fd].flags & FILE_LAST_CR) { - if (fd_info[fd].flags & FILE_BINARY) abort (); + if (fd_info[fd].flags & FILE_BINARY) emacs_abort (); *buffer++ = 0x0d; count--; nchars++; @@ -6323,7 +6323,7 @@ } else /* FILE_SOCKET */ { - if (winsock_lib == NULL) abort (); + if (winsock_lib == NULL) emacs_abort (); /* do the equivalent of a non-blocking read */ pfn_ioctlsocket (SOCK_HANDLE (fd), FIONREAD, &waiting); @@ -6474,7 +6474,7 @@ else if (fd < MAXDESC && fd_info[fd].flags & FILE_SOCKET) { unsigned long nblock = 0; - if (winsock_lib == NULL) abort (); + if (winsock_lib == NULL) emacs_abort (); /* TODO: implement select() properly so non-blocking I/O works. */ /* For now, make sure the write blocks. */ @@ -6640,8 +6640,7 @@ buffer, "Emacs Abort Dialog", MB_OK | MB_ICONEXCLAMATION | MB_TASKMODAL); - /* Use the low-level Emacs abort. */ -#undef abort + /* Use the low-level system abort. */ abort (); } else === modified file 'src/w32fns.c' --- src/w32fns.c 2012-09-01 08:22:10 +0000 +++ src/w32fns.c 2012-09-04 17:34:54 +0000 @@ -2280,7 +2280,7 @@ CoInitialize (NULL); w32_createwindow ((struct frame *) msg.wParam); if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) - abort (); + emacs_abort (); break; case WM_EMACS_SETLOCALE: SetThreadLocale (msg.wParam); @@ -2290,7 +2290,7 @@ result = (int) ActivateKeyboardLayout ((HKL) msg.wParam, 0); if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, result, 0)) - abort (); + emacs_abort (); break; case WM_EMACS_REGISTER_HOT_KEY: focus_window = GetFocus (); @@ -2311,7 +2311,7 @@ GC. */ XSETCAR ((Lisp_Object) ((EMACS_INT) msg.lParam), Qnil); if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) - abort (); + emacs_abort (); break; case WM_EMACS_TOGGLE_LOCK_KEY: { @@ -2343,7 +2343,7 @@ } if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, cur_state, 0)) - abort (); + emacs_abort (); } break; #ifdef MSG_DEBUG @@ -2398,11 +2398,11 @@ { /* Only input thread can send deferred messages. */ if (GetCurrentThreadId () != dwWindowsThreadId) - abort (); + emacs_abort (); /* It is an error to send a message that is already deferred. */ if (find_deferred_msg (hwnd, msg) != NULL) - abort (); + emacs_abort (); /* Enforced synchronization is not needed because this is the only function that alters deferred_msg_head, and the following critical @@ -2475,7 +2475,7 @@ PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE); if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) - abort (); + emacs_abort (); memset (&dummy_buf, 0, sizeof (dummy_buf)); dummy_buf.w32msg.msg.hwnd = NULL; @@ -3136,7 +3136,7 @@ msg = WM_MBUTTONUP; button_state &= ~MMOUSE; - if (button_state) abort (); + if (button_state) emacs_abort (); } else return 0; @@ -3367,7 +3367,7 @@ /* Detect if message has already been deferred; in this case we cannot return any sensible value to ignore this. */ if (find_deferred_msg (hwnd, msg) != NULL) - abort (); + emacs_abort (); menubar_in_use = 1; @@ -3842,7 +3842,7 @@ MSG msg; if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW, (WPARAM)f, 0)) - abort (); + emacs_abort (); GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); } @@ -6287,7 +6287,7 @@ lisp_modifiers = XINT (Fcar (Fcdr (c))); c = Fcar (c); if (!SYMBOLP (c)) - abort (); + emacs_abort (); vk_code = lookup_vk_code (SDATA (SYMBOL_NAME (c))); } else if (INTEGERP (c)) @@ -7194,10 +7194,8 @@ syms_of_w32uniscribe (); } -#undef abort - void -w32_abort (void) +emacs_abort (void) { int button; button = MessageBox (NULL, === modified file 'src/w32menu.c' --- src/w32menu.c 2012-08-28 16:01:59 +0000 +++ src/w32menu.c 2012-09-04 17:34:54 +0000 @@ -820,7 +820,7 @@ else if (EQ (type, QCradio)) wv->button_type = BUTTON_TYPE_RADIO; else - abort (); + emacs_abort (); wv->selected = !NILP (selected); === modified file 'src/w32proc.c' --- src/w32proc.c 2012-08-02 04:14:48 +0000 +++ src/w32proc.c 2012-09-04 17:34:54 +0000 @@ -176,7 +176,7 @@ /* Should not be deleting a child that is still needed. */ for (i = 0; i < MAXDESC; i++) if (fd_info[i].cp == cp) - abort (); + emacs_abort (); if (!CHILD_ACTIVE (cp)) return; @@ -316,7 +316,7 @@ DWORD flags; char dir[ MAXPATHLEN ]; - if (cp == NULL) abort (); + if (cp == NULL) emacs_abort (); memset (&start, 0, sizeof (start)); start.cb = sizeof (start); @@ -405,7 +405,7 @@ if (fd_info[fd].cp != NULL) { DebPrint (("register_child: fd_info[%d] apparently in use!\n", fd)); - abort (); + emacs_abort (); } fd_info[fd].cp = cp; @@ -459,7 +459,7 @@ /* We want to wait for a specific child */ wait_hnd[nh] = dead_child->procinfo.hProcess; cps[nh] = dead_child; - if (!wait_hnd[nh]) abort (); + if (!wait_hnd[nh]) emacs_abort (); nh++; active = 0; goto get_result; @@ -507,7 +507,7 @@ active -= WAIT_ABANDONED_0; } else - abort (); + emacs_abort (); get_result: if (!GetExitCodeProcess (wait_hnd[active], &retval)) @@ -1189,7 +1189,7 @@ #endif wait_hnd[nh] = cp->char_avail; fdindex[nh] = i; - if (!wait_hnd[nh]) abort (); + if (!wait_hnd[nh]) emacs_abort (); nh++; #ifdef FULL_DEBUG DebPrint (("select waiting on child %d fd %d\n", @@ -1276,7 +1276,7 @@ active -= WAIT_ABANDONED_0; } else - abort (); + emacs_abort (); /* Loop over all handles after active (now officially documented as being the first signaled handle in the array). We do this to === modified file 'src/w32select.c' --- src/w32select.c 2012-07-29 08:18:29 +0000 +++ src/w32select.c 2012-09-04 17:34:54 +0000 @@ -394,7 +394,7 @@ BLOCK_INPUT; - /* Fsignal calls abort() if it sees that waiting_for_input is + /* Fsignal calls emacs_abort () if it sees that waiting_for_input is set. */ owfi = waiting_for_input; waiting_for_input = 0; === modified file 'src/w32term.c' --- src/w32term.c 2012-08-18 01:42:52 +0000 +++ src/w32term.c 2012-09-04 17:34:54 +0000 @@ -2426,7 +2426,7 @@ break; default: - abort (); + emacs_abort (); } if (!s->for_overlaps) @@ -2626,7 +2626,7 @@ if (! FRAME_W32_P (f)) return; - abort (); + emacs_abort (); } @@ -2709,7 +2709,7 @@ if (! FRAME_W32_P (f)) return; - abort (); + emacs_abort (); } @@ -3431,7 +3431,7 @@ frame = XCAR (tail); /* All elements of Vframe_list should be frames. */ if (! FRAMEP (frame)) - abort (); + emacs_abort (); /* Scan this frame's scroll bar list for a scroll bar with the right window ID. */ @@ -3854,7 +3854,7 @@ /* We can't redeem this window's scroll bar if it doesn't have one. */ if (NILP (window->vertical_scroll_bar)) - abort (); + emacs_abort (); bar = XSCROLL_BAR (window->vertical_scroll_bar); @@ -3873,7 +3873,7 @@ else /* If its prev pointer is nil, it must be at the front of one or the other! */ - abort (); + emacs_abort (); } else XSCROLL_BAR (bar->prev)->next = bar->next; @@ -3928,7 +3928,7 @@ struct input_event *emacs_event) { if (! WINDOWP (bar->window)) - abort (); + emacs_abort (); emacs_event->kind = SCROLL_BAR_CLICK_EVENT; emacs_event->code = 0; @@ -5233,7 +5233,7 @@ break; default: - abort (); + emacs_abort (); } } } === modified file 'src/w32xfns.c' --- src/w32xfns.c 2012-09-01 06:38:52 +0000 +++ src/w32xfns.c 2012-09-04 17:34:54 +0000 @@ -122,7 +122,7 @@ HDC hdc; if (f->output_method != output_w32) - abort (); + emacs_abort (); enter_crit (); === modified file 'src/widget.c' --- src/widget.c 2012-09-02 16:56:31 +0000 +++ src/widget.c 2012-09-04 17:34:54 +0000 @@ -226,7 +226,7 @@ static void mark_shell_size_user_specified (Widget wmshell) { - if (! XtIsWMShell (wmshell)) abort (); + if (! XtIsWMShell (wmshell)) emacs_abort (); /* This is kind of sleazy, but I can't see how else to tell it to make it mark the WM_SIZE_HINTS size as user specified when appropriate. */ ((WMShellWidget) wmshell)->wm.size_hints.flags |= USSize; @@ -290,7 +290,7 @@ Widget wmshell = get_wm_shell ((Widget) ew); /* Each Emacs shell is now independent and top-level. */ - if (! XtIsSubclass (wmshell, shellWidgetClass)) abort (); + if (! XtIsSubclass (wmshell, shellWidgetClass)) emacs_abort (); /* We don't need this for the moment. The geometry is computed in xfns.c. */ @@ -677,8 +677,8 @@ EmacsFrame ew = (EmacsFrame) widget; struct frame* s = ew->emacs_frame.frame; - if (! s) abort (); - if (! s->output_data.x) abort (); + if (! s) emacs_abort (); + if (! s->output_data.x) emacs_abort (); BLOCK_INPUT; x_free_gcs (s); === modified file 'src/window.c' --- src/window.c 2012-08-28 16:01:59 +0000 +++ src/window.c 2012-09-04 17:34:54 +0000 @@ -386,7 +386,7 @@ else if (! NILP (XWINDOW (window)->vchild)) window = XWINDOW (window)->vchild; else - abort (); + emacs_abort (); } return window; @@ -1289,7 +1289,7 @@ return Qnil; default: - abort (); + emacs_abort (); } } @@ -1948,7 +1948,7 @@ buf = w->buffer; b = XBUFFER (buf); if (b != XMARKER (w->pointm)->buffer) - abort (); + emacs_abort (); #if 0 if (w == XWINDOW (selected_window) @@ -2669,7 +2669,7 @@ case CHECK_ALL_WINDOWS: if (! NILP (w->buffer) && NILP (BVAR (XBUFFER (w->buffer), name))) - abort (); + emacs_abort (); break; case WINDOW_LOOP_UNUSED: === modified file 'src/xdisp.c' --- src/xdisp.c 2012-09-03 19:36:09 +0000 +++ src/xdisp.c 2012-09-04 17:34:54 +0000 @@ -7306,7 +7306,7 @@ default: /* There are no other methods defined, so this should be a bug. */ - abort (); + emacs_abort (); } eassert (it->method != GET_FROM_STRING @@ -7761,7 +7761,7 @@ compute_stop_pos (it); /* We must advance forward, right? */ if (it->stop_charpos <= charpos) - abort (); + emacs_abort (); } while (charpos > BEGV && it->stop_charpos >= it->end_charpos); @@ -7810,7 +7810,7 @@ compute_stop_pos (it); /* We must advance forward, right? */ if (it->stop_charpos <= it->prev_stop) - abort (); + emacs_abort (); charpos = it->stop_charpos; } while (charpos <= where_we_are); @@ -8898,7 +8898,7 @@ break; default: - abort (); + emacs_abort (); } /* Reset/increment for the next run. */ @@ -10532,7 +10532,7 @@ check_message_stack (void) { if (!NILP (Vmessage_stack)) - abort (); + emacs_abort (); } @@ -14415,7 +14415,7 @@ for (g = row->glyphs[TEXT_AREA], x = row->x; g < glyph; g++) { if (g >= row->glyphs[TEXT_AREA] + row->used[TEXT_AREA]) - abort (); + emacs_abort (); x += g->pixel_width; } } @@ -14536,7 +14536,7 @@ SET_MARKER_FROM_TEXT_POS (w->start, startp); if (current_buffer != XBUFFER (w->buffer)) - abort (); + emacs_abort (); if (!NILP (Vwindow_scroll_functions)) { @@ -15505,9 +15505,9 @@ /* Some sanity checks. */ CHECK_WINDOW_END (w); if (Z == Z_BYTE && CHARPOS (opoint) != BYTEPOS (opoint)) - abort (); + emacs_abort (); if (BYTEPOS (opoint) < CHARPOS (opoint)) - abort (); + emacs_abort (); /* If %c is in mode line, update it if needed. */ if (!NILP (w->column_number_displayed) @@ -15719,7 +15719,7 @@ goto try_to_scroll; default: - abort (); + emacs_abort (); } } /* If current starting point was originally the beginning of a line @@ -15882,7 +15882,7 @@ break; default: - abort (); + emacs_abort (); } } @@ -17330,7 +17330,7 @@ if (row) set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); else - abort (); + emacs_abort (); return 1; } } @@ -17374,7 +17374,7 @@ if (row) set_cursor_from_row (w, row, current_matrix, 0, 0, 0, 0); else - abort (); + emacs_abort (); return 2; } } @@ -17863,7 +17863,7 @@ IF_DEBUG (debug_method_add (w, "C")); } else - abort (); + emacs_abort (); IF_DEBUG (debug_end_pos = XFASTINT (w->window_end_pos); debug_end_vpos = XFASTINT (w->window_end_vpos)); @@ -19240,7 +19240,7 @@ /* A line that is entirely from a string/image/stretch... */ row->maxpos = row->minpos; else - abort (); + emacs_abort (); } else row->maxpos = it->current.pos; @@ -20081,7 +20081,7 @@ return Qright_to_left; break; default: - abort (); + emacs_abort (); } } } @@ -21994,7 +21994,7 @@ { /* Glyph is off the left margin of the display area. Should not happen. */ - abort (); + emacs_abort (); } row->ascent = max (row->ascent, it->max_ascent); @@ -23359,7 +23359,7 @@ break; \ \ default: \ - abort (); \ + emacs_abort (); \ } \ \ if (s) \ @@ -23700,7 +23700,7 @@ { glyph->resolved_level = it->bidi_it.resolved_level; if ((it->bidi_it.type & 7) != it->bidi_it.type) - abort (); + emacs_abort (); glyph->bidi_type = it->bidi_it.type; } else @@ -23774,7 +23774,7 @@ { glyph->resolved_level = it->bidi_it.resolved_level; if ((it->bidi_it.type & 7) != it->bidi_it.type) - abort (); + emacs_abort (); glyph->bidi_type = it->bidi_it.type; } ++it->glyph_row->used[area]; @@ -23953,7 +23953,7 @@ { glyph->resolved_level = it->bidi_it.resolved_level; if ((it->bidi_it.type & 7) != it->bidi_it.type) - abort (); + emacs_abort (); glyph->bidi_type = it->bidi_it.type; } ++it->glyph_row->used[area]; @@ -24014,7 +24014,7 @@ { glyph->resolved_level = it->bidi_it.resolved_level; if ((it->bidi_it.type & 7) != it->bidi_it.type) - abort (); + emacs_abort (); glyph->bidi_type = it->bidi_it.type; } else @@ -24269,7 +24269,7 @@ } } else - abort (); + emacs_abort (); #ifdef HAVE_WINDOW_SYSTEM /* On a GUI frame, when the right fringe (left fringe for R2L rows) @@ -24466,7 +24466,7 @@ { glyph->resolved_level = it->bidi_it.resolved_level; if ((it->bidi_it.type & 7) != it->bidi_it.type) - abort (); + emacs_abort (); glyph->bidi_type = it->bidi_it.type; } ++it->glyph_row->used[area]; === modified file 'src/xfaces.c' --- src/xfaces.c 2012-09-02 16:56:31 +0000 +++ src/xfaces.c 2012-09-04 17:34:54 +0000 @@ -510,7 +510,7 @@ if (color_count[pixel] > 0) --color_count[pixel]; else - abort (); + emacs_abort (); } @@ -727,7 +727,7 @@ if (!FRAME_NS_P (f) || FRAME_NS_WINDOW (f)) #endif if (!realize_basic_faces (f)) - abort (); + emacs_abort (); } @@ -771,7 +771,7 @@ { clear_face_cache (0); if (!realize_basic_faces (f)) - abort (); + emacs_abort (); } } @@ -1108,7 +1108,7 @@ return ns_defined_color (f, color_name, color_def, alloc, 1); #endif else - abort (); + emacs_abort (); } @@ -1304,7 +1304,7 @@ break; default: - abort (); + emacs_abort (); } } #ifdef GLYPH_DEBUG @@ -4548,7 +4548,7 @@ return -1; default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); if (default_face == NULL) - abort (); /* realize_basic_faces must have set it up */ + emacs_abort (); /* realize_basic_faces must have set it up */ } if (! get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) @@ -4591,7 +4591,7 @@ case MENU_FACE_ID: name = Qmenu; break; default: - abort (); /* the caller is supposed to pass us a basic face id */ + emacs_abort (); /* the caller is supposed to pass us a basic face id */ } /* Do a quick scan through Vface_remapping_alist, and return immediately @@ -4712,7 +4712,7 @@ struct face *default_face = FACE_FROM_ID (f, face_id); if (!default_face) - abort (); + emacs_abort (); if (!get_lface_attributes (f, symbol, symbol_attrs, signal_p, 0)) return -1; @@ -5102,7 +5102,7 @@ error ("Cannot realize default face"); def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); if (def_face == NULL) - abort (); /* realize_basic_faces must have set it up */ + emacs_abort (); /* realize_basic_faces must have set it up */ } /* Dispatch to the appropriate handler. */ @@ -5387,7 +5387,7 @@ else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) ASET (lface, LFACE_FOREGROUND_INDEX, build_string (unspecified_fg)); else - abort (); + emacs_abort (); } if (UNSPECIFIEDP (LFACE_BACKGROUND (lface))) @@ -5402,7 +5402,7 @@ else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) ASET (lface, LFACE_BACKGROUND_INDEX, build_string (unspecified_bg)); else - abort (); + emacs_abort (); } if (UNSPECIFIEDP (LFACE_STIPPLE (lface))) @@ -5502,7 +5502,7 @@ face = make_realized_face (attrs); } else - abort (); + emacs_abort (); /* Insert the new face. */ cache_face (cache, face, lface_hash (attrs)); @@ -5597,7 +5597,7 @@ if (default_face) fontset = default_face->fontset; if (fontset == -1) - abort (); + emacs_abort (); } if (! FONT_OBJECT_P (attrs[LFACE_FONT_INDEX])) attrs[LFACE_FONT_INDEX] === modified file 'src/xmenu.c' --- src/xmenu.c 2012-08-17 21:52:15 +0000 +++ src/xmenu.c 2012-09-04 17:34:54 +0000 @@ -169,7 +169,7 @@ int dummy; if (! FRAME_X_P (f)) - abort (); + emacs_abort (); BLOCK_INPUT; @@ -636,7 +636,7 @@ x_activate_menubar (FRAME_PTR f) { if (! FRAME_X_P (f)) - abort (); + emacs_abort (); if (!f->output_data.x->saved_menu_event->type) return; @@ -852,7 +852,7 @@ int columns, rows; if (! FRAME_X_P (f)) - abort (); + emacs_abort (); x = f->output_data.x; @@ -940,7 +940,7 @@ int *submenu_top_level_items, *submenu_n_panes; if (! FRAME_X_P (f)) - abort (); + emacs_abort (); menubar_widget = f->output_data.x->menubar_widget; @@ -1299,7 +1299,7 @@ Widget menubar_widget; if (! FRAME_X_P (f)) - abort (); + emacs_abort (); menubar_widget = f->output_data.x->menubar_widget; @@ -1450,7 +1450,7 @@ #endif if (! FRAME_X_P (f)) - abort (); + emacs_abort (); xg_crazy_callback_abort = 1; menu = xg_create_widget ("popup", first_wv->name, f, first_wv, @@ -1557,7 +1557,7 @@ Widget menu; if (! FRAME_X_P (f)) - abort (); + emacs_abort (); #ifdef USE_LUCID apply_systemfont_to_menu (f, f->output_data.x->widget); @@ -1646,7 +1646,7 @@ ptrdiff_t specpdl_count = SPECPDL_INDEX (); if (! FRAME_X_P (f)) - abort (); + emacs_abort (); *error_name = NULL; @@ -1792,7 +1792,7 @@ else if (EQ (type, QCradio)) wv->button_type = BUTTON_TYPE_RADIO; else - abort (); + emacs_abort (); wv->selected = !NILP (selected); @@ -1930,7 +1930,7 @@ GtkWidget *menu; if (! FRAME_X_P (f)) - abort (); + emacs_abort (); menu = xg_create_widget ("dialog", first_wv->name, f, first_wv, G_CALLBACK (dialog_selection_callback), @@ -1977,7 +1977,7 @@ LWLIB_ID dialog_id; if (!FRAME_X_P (f)) - abort (); + emacs_abort (); dialog_id = widget_id_tick++; #ifdef USE_LUCID @@ -2036,7 +2036,7 @@ ptrdiff_t specpdl_count = SPECPDL_INDEX (); if (! FRAME_X_P (f)) - abort (); + emacs_abort (); *error_name = NULL; @@ -2301,7 +2301,7 @@ ptrdiff_t specpdl_count = SPECPDL_INDEX (); if (! FRAME_X_P (f) && ! FRAME_MSDOS_P (f)) - abort (); + emacs_abort (); *error_name = 0; if (menu_items_n_panes == 0) === modified file 'src/xselect.c' --- src/xselect.c 2012-08-18 00:07:52 +0000 +++ src/xselect.c 2012-09-04 17:34:54 +0000 @@ -193,7 +193,7 @@ x_start_queuing_selection_requests (void) { if (x_queue_selection_requests) - abort (); + emacs_abort (); x_queue_selection_requests++; TRACE1 ("x_start_queuing_selection_requests %d", x_queue_selection_requests); @@ -245,7 +245,7 @@ if (EQ (sym, QEMACS_TMP)) return dpyinfo->Xatom_EMACS_TMP; if (EQ (sym, QTARGETS)) return dpyinfo->Xatom_TARGETS; if (EQ (sym, QNULL)) return dpyinfo->Xatom_NULL; - if (!SYMBOLP (sym)) abort (); + if (!SYMBOLP (sym)) emacs_abort (); TRACE1 (" XInternAtom %s", SSDATA (SYMBOL_NAME (sym))); BLOCK_INPUT; @@ -1138,7 +1138,7 @@ ptrdiff_t count = SPECPDL_INDEX (); if (property_change_reply_object) - abort (); + emacs_abort (); /* Make sure to do unexpect_property_change if we quit or err. */ record_unwind_protect (wait_for_property_change_unwind, === modified file 'src/xterm.c' --- src/xterm.c 2012-09-02 17:10:35 +0000 +++ src/xterm.c 2012-09-04 17:34:54 +0000 @@ -1467,7 +1467,7 @@ && f->output_data.x->widget == widget) return f; - abort (); + emacs_abort (); } /* Allocate a color which is lighter or darker than *PIXEL by FACTOR @@ -2696,7 +2696,7 @@ y2 += dy; if (INT_MAX - dx < xmax) - abort (); + emacs_abort (); while (x1 <= xmax) { @@ -2805,7 +2805,7 @@ break; default: - abort (); + emacs_abort (); } if (!s->for_overlaps) @@ -3005,7 +3005,7 @@ static void x_delete_glyphs (struct frame *f, register int n) { - abort (); + emacs_abort (); } @@ -3278,7 +3278,7 @@ static void x_ins_del_lines (struct frame *f, int vpos, int n) { - abort (); + emacs_abort (); } @@ -4115,7 +4115,7 @@ frame = XCAR (tail); /* All elements of Vframe_list should be frames. */ if (! FRAMEP (frame)) - abort (); + emacs_abort (); if (! FRAME_X_P (XFRAME (frame))) continue; @@ -5434,7 +5434,7 @@ /* We can't redeem this window's scroll bar if it doesn't have one. */ if (NILP (window->vertical_scroll_bar)) - abort (); + emacs_abort (); bar = XSCROLL_BAR (window->vertical_scroll_bar); @@ -5453,7 +5453,7 @@ else /* If its prev pointer is nil, it must be at the front of one or the other! */ - abort (); + emacs_abort (); } else XSCROLL_BAR (bar->prev)->next = bar->next; @@ -5551,7 +5551,7 @@ x_scroll_bar_handle_click (struct scroll_bar *bar, XEvent *event, struct input_event *emacs_event) { if (! WINDOWP (bar->window)) - abort (); + emacs_abort (); emacs_event->kind = SCROLL_BAR_CLICK_EVENT; emacs_event->code = event->xbutton.button - Button1; @@ -6457,7 +6457,7 @@ } else if (status_return != XLookupKeySym && status_return != XLookupBoth) - abort (); + emacs_abort (); } else nbytes = XLookupString (&event.xkey, (char *) copy_bufptr, @@ -7496,7 +7496,7 @@ break; default: - abort (); + emacs_abort (); } } @@ -7849,7 +7849,7 @@ This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\ For details, see etc/PROBLEMS.\n", error_msg); - abort (); + emacs_abort (); #endif /* USE_GTK */ /* Indicate that this display is dead. */ @@ -7859,7 +7859,7 @@ dpyinfo->terminal->reference_count--; if (dpyinfo->reference_count != 0) /* We have just closed all frames on this display. */ - abort (); + emacs_abort (); { Lisp_Object tmp; @@ -10436,7 +10436,7 @@ to.addr = (XPointer)&font; x_catch_errors (dpy); if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL)) - abort (); + emacs_abort (); if (x_had_errors_p (dpy) || !XQueryFont (dpy, font)) XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15"); x_uncatch_errors (); ------------------------------------------------------------ revno: 109876 fixes bug: http://debbugs.gnu.org/11860 committer: Eli Zaretskii branch nick: trunk timestamp: Tue 2012-09-04 20:15:45 +0300 message: Fix display of Arabic diacriticals on Windows, per bug #11860. src/w32uniscribe.c (uniscribe_shape): Reverse the sign of offsets[j].dv, since the y axis of the screen coordinates points down, while the y axis of the font definition coordinates points up. This fixes display of Arabic diacritics such as KASRA and KASRATAN. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-04 06:34:19 +0000 +++ src/ChangeLog 2012-09-04 17:15:45 +0000 @@ -1,3 +1,11 @@ +2012-09-04 Eli Zaretskii + + * w32uniscribe.c (uniscribe_shape): Reverse the sign of + offsets[j].dv, since the y axis of the screen coordinates points + down, while the y axis of the font definition coordinates points + up. This fixes display of Arabic diacritics such as KASRA and + KASRATAN. (Bug#11860) + 2012-09-04 Paul Eggert Be more systematic about _setjmp vs setjmp. === modified file 'src/w32uniscribe.c' --- src/w32uniscribe.c 2012-09-01 13:54:27 +0000 +++ src/w32uniscribe.c 2012-09-04 17:15:45 +0000 @@ -454,7 +454,11 @@ } else ASET (vec, 0, make_number (offsets[j].du + adj_offset)); - ASET (vec, 1, make_number (offsets[j].dv)); + /* In the font definition coordinate system, the + Y coordinate points up, while in our screen + coordinates Y grows downwards. So we need to + reverse the sign of Y-OFFSET here. */ + ASET (vec, 1, make_number (-offsets[j].dv)); /* Based on what ftfont.c does... */ ASET (vec, 2, make_number (advances[j])); LGLYPH_SET_ADJUSTMENT (lglyph, vec); ------------------------------------------------------------ revno: 109875 committer: Lars Ingebrigtsen branch nick: trunk timestamp: Tue 2012-09-04 18:00:10 +0200 message: Have smtpmail.el prefer the From: header for the MAIL FROM envelope * mail/smtpmail.el (smtpmail-send-it): Prefer the From: header over `user-mail-address' for the SMTP MAIL FROM envelope. (smtpmail-via-smtp): Ditto. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-09-03 08:54:25 +0000 +++ etc/NEWS 2012-09-04 16:00:10 +0000 @@ -1403,6 +1403,10 @@ in your ~/.authinfo file instead. +*** SMTPmail defaults to using the address in the From: header as the +SMTP MAIL FROM envelope. To override this, set `mail-envelope-from' +to the address you wish to use instead. + ** SQL mode *** New options `sql-port', `sql-connection-alist', `sql-send-terminator', === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-09-04 04:44:43 +0000 +++ lisp/ChangeLog 2012-09-04 16:00:10 +0000 @@ -1,3 +1,9 @@ +2012-09-04 Lars Ingebrigtsen + + * mail/smtpmail.el (smtpmail-send-it): Prefer the From: header + over `user-mail-address' for the SMTP MAIL FROM envelope. + (smtpmail-via-smtp): Ditto. + 2012-09-04 Dmitry Gutov * progmodes/ruby-mode.el: Clean up keybindings. === modified file 'lisp/mail/smtpmail.el' --- lisp/mail/smtpmail.el 2012-05-09 19:12:20 +0000 +++ lisp/mail/smtpmail.el 2012-09-04 16:00:10 +0000 @@ -200,10 +200,10 @@ ;; local binding in the mail buffer will take effect. (smtpmail-mail-address (or (and mail-specify-envelope-from (mail-envelope-from)) - (smtpmail-user-mail-address) - (let ((from (mail-fetch-field "from"))) + (let ((from (mail-fetch-field "from"))) (and from - (cadr (mail-extract-address-components from)))))) + (cadr (mail-extract-address-components from)))) + (smtpmail-user-mail-address))) (smtpmail-code-conv-from (if enable-multibyte-characters (let ((sendmail-coding-system smtpmail-code-conv-from)) @@ -653,12 +653,10 @@ (or smtpmail-mail-address (and mail-specify-envelope-from (mail-envelope-from)) - (smtpmail-user-mail-address) - ;; Fall back on the From: header as the envelope From - ;; address. (let ((from (mail-fetch-field "from"))) (and from - (cadr (mail-extract-address-components from)))))) + (cadr (mail-extract-address-components from)))) + (smtpmail-user-mail-address))) response-code process-buffer result ------------------------------------------------------------ revno: 109874 committer: Glenn Morris branch nick: trunk timestamp: Tue 2012-09-04 06:17:39 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2012-09-02 10:19:02 +0000 +++ autogen/config.in 2012-09-04 10:17:39 +0000 @@ -1542,10 +1542,12 @@ declarations. Define as empty for no equivalent. */ #undef __restrict_arr -/* Some platforms redefine this. */ +/* Define to longjmp if _setjmp and _longjmp do not work. Because longjmp may + alter signal masks, callers of _longjmp should not assume that it leaves + signal masks alone. */ #undef _longjmp -/* Some platforms redefine this. */ +/* Define to setjmp if _setjmp and _longjmp do not work. See _longjmp. */ #undef _setjmp /* Some platforms that do not use configure define this to include extra === modified file 'autogen/configure' --- autogen/configure 2012-09-03 10:17:43 +0000 +++ autogen/configure 2012-09-04 10:17:39 +0000 @@ -7218,6 +7218,7 @@ nw="$nw -Wswitch-default" # Too many warnings for now nw="$nw -Wfloat-equal" # warns about high-quality code nw="$nw -Winline" # OK to ignore 'inline' + nw="$nw -Wjump-misses-init" # We sometimes safely jump over init. nw="$nw -Wsync-nand" # irrelevant here, and provokes ObjC warning nw="$nw -Wunsafe-loop-optimizations" # OK to suppress unsafe optimizations @@ -15480,15 +15481,46 @@ ;; esac fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _setjmp" >&5 +$as_echo_n "checking for _setjmp... " >&6; } +if test "${emacs_cv_func__setjmp+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include -case $opsys in - sol2* | unixware ) +int +main () +{ +jmp_buf j; + if (! _setjmp (j)) + _longjmp (j, 1); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + emacs_cv_func__setjmp=yes +else + emacs_cv_func__setjmp=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $emacs_cv_func__setjmp" >&5 +$as_echo "$emacs_cv_func__setjmp" >&6; } +if test $emacs_cv_func__setjmp = no; then $as_echo "#define _setjmp setjmp" >>confdefs.h $as_echo "#define _longjmp longjmp" >>confdefs.h +fi + +case $opsys in + sol2* | unixware ) $as_echo "#define TIOCSIGSEND TIOCSIGNAL" >>confdefs.h ------------------------------------------------------------ revno: 109873 committer: Paul Eggert branch nick: trunk timestamp: Mon 2012-09-03 23:34:19 -0700 message: Be more systematic about _setjmp vs setjmp. * alloc.c (test_setjmp, mark_stack): * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]: (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]: (png_load, my_error_exit, jpeg_load): * process.c (send_process_trap, send_process): Uniformly prefer _setjmp and _longjmp to setjmp and longjmp. The underscored versions are up to 30x faster on some hosts. Formerly, the code used setjmp+longjmp sometimes and _setjmp+_longjmp at other times, with no particular reason to prefer setjmp+longjmp. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-09-03 19:36:09 +0000 +++ src/ChangeLog 2012-09-04 06:34:19 +0000 @@ -1,3 +1,17 @@ +2012-09-04 Paul Eggert + + Be more systematic about _setjmp vs setjmp. + * alloc.c (test_setjmp, mark_stack): + * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]: + (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]: + (png_load, my_error_exit, jpeg_load): + * process.c (send_process_trap, send_process): + Uniformly prefer _setjmp and _longjmp to setjmp and longjmp. + The underscored versions are up to 30x faster on some hosts. + Formerly, the code used setjmp+longjmp sometimes and + _setjmp+_longjmp at other times, with no particular reason to + prefer setjmp+longjmp. + 2012-09-03 Paul Eggert Fix minor problem found by static checking. === modified file 'src/alloc.c' --- src/alloc.c 2012-09-02 16:56:31 +0000 +++ src/alloc.c 2012-09-04 06:34:19 +0000 @@ -4764,7 +4764,7 @@ x = strlen (buf); x = 2 * x - 1; - setjmp (jbuf); + _setjmp (jbuf); if (longjmps_done == 1) { /* Came here after the longjmp at the end of the function. @@ -4789,7 +4789,7 @@ ++longjmps_done; x = 2; if (longjmps_done == 1) - longjmp (jbuf, 1); + _longjmp (jbuf, 1); } #endif /* not GC_SAVE_REGISTERS_ON_STACK && not GC_SETJMP_WORKS */ @@ -4931,7 +4931,7 @@ } #endif /* GC_SETJMP_WORKS */ - setjmp (j.j); + _setjmp (j.j); end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; #endif /* not GC_SAVE_REGISTERS_ON_STACK */ #endif /* not HAVE___BUILTIN_UNWIND_INIT */ === modified file 'src/image.c' --- src/image.c 2012-09-02 16:56:31 +0000 +++ src/image.c 2012-09-04 06:34:19 +0000 @@ -5517,13 +5517,13 @@ #if (PNG_LIBPNG_VER < 10500) -#define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1)) +#define PNG_LONGJMP(ptr) (_longjmp ((ptr)->jmpbuf, 1)) #define PNG_JMPBUF(ptr) ((ptr)->jmpbuf) #else /* In libpng version 1.5, the jmpbuf member is hidden. (Bug#7908) */ #define PNG_LONGJMP(ptr) (fn_png_longjmp ((ptr), 1)) #define PNG_JMPBUF(ptr) \ - (*fn_png_set_longjmp_fn ((ptr), longjmp, sizeof (jmp_buf))) + (*fn_png_set_longjmp_fn ((ptr), _longjmp, sizeof (jmp_buf))) #endif /* Error and warning handlers installed when the PNG library @@ -5696,7 +5696,7 @@ /* Set error jump-back. We come back here when the PNG library detects an error. */ - if (setjmp (PNG_JMPBUF (png_ptr))) + if (_setjmp (PNG_JMPBUF (png_ptr))) { error: if (png_ptr) @@ -6114,7 +6114,7 @@ my_error_exit (j_common_ptr cinfo) { struct my_jpeg_error_mgr *mgr = (struct my_jpeg_error_mgr *) cinfo->err; - longjmp (mgr->setjmp_buffer, 1); + _longjmp (mgr->setjmp_buffer, 1); } @@ -6365,7 +6365,7 @@ cinfo.err = fn_jpeg_std_error (&mgr.pub); mgr.pub.error_exit = my_error_exit; - if ((rc = setjmp (mgr.setjmp_buffer)) != 0) + if ((rc = _setjmp (mgr.setjmp_buffer)) != 0) { if (rc == 1) { @@ -6411,12 +6411,12 @@ if (!check_image_size (f, width, height)) { image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil); - longjmp (mgr.setjmp_buffer, 2); + _longjmp (mgr.setjmp_buffer, 2); } /* Create X image and pixmap. */ if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) - longjmp (mgr.setjmp_buffer, 2); + _longjmp (mgr.setjmp_buffer, 2); /* Allocate colors. When color quantization is used, cinfo.actual_number_of_colors has been set with the number of === modified file 'src/process.c' --- src/process.c 2012-09-02 17:10:35 +0000 +++ src/process.c 2012-09-04 06:34:19 +0000 @@ -5431,7 +5431,7 @@ { SIGNAL_THREAD_CHECK (SIGPIPE); sigunblock (sigmask (SIGPIPE)); - longjmp (send_process_frame, 1); + _longjmp (send_process_frame, 1); } /* In send_process, when a write fails temporarily, @@ -5634,7 +5634,7 @@ /* 2000-09-21: Emacs 20.7, sparc-sun-solaris-2.6, GCC 2.95.2, CFLAGS="-g -O": The value of the parameter `proc' is clobbered when returning with longjmp despite being declared volatile. */ - if (!setjmp (send_process_frame)) + if (!_setjmp (send_process_frame)) { p = XPROCESS (proc); /* Repair any setjmp clobbering. */ process_sent_to = proc;