Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 103761. ------------------------------------------------------------ revno: 103761 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-03-26 22:33:36 -0400 message: Auto-commit of generated files. diff: === modified file 'autogen/config.in' --- autogen/config.in 2011-03-25 19:28:35 +0000 +++ autogen/config.in 2011-03-27 02:33:36 +0000 @@ -999,9 +999,6 @@ slash */ #undef REPLACE_FUNC_STAT_FILE -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type 'sig_atomic_t'. */ #undef SIG_ATOMIC_T_SUFFIX @@ -1274,11 +1271,6 @@ # define SYSTEM_PURESIZE_EXTRA 30000 #endif -/* SIGTYPE is the macro we actually use. */ -#ifndef SIGTYPE -#define SIGTYPE RETSIGTYPE -#endif - #ifdef emacs /* Don't do this for lib-src. */ /* Tell regex.c to use a type compatible with Emacs. */ #define RE_TRANSLATE_TYPE Lisp_Object === modified file 'autogen/configure' --- autogen/configure 2011-03-25 19:28:35 +0000 +++ autogen/configure 2011-03-27 02:33:36 +0000 @@ -7899,40 +7899,6 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if test "${ac_cv_type_signal+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for speed_t" >&5 $as_echo_n "checking for speed_t... " >&6; } if test "${emacs_cv_speed_t+set}" = set; then : ------------------------------------------------------------ revno: 103760 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-03-26 19:27:11 -0700 message: Remove (RET)SIGTYPE; it is identical to void on all supported systems. Ref: http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg01068.html * configure.in (AC_TYPE_SIGNAL): Remove obsolete macro. (AH_BOTTOM): Do not define SIGTYPE. * lib-src/emacsclient.c: Replace SIGTYPE with void. * nt/config.nt: Remove RETSIGTYPE, SIGTYPE (identical to void). * src/syssignal.h: Replace RETSIGTYPE with void. * src/atimer.c, src/data.c, src/dispnew.c, src/emacs.c, src/floatfns.c: * src/keyboard.c, src/keyboard.h, src/lisp.h, src/process.c, src/sysdep.c: * src/xterm.c: Replace SIGTYPE with void everywhere. * src/s/template.h (SIGTYPE): Remove commented out definition. * src/s/usg5-4-common.h (SIGTYPE): Remove definition. * admin/CPP-DEFINES: Remove SIGTYPE. diff: === modified file 'ChangeLog' --- ChangeLog 2011-03-26 19:29:10 +0000 +++ ChangeLog 2011-03-27 02:27:11 +0000 @@ -1,3 +1,8 @@ +2011-03-27 Glenn Morris + + * configure.in (AC_TYPE_SIGNAL): Remove obsolete macro. + (AH_BOTTOM): Do not define SIGTYPE. + 2011-03-26 Glenn Morris * configure.in: Replace obsolete macros AC_TRY_COMPILE, AC_TRY_LINK, === modified file 'admin/CPP-DEFINES' --- admin/CPP-DEFINES 2011-02-16 01:35:20 +0000 +++ admin/CPP-DEFINES 2011-03-27 02:27:11 +0000 @@ -58,7 +58,6 @@ INTERRUPT_INPUT NARROWPROTO SEPCHAR -SIGTYPE SYSTEM_TYPE ** Machine specific macros, decribed in detail in src/m/template.h @@ -238,7 +237,6 @@ SIGPIPE SIGQUIT SIGTRAP -SIGTYPE SOLARIS2 STDC_HEADERS SYSTEM_PURESIZE_EXTRA === modified file 'configure.in' --- configure.in 2011-03-26 19:29:10 +0000 +++ configure.in 2011-03-27 02:27:11 +0000 @@ -1227,9 +1227,6 @@ AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by .]) fi -dnl checks for typedefs -AC_TYPE_SIGNAL - dnl Check for speed_t typedef. AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[speed_t x = 1;]])], @@ -3493,11 +3490,6 @@ # define SYSTEM_PURESIZE_EXTRA 30000 #endif -/* SIGTYPE is the macro we actually use. */ -#ifndef SIGTYPE -#define SIGTYPE RETSIGTYPE -#endif - #ifdef emacs /* Don't do this for lib-src. */ /* Tell regex.c to use a type compatible with Emacs. */ #define RE_TRANSLATE_TYPE Lisp_Object === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-03-23 16:25:38 +0000 +++ lib-src/ChangeLog 2011-03-27 02:27:11 +0000 @@ -1,3 +1,7 @@ +2011-03-27 Glenn Morris + + * emacsclient.c: Replace SIGTYPE with void. + 2011-03-23 Juanma Barranquero * ntlib.c: Include . === modified file 'lib-src/emacsclient.c' --- lib-src/emacsclient.c 2011-03-03 07:00:23 +0000 +++ lib-src/emacsclient.c 2011-03-27 02:27:11 +0000 @@ -1116,7 +1116,7 @@ /* A signal handler that passes the signal to the Emacs process. Useful for SIGWINCH. */ -static SIGTYPE +static void pass_signal_to_emacs (int signalnum) { int old_errno = errno; @@ -1131,7 +1131,7 @@ /* Signal handler for SIGCONT; notify the Emacs process that it can now resume our tty frame. */ -static SIGTYPE +static void handle_sigcont (int signalnum) { int old_errno = errno; @@ -1157,7 +1157,7 @@ reality, we may get a SIGTSTP on C-z. Handling this signal and notifying Emacs about it should get things under control again. */ -static SIGTYPE +static void handle_sigtstp (int signalnum) { int old_errno = errno; === modified file 'nt/ChangeLog' --- nt/ChangeLog 2011-03-25 15:39:59 +0000 +++ nt/ChangeLog 2011-03-27 02:27:11 +0000 @@ -1,3 +1,7 @@ +2011-03-27 Glenn Morris + + * config.nt: Remove RETSIGTYPE, SIGTYPE (identical to void). + 2011-03-25 Juanma Barranquero * addpm.c (main): Remove unused variable `retval'. === modified file 'nt/config.nt' --- nt/config.nt 2011-02-26 14:02:45 +0000 +++ nt/config.nt 2011-03-27 02:27:11 +0000 @@ -393,15 +393,6 @@ #undef STACK_DIRECTION #endif -/* Define the return type of signal handlers if the s-xxx file - did not already do so. */ -#define RETSIGTYPE void - -/* SIGTYPE is the macro we actually use. */ -#ifndef SIGTYPE -#define SIGTYPE RETSIGTYPE -#endif - #ifdef emacs /* Don't do this for lib-src. */ /* Tell regex.c to use a type compatible with Emacs. */ #define RE_TRANSLATE_TYPE Lisp_Object === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-26 12:20:20 +0000 +++ src/ChangeLog 2011-03-27 02:27:11 +0000 @@ -1,3 +1,12 @@ +2011-03-27 Glenn Morris + + * syssignal.h: Replace RETSIGTYPE with void. + * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c: + * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c: + Replace SIGTYPE with void everywhere. + * s/usg5-4-common.h (SIGTYPE): Remove definition. + * s/template.h (SIGTYPE): Remove commented out definition. + 2011-03-26 Eli Zaretskii * xdisp.c (redisplay_window): Don't check buffer's clip_changed === modified file 'src/atimer.c' --- src/atimer.c 2011-03-18 06:48:05 +0000 +++ src/atimer.c 2011-03-27 02:27:11 +0000 @@ -64,7 +64,7 @@ static void schedule_atimer (struct atimer *); static struct atimer *append_atimer_lists (struct atimer *, struct atimer *); -SIGTYPE alarm_signal_handler (int signo); +void alarm_signal_handler (int signo); /* Start a new atimer of type TYPE. TIME specifies when the timer is @@ -388,7 +388,7 @@ /* Signal handler for SIGALRM. SIGNO is the signal number, i.e. SIGALRM. */ -SIGTYPE +void alarm_signal_handler (int signo) { #ifndef SYNC_INPUT === modified file 'src/data.c' --- src/data.c 2011-03-15 23:22:38 +0000 +++ src/data.c 2011-03-27 02:27:11 +0000 @@ -3300,7 +3300,7 @@ XSYMBOL (intern_c_string ("most-negative-fixnum"))->constant = 1; } -static SIGTYPE +static void arith_error (int signo) { sigsetmask (SIGEMPTYMASK); === modified file 'src/dispnew.c' --- src/dispnew.c 2011-03-25 18:06:33 +0000 +++ src/dispnew.c 2011-03-27 02:27:11 +0000 @@ -5566,7 +5566,7 @@ #ifdef SIGWINCH -static SIGTYPE +static void window_change_signal (int signalnum) /* If we don't have an argument, */ /* some compilers complain in signal calls. */ { === modified file 'src/emacs.c' --- src/emacs.c 2011-03-23 10:06:57 +0000 +++ src/emacs.c 2011-03-27 02:27:11 +0000 @@ -308,7 +308,7 @@ /* Handle bus errors, invalid instruction, etc. */ -SIGTYPE +void fatal_error_signal (int sig) { SIGNAL_THREAD_CHECK (sig); @@ -345,7 +345,7 @@ #ifdef SIGDANGER /* Handler for SIGDANGER. */ -SIGTYPE +void memory_warning_signal (sig) int sig; { === modified file 'src/floatfns.c' --- src/floatfns.c 2011-03-16 07:47:02 +0000 +++ src/floatfns.c 2011-03-27 02:27:11 +0000 @@ -103,7 +103,7 @@ #endif #ifdef FLOAT_CATCH_SIGILL -static SIGTYPE float_error (); +static void float_error (); #endif /* Nonzero while executing in floating point. @@ -126,7 +126,7 @@ Handle errors which may result in signals or may set errno. Note that float_error may be declared to return void, so you can't - just cast the zero after the colon to (SIGTYPE) to make the types + just cast the zero after the colon to (void) to make the types check properly. */ #ifdef FLOAT_CHECK_ERRNO @@ -960,7 +960,7 @@ } #ifdef FLOAT_CATCH_SIGILL -static SIGTYPE +static void float_error (signo) int signo; { === modified file 'src/keyboard.c' --- src/keyboard.c 2011-03-26 01:23:15 +0000 +++ src/keyboard.c 2011-03-27 02:27:11 +0000 @@ -434,15 +434,15 @@ static Lisp_Object apply_modifiers (int, Lisp_Object); static void clear_event (struct input_event *); static Lisp_Object restore_kboard_configuration (Lisp_Object); -static SIGTYPE interrupt_signal (int signalnum); +static void interrupt_signal (int signalnum); #ifdef SIGIO -static SIGTYPE input_available_signal (int signo); +static void input_available_signal (int signo); #endif static void handle_interrupt (void); static void timer_start_idle (void); static void timer_stop_idle (void); static void timer_resume_idle (void); -static SIGTYPE handle_user_signal (int); +static void handle_user_signal (int); static char *find_user_signal_name (int); static int store_user_signal_events (void); @@ -7082,7 +7082,7 @@ #ifdef SIGIO /* for entire page */ /* Note SIGIO has been undef'd if FIONREAD is missing. */ -static SIGTYPE +static void input_available_signal (int signo) { /* Must preserve main program's value of errno. */ @@ -7160,7 +7160,7 @@ signal (sig, handle_user_signal); } -static SIGTYPE +static void handle_user_signal (int sig) { int old_errno = errno; @@ -10712,7 +10712,7 @@ SIGINT was generated by C-g, so we call handle_interrupt. Otherwise, the handler kills Emacs. */ -static SIGTYPE +static void interrupt_signal (int signalnum) /* If we don't have an argument, some */ /* compilers complain in signal calls. */ { === modified file 'src/keyboard.h' --- src/keyboard.h 2011-03-26 01:23:15 +0000 +++ src/keyboard.h 2011-03-27 02:27:11 +0000 @@ -485,7 +485,7 @@ extern void pop_kboard (void); extern void temporarily_switch_to_single_kboard (struct frame *); extern void record_asynch_buffer_change (void); -extern SIGTYPE input_poll_signal (int); +extern void input_poll_signal (int); extern void start_polling (void); extern void stop_polling (void); extern void set_poll_suppress_count (int); === modified file 'src/lisp.h' --- src/lisp.h 2011-03-22 09:08:11 +0000 +++ src/lisp.h 2011-03-27 02:27:11 +0000 @@ -3181,7 +3181,7 @@ extern Lisp_Object empty_unibyte_string, empty_multibyte_string; extern Lisp_Object Qfile_name_handler_alist; extern void (*fatal_error_signal_hook) (void); -extern SIGTYPE fatal_error_signal (int); +extern void fatal_error_signal (int); EXFUN (Fkill_emacs, 1) NO_RETURN; #if HAVE_SETLOCALE void fixup_locale (void); === modified file 'src/process.c' --- src/process.c 2011-03-26 01:23:15 +0000 +++ src/process.c 2011-03-27 02:27:11 +0000 @@ -5470,7 +5470,7 @@ jmp_buf send_process_frame; Lisp_Object process_sent_to; -static SIGTYPE +static void send_process_trap (int ignore) { SIGNAL_THREAD_CHECK (SIGPIPE); @@ -5497,7 +5497,7 @@ EMACS_INT rv; struct coding_system *coding; struct gcpro gcpro1; - SIGTYPE (*volatile old_sigpipe) (int); + void (*volatile old_sigpipe) (int); GCPRO1 (object); @@ -5619,7 +5619,7 @@ while (this > 0) { int outfd = p->outfd; - old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap); + old_sigpipe = (void (*) (int)) signal (SIGPIPE, send_process_trap); #ifdef DATAGRAM_SOCKETS if (DATAGRAM_CHAN_P (outfd)) { @@ -6379,7 +6379,7 @@ indirectly; if it does, that is a bug */ #ifdef SIGCHLD -static SIGTYPE +static void sigchld_handler (int signo) { int old_errno = errno; === modified file 'src/s/template.h' --- src/s/template.h 2011-01-25 04:08:28 +0000 +++ src/s/template.h 2011-03-27 02:27:11 +0000 @@ -77,15 +77,6 @@ a file that someone else has modified in his Emacs. */ #define CLASH_DETECTION -/* Define this if your operating system declares signal handlers to - have a type other than the usual. `The usual' is `void' for ANSI C - systems (i.e. when the __STDC__ macro is defined), and `int' for - pre-ANSI systems. If you're using GCC on an older system, __STDC__ - will be defined, but the system's include files will still say that - signal returns int or whatever; in situations like that, define - this to be what the system's include files want. */ -/* #define SIGTYPE int */ - /* If the character used to separate elements of the executable path is not ':', #define this to be the appropriate character constant. */ /* #define SEPCHAR ':' */ === modified file 'src/s/usg5-4-common.h' --- src/s/usg5-4-common.h 2011-02-16 01:35:20 +0000 +++ src/s/usg5-4-common.h 2011-03-27 02:27:11 +0000 @@ -38,9 +38,6 @@ /* The docs for system V/386 suggest v.3 has sigpause, so let's try it. */ #define HAVE_SYSV_SIGPAUSE -/* On USG systems signal handlers return void. */ -#define SIGTYPE void - /* Get FIONREAD from . Get to get struct tchars. But get first to make sure ttold.h doesn't interfere. And don't try to use SIGIO yet. */ === modified file 'src/sysdep.c' --- src/sysdep.c 2011-03-18 05:50:40 +0000 +++ src/sysdep.c 2011-03-27 02:27:11 +0000 @@ -449,7 +449,7 @@ struct save_signal { int code; - SIGTYPE (*handler) (int); + void (*handler) (int); }; static void save_signal_handlers (struct save_signal *); @@ -608,7 +608,7 @@ while (saved_handlers->code) { saved_handlers->handler - = (SIGTYPE (*) (int)) signal (saved_handlers->code, SIG_IGN); + = (void (*) (int)) signal (saved_handlers->code, SIG_IGN); saved_handlers++; } } === modified file 'src/syssignal.h' --- src/syssignal.h 2011-01-25 04:08:28 +0000 +++ src/syssignal.h 2011-03-27 02:27:11 +0000 @@ -69,7 +69,7 @@ /* Whether this is what all systems want or not, this is what appears to be assumed in the source, for example data.c:arith_error. */ -typedef RETSIGTYPE (*signal_handler_t) (int); +typedef void (*signal_handler_t) (int); signal_handler_t sys_signal (int signal_number, signal_handler_t action); sigset_t sys_sigblock (sigset_t new_mask); === modified file 'src/xterm.c' --- src/xterm.c 2011-03-22 18:15:52 +0000 +++ src/xterm.c 2011-03-27 02:27:11 +0000 @@ -349,7 +349,7 @@ int *, struct input_event *); /* Don't declare this NO_RETURN because we want no interference with debugging failing X calls. */ -static SIGTYPE x_connection_closed (Display *, const char *); +static void x_connection_closed (Display *, const char *); /* Flush display of frame F, or of all frames if F is null. */ @@ -7650,7 +7650,7 @@ SIGPIPE will fail, causing Xlib to invoke the X IO error handler, which will do the appropriate cleanup for us. */ -static SIGTYPE +static void x_connection_signal (int signalnum) /* If we don't have an argument, */ /* some compilers complain in signal calls. */ { @@ -7673,7 +7673,7 @@ /* Handle the loss of connection to display DPY. ERROR_MESSAGE is the text of an error message that lead to the connection loss. */ -static SIGTYPE +static void x_connection_closed (Display *dpy, const char *error_message) { struct x_display_info *dpyinfo = x_display_info_for_display (dpy); ------------------------------------------------------------ revno: 103759 committer: Leo Liu branch nick: trunk timestamp: Sun 2011-03-27 09:56:35 +0800 message: Support separate fg and bg colors in ansi-color.el A color suitable for foreground text can make unreadable text if used as background color, and vice versa. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-03-25 22:26:30 +0000 +++ lisp/ChangeLog 2011-03-27 01:56:35 +0000 @@ -1,3 +1,9 @@ +2011-03-27 Leo Liu + + * ansi-color.el (ansi-color-names-vector): Allow cons cell value + for foreground and background colors. + (ansi-color-make-color-map): Adapt. + 2011-03-25 Leo Liu * midnight.el (midnight-time-float): Remove. Note it calculates === modified file 'lisp/ansi-color.el' --- lisp/ansi-color.el 2011-01-25 04:08:28 +0000 +++ lisp/ansi-color.el 2011-03-27 01:56:35 +0000 @@ -132,8 +132,18 @@ 37 47 white This vector is used by `ansi-color-make-color-map' to create a color -map. This color map is stored in the variable `ansi-color-map'." - :type '(vector string string string string string string string string) +map. This color map is stored in the variable `ansi-color-map'. + +Each element may also be a cons cell where the car and cdr specify the +foreground and background colors, respectively." + :type '(vector (choice color (cons color color)) + (choice color (cons color color)) + (choice color (cons color color)) + (choice color (cons color color)) + (choice color (cons color color)) + (choice color (cons color color)) + (choice color (cons color color)) + (choice color (cons color color))) :set 'ansi-color-map-update :initialize 'custom-initialize-default :group 'ansi-colors) @@ -528,7 +538,8 @@ (mapc (function (lambda (e) (aset ansi-color-map index - (ansi-color-make-face 'foreground e)) + (ansi-color-make-face 'foreground + (if (consp e) (car e) e))) (setq index (1+ index)) )) ansi-color-names-vector) ;; background attributes @@ -536,7 +547,8 @@ (mapc (function (lambda (e) (aset ansi-color-map index - (ansi-color-make-face 'background e)) + (ansi-color-make-face 'background + (if (consp e) (cdr e) e))) (setq index (1+ index)) )) ansi-color-names-vector) ansi-color-map)) ------------------------------------------------------------ revno: 103758 committer: Chong Yidong branch nick: trunk timestamp: Sat 2011-03-26 19:18:42 -0400 message: Changes to open-protocol-stream, preparing for merging it with open-network-stream. * lisp/gnus/proto-stream.el: Changes preparatory to merging open-protocol-stream with open-network-stream. (proto-stream-always-use-starttls): Option removed. (open-protocol-stream): Return a process object by default. Provide a new parameter :return-list specifying a list-type return value, which now has the form (PROP . PLIST) instead of a fixed-length list. Change :type `network' to `try-starttls', and `network-only' to `default'. Make `default' the default, for compatibility with open-network-stream. Handle the no-parameter case exactly as open-network-stream, with no additional stream processing. Search plists using plist-get. Explicitly add :end-of-commend parameter if it is missing. (proto-stream-open-default): Renamed from proto-stream-open-network-only. Return 'default as the type. (proto-stream-open-starttls): Rename from proto-stream-open-network. Use plist-get. Don't return `tls' as the type if STARTTLS negotiation failed. Always return a list with a (possibly dead) process as the first element, for compatibility with open-network-stream. (proto-stream-open-tls): Use plist-get. Always return a list. (proto-stream-open-shell): Return `default' as connection type. (proto-stream-capability-open): Use plist-get. (proto-stream-eoc): Function deleted. * lisp/gnus/nnimap.el (nnimap-stream, nnimap-open-connection) (nnimap-open-connection-1): Handle renaming of :type parameter for open-protocol-stream. (nnimap-open-connection-1): Pass a :return-list parameter open-protocol-stream to obtain a list return value. Parse this list using plist-get. * lisp/gnus/nntp.el (nntp-open-connection): Handle renaming of :type parameter for open-protocol-stream. Accept open-protocol-stream return value that is a subprocess object instead of a list. Handle the case of a dead returned process. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2011-03-25 23:27:18 +0000 +++ lisp/gnus/ChangeLog 2011-03-26 23:18:42 +0000 @@ -1,3 +1,39 @@ +2011-03-26 Chong Yidong + + * proto-stream.el: Changes preparatory to merging open-protocol-stream + with open-network-stream. + (proto-stream-always-use-starttls): Option removed. + (open-protocol-stream): Return a process object by default. Provide a + new parameter :return-list specifying a list-type return value, which + now has the form (PROP . PLIST) instead of a fixed-length list. Change + :type `network' to `try-starttls', and `network-only' to `default'. + Make `default' the default, for compatibility with open-network-stream. + Handle the no-parameter case exactly as open-network-stream, with no + additional stream processing. Search plists using plist-get. + Explicitly add :end-of-commend parameter if it is missing. + (proto-stream-open-default): Renamed from + proto-stream-open-network-only. Return 'default as the type. + (proto-stream-open-starttls): Rename from proto-stream-open-network. + Use plist-get. Don't return `tls' as the type if STARTTLS negotiation + failed. Always return a list with a (possibly dead) process as the + first element, for compatibility with open-network-stream. + (proto-stream-open-tls): Use plist-get. Always return a list. + (proto-stream-open-shell): Return `default' as connection type. + (proto-stream-capability-open): Use plist-get. + (proto-stream-eoc): Function deleted. + + * nnimap.el (nnimap-stream, nnimap-open-connection) + (nnimap-open-connection-1): Handle renaming of :type parameter for + open-protocol-stream. + (nnimap-open-connection-1): Pass a :return-list parameter + open-protocol-stream to obtain a list return value. Parse this list + using plist-get. + + * nntp.el (nntp-open-connection): Handle renaming of :type parameter + for open-protocol-stream. Accept open-protocol-stream return value + that is a subprocess object instead of a list. Handle the case of a + dead returned process. + 2011-03-25 Teodor Zlatanov * mm-util.el (mm-handle-filename): Move to mm-decode.el (bug#8330). === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2011-03-18 13:45:04 +0000 +++ lisp/gnus/nnimap.el 2011-03-26 23:18:42 +0000 @@ -62,9 +62,9 @@ (defvoo nnimap-stream 'undecided "How nnimap will talk to the IMAP server. -Values are `ssl', `network', `network-only, `starttls' or +Values are `ssl', `default', `try-starttls', `starttls' or `shell'. The default is to try `ssl' first, and then -`network'.") +`try-starttls'.") (defvoo nnimap-shell-program (if (boundp 'imap-shell-program) (if (listp imap-shell-program) @@ -319,7 +319,7 @@ (setq nnimap-stream 'ssl)) (let ((stream (if (eq nnimap-stream 'undecided) - (loop for type in '(ssl network) + (loop for type in '(ssl try-starttls) for stream = (let ((nnimap-stream type)) (nnimap-open-connection-1 buffer)) while (eq stream 'no-connect) @@ -339,9 +339,7 @@ (port nil) (ports (cond - ((or (eq nnimap-stream 'network) - (eq nnimap-stream 'network-only) - (eq nnimap-stream 'starttls)) + ((memq nnimap-stream '(try-starttls default starttls)) (nnheader-message 7 "Opening connection to %s..." nnimap-address) '("imap" "143")) @@ -355,21 +353,28 @@ '("imaps" "imap" "993" "143")) (t (error "Unknown stream type: %s" nnimap-stream)))) - (proto-stream-always-use-starttls t) login-result credentials) (when nnimap-server-port (push nnimap-server-port ports)) - (destructuring-bind (stream greeting capabilities stream-type) - (open-protocol-stream - "*nnimap*" (current-buffer) nnimap-address (car ports) - :type nnimap-stream - :shell-command nnimap-shell-program - :capability-command "1 CAPABILITY\r\n" - :success " OK " - :starttls-function - (lambda (capabilities) - (when (gnus-string-match-p "STARTTLS" capabilities) - "1 STARTTLS\r\n"))) + (let* ((stream-list + (open-protocol-stream + "*nnimap*" (current-buffer) nnimap-address (car ports) + :type nnimap-stream + :return-list t + :shell-command nnimap-shell-program + :capability-command "1 CAPABILITY\r\n" + :success " OK " + :starttls-function + (lambda (capabilities) + (when (gnus-string-match-p "STARTTLS" capabilities) + "1 STARTTLS\r\n")))) + (stream (car stream-list)) + (props (cdr stream-list)) + (greeting (plist-get props :greeting)) + (capabilities (plist-get props :capabilities)) + (stream-type (plist-get props :type))) + (when (and stream (not (memq (process-status stream) '(open run)))) + (setq stream nil)) (setf (nnimap-process nnimap-object) stream) (setf (nnimap-stream-type nnimap-object) stream-type) (if (not stream) === modified file 'lisp/gnus/nntp.el' --- lisp/gnus/nntp.el 2011-02-28 01:07:29 +0000 +++ lisp/gnus/nntp.el 2011-03-26 23:18:42 +0000 @@ -1339,26 +1339,26 @@ (condition-case err (let ((coding-system-for-read nntp-coding-system-for-read) (coding-system-for-write nntp-coding-system-for-write) - (map '((nntp-open-network-stream network) - (network-only network-only) + (map '((nntp-open-network-stream try-starttls) + (network-only default) (nntp-open-ssl-stream tls) (nntp-open-tls-stream tls)))) (if (assoc nntp-open-connection-function map) - (car (open-protocol-stream - "nntpd" pbuffer nntp-address nntp-port-number - :type (cadr - (assoc nntp-open-connection-function map)) - :end-of-command "^\\([2345]\\|[.]\\).*\n" - :capability-command "CAPABILITIES\r\n" - :success "^3" - :starttls-function - (lambda (capabilities) - (if (not (string-match "STARTTLS" capabilities)) - nil - "STARTTLS\r\n")))) + (open-protocol-stream + "nntpd" pbuffer nntp-address nntp-port-number + :type (or (cadr (assoc nntp-open-connection-function map)) + 'try-starttls) + :end-of-command "^\\([2345]\\|[.]\\).*\n" + :capability-command "CAPABILITIES\r\n" + :success "^3" + :starttls-function + (lambda (capabilities) + (if (not (string-match "STARTTLS" capabilities)) + nil + "STARTTLS\r\n"))) (funcall nntp-open-connection-function pbuffer))) (error - (nnheader-report 'nntp "%s" err)) + (nnheader-report 'nntp ">>> %s" err)) (quit (message "Quit opening connection to %s" nntp-address) (nntp-kill-buffer pbuffer) @@ -1366,6 +1366,9 @@ nil)))) (when timer (nnheader-cancel-timer timer)) + (when (and process + (not (memq (process-status process) '(open run)))) + (setq process nil)) (unless process (nntp-kill-buffer pbuffer)) (when (and (buffer-name pbuffer) === modified file 'lisp/gnus/proto-stream.el' --- lisp/gnus/proto-stream.el 2011-02-06 22:27:28 +0000 +++ lisp/gnus/proto-stream.el 2011-03-26 23:18:42 +0000 @@ -37,7 +37,7 @@ ;; (open-protocol-stream ;; "*nnimap*" buffer address port -;; :type 'network +;; :type 'try-starttls ;; :capability-command "1 CAPABILITY\r\n" ;; :success " OK " ;; :starttls-function @@ -48,171 +48,164 @@ ;;; Code: -(eval-when-compile - (require 'cl)) (require 'tls) (require 'starttls) -(require 'format-spec) - -(defcustom proto-stream-always-use-starttls (fboundp 'open-gnutls-stream) - "If non-nil, always try to upgrade network connections with STARTTLS." - :version "24.1" - :type 'boolean - :group 'comm) (declare-function gnutls-negotiate "gnutls" (proc type &optional priority-string trustfiles keyfiles)) ;;;###autoload (defun open-protocol-stream (name buffer host service &rest parameters) - "Open a network stream to HOST, upgrading to STARTTLS if possible. -The first four parameters have the same meaning as in -`open-network-stream'. The function returns a list where the -first element is the stream, the second element is the greeting -the server replied with after connecting, and the third element -is a string representing the capabilities of the server (if any). - -The PARAMETERS is a keyword list that can have the following -values: - -:type -- either `network', `network-only, `tls', `shell' or -`starttls'. If omitted, the default is `network'. `network' -will be opportunistically upgraded to STARTTLS if both the server -and Emacs supports it. If you don't want STARTTLS upgrades, use -`network-only'. - -:end-of-command -- a regexp saying what the end of a command is. -This defaults to \"\\n\". - -:success -- a regexp saying whether the STARTTLS command was -successful or not. For instance, for NNTP this is \"^3\". - -:capability-command -- a string representing the command used to -query server for capabilities. For instance, for IMAP this is -\"1 CAPABILITY\\r\\n\". - -:starttls-function -- a function that takes one parameter, which -is the response to the capaibility command. It should return nil -if it turns out that the server doesn't support STARTTLS, or the -command to switch on STARTTLS otherwise. - -The return value from this function is a four-element list, where -the first element is the stream (if connection was successful); -the second element is the \"greeting\", i. e., the string the -server sent over on initial contact; the third element is the -capability string; and the fourth element is either `network' or -`tls', depending on whether the connection ended up being -encrypted or not." - (let ((type (or (cadr (memq :type parameters)) 'network))) - (cond - ((eq type 'starttls) - (setq type 'network)) - ((eq type 'ssl) - (setq type 'tls))) - (let ((open-result - (funcall (intern (format "proto-stream-open-%s" type) obarray) - name buffer host service parameters))) - (if (null open-result) - (list nil nil nil type) - (let ((stream (car open-result))) - (list (and stream - (memq (process-status stream) - '(open run)) - stream) - (nth 1 open-result) - (nth 2 open-result) - (nth 3 open-result))))))) - -(defun proto-stream-open-network-only (name buffer host service parameters) + "Open a network stream to HOST, possibly with encryption. +Normally, return a network process object; with a non-nil +:return-list parameter, return a list instead (see below). + +The first four parameters, NAME, BUFFER, HOST, and SERVICE, have +the same meanings as in `open-network-stream'. The remaining +PARAMETERS should be a sequence of keywords and values: + +:type specifies the connection type, one of the following: + `default' -- An ordinary network connection. + `try-starttls' + -- Begin an ordinary network connection, and try + upgrading it to an encrypted connection via + STARTTLS if both HOST and Emacs support TLS. If + that fails, keep the unencrypted connection. + `starttls' -- Begin an ordinary connection, and try upgrading + it via STARTTLS. If that fails for any reason, + drop the connection; in this case, the returned + process object is a killed process. + `tls' or `ssl' -- A TLS connection. + `shell' -- A shell connection. + +:return-list specifies this function's return value. + If omitted or nil, return a process object. A non-nil means to + return (PROC . PROPS), where PROC is a process object and PROPS + is a plist of connection properties, with these keywords: + :greeting -- the greeting returned by HOST (a string), or nil. + :capabilities -- a string representing HOST's capabilities, + or nil if none could be found. + :type -- the actual connection type; either `default' for an + unencrypted connection, or `tls'. + +:end-of-command specifies a regexp matching the end of a command. + If non-nil, it defaults to \"\\n\". + +:success specifies a regexp matching a message indicating a + successful STARTTLS negotiation. For instance, the default + should be \"^3\" for an NNTP connection. If this is not + supplied, STARTTLS will always fail. + +:capability-command specifies a command used to query the HOST + for its capabilities. For instance, for IMAP this should be + \"1 CAPABILITY\\r\\n\". + +:starttls-function specifies a function for handling STARTTLS. + This function should take one parameter, the response to the + capability command, and should return the command to switch on + STARTTLS if the server supports STARTTLS, and nil otherwise." + (let ((type (plist-get parameters :type)) + (return-list (plist-get parameters :return-list))) + (if (and (null return-list) (memq type '(nil default))) + ;; The simplest case---no encryption, and no need to report + ;; connection properties. Like `open-network-stream', this + ;; doesn't read anything into BUFFER yet. + (open-network-stream name buffer host service) + ;; For everything else, refer to proto-stream-open-*. + (unless (plist-get parameters :end-of-command) + (setq parameters + (append '(:end-of-command "\r\n") parameters))) + (let* ((connection-function + (cond + ((memq type '(nil default)) + 'proto-stream-open-default) + ((memq type '(try-starttls starttls)) + 'proto-stream-open-starttls) + ((memq type '(tls ssl)) + 'proto-stream-open-tls) + ((eq type 'shell) + 'proto-stream-open-shell) + (t + (error "Invalid connection type %s" type)))) + (result (funcall connection-function + name buffer host service parameters))) + (if return-list + (list (car result) + :greeting (nth 1 result) + :capabilities (nth 2 result) + :type (nth 3 result)) + (car result)))))) + +(defun proto-stream-open-default (name buffer host service parameters) (let ((start (with-current-buffer buffer (point))) (stream (open-network-stream name buffer host service))) (list stream - (proto-stream-get-response - stream start (proto-stream-eoc parameters)) + (proto-stream-get-response stream start + (plist-get parameters :end-of-command)) nil - 'network))) + 'default))) -(defun proto-stream-open-network (name buffer host service parameters) +(defun proto-stream-open-starttls (name buffer host service parameters) (let* ((start (with-current-buffer buffer (point))) + ;; This should be `starttls' or `try-starttls'. + (type (plist-get parameters :type)) + (starttls-function (plist-get parameters :starttls-function)) + (success-string (plist-get parameters :success)) + (capability-command (plist-get parameters :capability-command)) + (eoc (plist-get parameters :end-of-command)) + ;; Return (STREAM GREETING CAPABILITIES RESULTING-TYPE) (stream (open-network-stream name buffer host service)) - (capability-command (cadr (memq :capability-command parameters))) - (eoc (proto-stream-eoc parameters)) - (type (cadr (memq :type parameters))) (greeting (proto-stream-get-response stream start eoc)) - success) - (if (not capability-command) - (list stream greeting nil 'network) - (let* ((capabilities - (proto-stream-command stream capability-command eoc)) - (starttls-command - (funcall (cadr (memq :starttls-function parameters)) - capabilities))) - (cond - ;; If this server doesn't support STARTTLS, but we have - ;; requested it explicitly, then close the connection and - ;; return nil. - ((or (not starttls-command) - (and (not (eq type 'starttls)) - (not proto-stream-always-use-starttls))) - (if (eq type 'starttls) - (progn - (delete-process stream) - nil) - ;; Otherwise, just return this plain network connection. - (list stream greeting capabilities 'network))) - ;; We have some kind of STARTTLS support, so we try to - ;; upgrade the connection opportunistically. - ((or (fboundp 'open-gnutls-stream) - (executable-find "gnutls-cli")) - (unless (fboundp 'open-gnutls-stream) - (delete-process stream) - (setq start (with-current-buffer buffer (point-max))) - (let* ((starttls-use-gnutls t) - (starttls-extra-arguments - (if (not (eq type 'starttls)) - ;; When doing opportunistic TLS upgrades we - ;; don't really care about the identity of the - ;; peer. - (cons "--insecure" starttls-extra-arguments) - starttls-extra-arguments))) - (setq stream (starttls-open-stream name buffer host service))) - (proto-stream-get-response stream start eoc)) - (if (not - (string-match - (cadr (memq :success parameters)) - (proto-stream-command stream starttls-command eoc))) - ;; We got an error back from the STARTTLS command. - (progn - (if (eq type 'starttls) - (progn - (delete-process stream) - nil) - (list stream greeting capabilities 'network))) - ;; The server said it was OK to start doing STARTTLS negotiations. - (if (fboundp 'open-gnutls-stream) - (gnutls-negotiate stream nil) - (unless (starttls-negotiate stream) - (delete-process stream) - (setq stream nil))) - (when (or (null stream) - (not (memq (process-status stream) - '(open run)))) - ;; It didn't successfully negotiate STARTTLS, so we reopen - ;; the connection. - (setq stream (open-network-stream name buffer host service)) - (proto-stream-get-response stream start eoc)) - ;; Re-get the capabilities, since they may have changed - ;; after switching to TLS. - (list stream greeting - (proto-stream-command stream capability-command eoc) 'tls))) - ;; We don't have STARTTLS support available, but the caller - ;; requested a STARTTLS connection, so we give up. - ((eq (cadr (memq :type parameters)) 'starttls) - (delete-process stream) - nil) - ;; Fall back on using a plain network stream. - (t - (list stream greeting capabilities 'network))))))) + (capabilities (when capability-command + (proto-stream-command stream + capability-command eoc))) + (resulting-type 'default) + starttls-command) + + ;; If we have STARTTLS support, try to upgrade the connection. + (when (and (or (fboundp 'open-gnutls-stream) + (executable-find "gnutls-cli")) + capabilities success-string starttls-function + (setq starttls-command + (funcall starttls-function capabilities))) + ;; If using external STARTTLS, drop this connection and start + ;; anew with `starttls-open-stream'. + (unless (fboundp 'open-gnutls-stream) + (delete-process stream) + (setq start (with-current-buffer buffer (point-max))) + (let* ((starttls-use-gnutls t) + (starttls-extra-arguments + (if (not (eq type 'starttls)) + ;; For opportunistic TLS upgrades, we don't + ;; really care about the identity of the peer. + (cons "--insecure" starttls-extra-arguments) + starttls-extra-arguments))) + (setq stream (starttls-open-stream name buffer host service))) + (proto-stream-get-response stream start eoc)) + (when (string-match success-string + (proto-stream-command stream starttls-command eoc)) + ;; The server said it was OK to begin STARTTLS negotiations. + (if (fboundp 'open-gnutls-stream) + (gnutls-negotiate stream nil) + (unless (starttls-negotiate stream) + (delete-process stream))) + (if (memq (process-status stream) '(open run)) + (setq resulting-type 'tls) + ;; We didn't successfully negotiate STARTTLS; if TLS + ;; isn't demanded, reopen an unencrypted connection. + (when (eq type 'try-starttls) + (setq stream (open-network-stream name buffer host service)) + (proto-stream-get-response stream start eoc))) + ;; Re-get the capabilities, which may have now changed. + (setq capabilities + (proto-stream-command stream capability-command eoc)))) + + ;; If TLS is mandatory, close the connection if it's unencrypted. + (and (eq type 'starttls) + (eq resulting-type 'default) + (delete-process stream)) + ;; Return value: + (list stream greeting capabilities resulting-type))) (defun proto-stream-command (stream command eoc) (let ((start (with-current-buffer (process-buffer stream) (point-max)))) @@ -241,47 +234,43 @@ (funcall (if (fboundp 'open-gnutls-stream) 'open-gnutls-stream 'open-tls-stream) - name buffer host service))) + name buffer host service)) + (eoc (plist-get parameters :end-of-command))) (if (null stream) - nil + (list nil nil nil 'default) ;; If we're using tls.el, we have to delete the output from ;; openssl/gnutls-cli. (unless (fboundp 'open-gnutls-stream) - (proto-stream-get-response - stream start (proto-stream-eoc parameters)) + (proto-stream-get-response stream start eoc) (goto-char (point-min)) - (when (re-search-forward (proto-stream-eoc parameters) nil t) + (when (re-search-forward eoc nil t) (goto-char (match-beginning 0)) (delete-region (point-min) (line-beginning-position)))) (proto-stream-capability-open start stream parameters 'tls))))) (defun proto-stream-open-shell (name buffer host service parameters) + (require 'format-spec) (proto-stream-capability-open (with-current-buffer buffer (point)) (let ((process-connection-type nil)) (start-process name buffer shell-file-name shell-command-switch (format-spec - (cadr (memq :shell-command parameters)) + (plist-get parameters :shell-command) (format-spec-make ?s host ?p service)))) - parameters 'network)) + parameters 'default)) (defun proto-stream-capability-open (start stream parameters stream-type) - (let ((capability-command (cadr (memq :capability-command parameters))) - (greeting (proto-stream-get-response - stream start (proto-stream-eoc parameters)))) + (let* ((capability-command (plist-get parameters :capability-command)) + (eoc (plist-get parameters :end-of-command)) + (greeting (proto-stream-get-response stream start eoc))) (list stream greeting (and capability-command - (proto-stream-command - stream capability-command (proto-stream-eoc parameters))) + (proto-stream-command stream capability-command eoc)) stream-type))) -(defun proto-stream-eoc (parameters) - (or (cadr (memq :end-of-command parameters)) - "\r\n")) - (provide 'proto-stream) ;;; proto-stream.el ends here ------------------------------------------------------------ revno: 103757 committer: Glenn Morris branch nick: trunk timestamp: Sat 2011-03-26 12:29:10 -0700 message: Replace some obsolete autoconf macros with their modern equivalents. * configure.in: Replace obsolete macros AC_TRY_COMPILE, AC_TRY_LINK, AC_TRY_RUN with AC_COMPILE_IFELSE, AC_LINK_IFELSE, AC_RUN_IFELSE. diff: === modified file 'ChangeLog' --- ChangeLog 2011-03-25 18:16:41 +0000 +++ ChangeLog 2011-03-26 19:29:10 +0000 @@ -1,3 +1,8 @@ +2011-03-26 Glenn Morris + + * configure.in: Replace obsolete macros AC_TRY_COMPILE, AC_TRY_LINK, + AC_TRY_RUN with AC_COMPILE_IFELSE, AC_LINK_IFELSE, AC_RUN_IFELSE. + 2011-03-25 Andreas Schwab * autogen/update_autogen: Remove useless function keyword. === modified file 'configure.in' --- configure.in 2011-03-23 03:09:55 +0000 +++ configure.in 2011-03-26 19:29:10 +0000 @@ -664,11 +664,11 @@ test x"$CPP" = x; then AC_MSG_CHECKING([whether we are using a Sun C compiler]) AC_CACHE_VAL(emacs_cv_sunpro_c, - [AC_TRY_LINK([], -[#ifndef __SUNPRO_C + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], +[[#ifndef __SUNPRO_C fail; #endif -], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)]) +]])], emacs_cv_sunpro_c=yes, emacs_cv_sunpro_c=no)]) AC_MSG_RESULT($emacs_cv_sunpro_c) if test x"$emacs_cv_sunpro_c" = xyes; then @@ -703,7 +703,7 @@ AC_MSG_CHECKING([whether gcc understands -Wdeclaration-after-statement]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wdeclaration-after-statement" -AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) if test $has_option = yes; then C_WARNINGS_SWITCH="-Wdeclaration-after-statement $C_WARNINGS_SWITCH" fi @@ -717,7 +717,7 @@ AC_MSG_CHECKING([whether gcc understands -Wold-style-definition]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wold-style-definition" -AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) if test $has_option = yes; then C_WARNINGS_SWITCH="-Wold-style-definition $C_WARNINGS_SWITCH" fi @@ -730,7 +730,7 @@ AC_MSG_CHECKING([whether gcc understands -Wimplicit-function-declaration]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wimplicit-function-declaration" -AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], has_option=yes, has_option=no) if test $has_option = yes; then C_WARNINGS_SWITCH="-Wimplicit-function-declaration $C_WARNINGS_SWITCH" fi @@ -1137,12 +1137,12 @@ SAVE_LDFLAGS="$LDFLAGS" CFLAGS="$ALSA_CFLAGS $CFLAGS" LDFLAGS="$ALSA_LIBS $LDFLAGS" - AC_TRY_COMPILE([#include ], [snd_lib_error_set_handler (0);], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[snd_lib_error_set_handler (0);]])], emacs_alsa_normal=yes, emacs_alsa_normal=no) if test "$emacs_alsa_normal" != yes; then - AC_TRY_COMPILE([#include ], - [snd_lib_error_set_handler (0);], + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[snd_lib_error_set_handler (0);]])], emacs_alsa_subdir=yes, emacs_alsa_subdir=no) if test "$emacs_alsa_subdir" != yes; then @@ -1181,7 +1181,7 @@ sys/utsname.h pwd.h utmp.h dirent.h util.h) AC_MSG_CHECKING(if personality LINUX32 can be set) -AC_TRY_COMPILE([#include ], [personality (PER_LINUX32)], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[personality (PER_LINUX32)]])], emacs_cv_personality_linux32=yes, emacs_cv_personality_linux32=no) AC_MSG_RESULT($emacs_cv_personality_linux32) @@ -1209,7 +1209,7 @@ dnl Some systems have utime.h but don't declare the struct anyplace. AC_CACHE_CHECK(for struct utimbuf, emacs_cv_struct_utimbuf, -AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME #include #include #else @@ -1221,7 +1221,7 @@ #endif #ifdef HAVE_UTIME_H #include -#endif], [static struct utimbuf x; x.actime = x.modtime;], +#endif]], [[static struct utimbuf x; x.actime = x.modtime;]])], emacs_cv_struct_utimbuf=yes, emacs_cv_struct_utimbuf=no)) if test $emacs_cv_struct_utimbuf = yes; then AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1, [Define to 1 if `struct utimbuf' is declared by .]) @@ -1232,7 +1232,7 @@ dnl Check for speed_t typedef. AC_CACHE_CHECK(for speed_t, emacs_cv_speed_t, - [AC_TRY_COMPILE([#include ], [speed_t x = 1;], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[speed_t x = 1;]])], emacs_cv_speed_t=yes, emacs_cv_speed_t=no)]) if test $emacs_cv_speed_t = yes; then AC_DEFINE(HAVE_SPEED_T, 1, @@ -1240,7 +1240,7 @@ fi AC_CACHE_CHECK(for struct timeval, emacs_cv_struct_timeval, -AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME #include #include #else @@ -1249,7 +1249,7 @@ #else #include #endif -#endif], [static struct timeval x; x.tv_sec = x.tv_usec;], +#endif]], [[static struct timeval x; x.tv_sec = x.tv_usec;]])], emacs_cv_struct_timeval=yes, emacs_cv_struct_timeval=no)) HAVE_TIMEVAL=$emacs_cv_struct_timeval if test $emacs_cv_struct_timeval = yes; then @@ -1257,8 +1257,8 @@ fi AC_CACHE_CHECK(for struct exception, emacs_cv_struct_exception, -AC_TRY_COMPILE([#include ], -[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;]])], emacs_cv_struct_exception=yes, emacs_cv_struct_exception=no)) HAVE_EXCEPTION=$emacs_cv_struct_exception if test $emacs_cv_struct_exception != yes; then @@ -1301,7 +1301,7 @@ dnl the compiler groks `extern inline'. dnl AC_C_INLINE AC_CACHE_CHECK([for void * support], emacs_cv_void_star, - [AC_TRY_COMPILE(, [void * foo;], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[void * foo;]])], emacs_cv_void_star=yes, emacs_cv_void_star=no)]) if test $emacs_cv_void_star = yes; then AC_DEFINE(POINTER_TYPE, void) @@ -1349,7 +1349,7 @@ AC_MSG_CHECKING([whether gcc understands -MMD -MF]) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -MMD -MF deps.d" - AC_TRY_COMPILE([], [], , ac_enable_autodepend=no) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], , ac_enable_autodepend=no) CFLAGS="$SAVE_CFLAGS" test -f deps.d || ac_enable_autodepend=no rm -rf deps.d @@ -1582,7 +1582,7 @@ AC_CHECK_FUNC(malloc_set_state, ,doug_lea_malloc=no) AC_CACHE_CHECK(whether __after_morecore_hook exists, emacs_cv_var___after_morecore_hook, -[AC_TRY_LINK([extern void (* __after_morecore_hook)();],[__after_morecore_hook = 0], +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern void (* __after_morecore_hook)();]],[[__after_morecore_hook = 0]])], emacs_cv_var___after_morecore_hook=yes, emacs_cv_var___after_morecore_hook=no)]) if test $emacs_cv_var___after_morecore_hook = no; then @@ -1680,7 +1680,7 @@ esac LDFLAGS=$LDFLAGS\ $gdb_cv_bigtoc - AC_TRY_LINK([], [int i;], [], [gdb_cv_bigtoc=]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], [], [gdb_cv_bigtoc=]) ]) ;; esac @@ -1710,8 +1710,8 @@ if test "${opsys}" = "gnu-linux"; then AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link) - AC_TRY_LINK([], - [XOpenDisplay ("foo");], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[XOpenDisplay ("foo");]])], [xlinux_first_failure=no], [xlinux_first_failure=yes]) if test "${xlinux_first_failure}" = "yes"; then @@ -1723,8 +1723,8 @@ C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout" CPPFLAGS="$CPPFLAGS -b i486-linuxaout" LIBS="$LIBS -b i486-linuxaout" - AC_TRY_LINK([], - [XOpenDisplay ("foo");], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[XOpenDisplay ("foo");]])], [xlinux_second_failure=no], [xlinux_second_failure=yes]) if test "${xlinux_second_failure}" = "yes"; then @@ -1746,9 +1746,9 @@ # Reportedly, some broken Solaris systems have XKBlib.h but are missing # header files included from there. AC_MSG_CHECKING(for Xkb) - AC_TRY_LINK([#include -#include ], - [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);], + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include ]], + [[XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);]])], emacs_xkb=yes, emacs_xkb=no) AC_MSG_RESULT($emacs_xkb) if test $emacs_xkb = yes; then @@ -1762,11 +1762,11 @@ if test "${window_system}" = "x11"; then AC_MSG_CHECKING(X11 version 6) AC_CACHE_VAL(emacs_cv_x11_version_6, - [AC_TRY_LINK([#include ], -[#if XlibSpecificationRelease < 6 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[#if XlibSpecificationRelease < 6 fail; #endif -], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)]) +]])], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)]) if test $emacs_cv_x11_version_6 = yes; then AC_MSG_RESULT(6 or newer) AC_DEFINE(HAVE_X11R6, 1, @@ -1989,10 +1989,10 @@ if test "$with_xaw3d" != no; then AC_MSG_CHECKING(for xaw3d) AC_CACHE_VAL(emacs_cv_xaw3d, - [AC_TRY_LINK([ + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -#include ], - [], +#include ]], + [[]])], [AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, emacs_cv_xaw3d=yes, emacs_cv_xaw3d=no)], emacs_cv_xaw3d=no)]) @@ -2010,10 +2010,10 @@ AC_MSG_RESULT(no) AC_MSG_CHECKING(for libXaw) AC_CACHE_VAL(emacs_cv_xaw, - [AC_TRY_LINK([ + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include -#include ], - [], +#include ]], + [[]])], emacs_cv_xaw=yes, emacs_cv_xaw=no)]) if test $emacs_cv_xaw = yes; then @@ -2035,11 +2035,11 @@ if test "${USE_X_TOOLKIT}" != "none"; then AC_MSG_CHECKING(X11 toolkit version) AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6, - [AC_TRY_LINK([#include ], -[#if XtSpecificationRelease < 6 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[#if XtSpecificationRelease < 6 fail; #endif -], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)]) +]])], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)]) HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6 if test $emacs_cv_x11_toolkit_version_6 = yes; then AC_MSG_RESULT(6 or newer) @@ -2088,12 +2088,12 @@ LIBXP= if test "${USE_X_TOOLKIT}" = "MOTIF"; then AC_CACHE_CHECK(for Motif version 2.1, emacs_cv_motif_version_2_1, - [AC_TRY_COMPILE([#include ], - [#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1) + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1) int x = 5; #else Motif version prior to 2.1. -#endif], +#endif]])], emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)]) if test $emacs_cv_motif_version_2_1 = yes; then AC_CHECK_LIB(Xp, XpCreateContext, LIBXP=-lXp) @@ -2106,8 +2106,8 @@ OLD_CFLAGS=$CFLAGS CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS" CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS" - [AC_TRY_COMPILE([#include ], - [int x = 5;], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[int x = 5;]])], emacs_cv_lesstif=yes, emacs_cv_lesstif=no)]) if test $emacs_cv_lesstif = yes; then # Make sure this -I option remains in CPPFLAGS after it is set @@ -2151,10 +2151,10 @@ fi dnl See if XIM is available. -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include - #include ], - [XIMProc callback;], + #include ]], + [[XIMProc callback;]])], [HAVE_XIM=yes AC_DEFINE(HAVE_XIM, 1, [Define to 1 if XIM is available])], HAVE_XIM=no) @@ -2172,10 +2172,10 @@ if test "$GCC" = yes; then CFLAGS="$CFLAGS --pedantic-errors" fi - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include -#include ], -[Display *display; +#include ]], +[[Display *display; XrmDatabase db; char *res_name; char *res_class; @@ -2188,7 +2188,7 @@ char*, XIMProc, XPointer*); #endif (void)XRegisterIMInstantiateCallback(display, db, res_name, res_class, callback, - client_data);], + client_data);]])], [emacs_cv_arg6_star=yes]) AH_TEMPLATE(XRegisterIMInstantiateCallback_arg6, [Define to the type of the 6th arg of XRegisterIMInstantiateCallback, @@ -2540,8 +2540,8 @@ # If netdb.h doesn't declare h_errno, we must declare it by hand. AC_CACHE_CHECK(whether netdb declares h_errno, emacs_cv_netdb_declares_h_errno, -[AC_TRY_LINK([#include ], - [return h_errno;], +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[return h_errno;]])], emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)]) if test $emacs_cv_netdb_declares_h_errno = yes; then AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.]) @@ -2722,11 +2722,11 @@ freebsd) AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo]) AC_CACHE_VAL(emacs_cv_freebsd_terminfo, - [AC_TRY_LINK([#include ], -[#if __FreeBSD_version < 400000 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], +[[#if __FreeBSD_version < 400000 fail; #endif -], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)]) +]])], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)]) AC_MSG_RESULT($emacs_cv_freebsd_terminfo) @@ -2776,19 +2776,19 @@ # Do we have res_init, for detecting changes in /etc/resolv.conf? resolv=no -AC_TRY_LINK([#include +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include -#include ], - [return res_init();], +#include ]], + [[return res_init();]])], have_res_init=yes, have_res_init=no) if test "$have_res_init" = no; then OLIBS="$LIBS" LIBS="$LIBS -lresolv" AC_MSG_CHECKING(for res_init with -lresolv) - AC_TRY_LINK([#include + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include -#include ], - [return res_init();], +#include ]], + [[return res_init();]])], have_res_init=yes, have_res_init=no) AC_MSG_RESULT($have_res_init) if test "$have_res_init" = yes ; then @@ -2924,7 +2924,7 @@ AC_MSG_CHECKING(whether localtime caches TZ) AC_CACHE_VAL(emacs_cv_localtime_cache, [if test x$ac_cv_func_tzset = xyes; then -AC_TRY_RUN([#include +AC_RUN_IFELSE([AC_LANG_SOURCE([[#include char TZ_GMT0[] = "TZ=GMT0"; char TZ_PST8[] = "TZ=PST8"; main() @@ -2944,7 +2944,7 @@ if (localtime (&now)->tm_hour != hour_unset) exit (1); exit (0); -}], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes, +}]])], emacs_cv_localtime_cache=no, emacs_cv_localtime_cache=yes, [# If we have tzset, assume the worst when cross-compiling. emacs_cv_localtime_cache=yes]) else @@ -2963,7 +2963,7 @@ if test $ac_cv_func_gettimeofday = yes; then AC_CACHE_CHECK(whether gettimeofday can accept two arguments, emacs_cv_gettimeofday_two_arguments, - [AC_TRY_COMPILE([ + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef TIME_WITH_SYS_TIME #include #include @@ -2973,9 +2973,9 @@ #else #include #endif -#endif], - [struct timeval time; - gettimeofday (&time, 0);], +#endif]], + [[struct timeval time; + gettimeofday (&time, 0);]])], emacs_cv_gettimeofday_two_arguments=yes, emacs_cv_gettimeofday_two_arguments=no)]) if test $emacs_cv_gettimeofday_two_arguments = no; then @@ -3016,8 +3016,8 @@ dnl Adapted from Haible's version. AC_CACHE_CHECK([for nl_langinfo and CODESET], emacs_cv_langinfo_codeset, - [AC_TRY_LINK([#include ], - [char* cs = nl_langinfo(CODESET);], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[char* cs = nl_langinfo(CODESET);]])], emacs_cv_langinfo_codeset=yes, emacs_cv_langinfo_codeset=no) ]) @@ -3031,7 +3031,7 @@ AC_TYPE_MBSTATE_T AC_CACHE_CHECK([for C restricted array declarations], emacs_cv_c_restrict_arr, - [AC_TRY_COMPILE([void fred (int x[__restrict]);], [], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[void fred (int x[__restrict]);]], [[]])], emacs_cv_c_restrict_arr=yes, emacs_cv_c_restrict_arr=no)]) if test "$emacs_cv_c_restrict_arr" = yes; then AC_DEFINE(__restrict_arr, __restrict, ------------------------------------------------------------ revno: 103756 committer: Eli Zaretskii branch nick: trunk timestamp: Sat 2011-03-26 14:20:20 +0200 message: Call try_scrolling even if buffer's clip_changed flag is set. src/xdisp.c (redisplay_window): Don't check buffer's clip_changed flag as a prerequisite for invoking try_scrolling. (Bug#6671) diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-26 02:48:03 +0000 +++ src/ChangeLog 2011-03-26 12:20:20 +0000 @@ -1,3 +1,8 @@ +2011-03-26 Eli Zaretskii + + * xdisp.c (redisplay_window): Don't check buffer's clip_changed + flag as a prerequisite for invoking try_scrolling. (Bug#6671) + 2011-03-26 Juanma Barranquero * w32.c (read_unc_volume): Use parameter `henum', instead of === modified file 'src/xdisp.c' --- src/xdisp.c 2011-03-25 20:00:25 +0000 +++ src/xdisp.c 2011-03-26 12:20:20 +0000 @@ -14176,7 +14176,6 @@ || temp_scroll_step || NUMBERP (BVAR (current_buffer, scroll_up_aggressively)) || NUMBERP (BVAR (current_buffer, scroll_down_aggressively))) - && !current_buffer->clip_changed && CHARPOS (startp) >= BEGV && CHARPOS (startp) <= ZV) { ------------------------------------------------------------ revno: 103755 committer: Juanma Barranquero branch nick: trunk timestamp: Sat 2011-03-26 03:48:03 +0100 message: src/*.c: Fix more warnings about unused parameters. * keymap.c (describe_vector): Remove parameters `indices' and `char_table_depth', unused since revno:43563.1.32 (2002-03-01). (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'. * w32.c (read_unc_volume): Use parameter `henum', instead of global variable `wget_enum_handle'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-03-26 01:23:15 +0000 +++ src/ChangeLog 2011-03-26 02:48:03 +0000 @@ -1,5 +1,12 @@ 2011-03-26 Juanma Barranquero + * w32.c (read_unc_volume): Use parameter `henum', instead of + global variable `wget_enum_handle'. + + * keymap.c (describe_vector): Remove parameters `indices' and + `char_table_depth', unused since revno:43563.1.32 (2002-03-01). + (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'. + * keyboard.h (timer_check, show_help_echo): Remove unused parameters. * keyboard.c (timer_check): Remove parameter `do_it_now', === modified file 'src/keymap.c' --- src/keymap.c 2011-03-14 15:53:19 +0000 +++ src/keymap.c 2011-03-26 02:48:03 +0000 @@ -81,8 +81,7 @@ int, Lisp_Object, Lisp_Object*, int, int); static void describe_vector (Lisp_Object, Lisp_Object, Lisp_Object, void (*) (Lisp_Object, Lisp_Object), int, - Lisp_Object, Lisp_Object, int *, - int, int, int); + Lisp_Object, Lisp_Object, int, int); static void silly_event_symbol_error (Lisp_Object); static Lisp_Object get_keyelt (Lisp_Object, int); @@ -3353,7 +3352,7 @@ || CHAR_TABLE_P (XCAR (tail))) describe_vector (XCAR (tail), prefix, Qnil, elt_describer, partial, shadow, map, - (int *)0, 0, 1, mention_shadow); + 1, mention_shadow); else if (CONSP (XCAR (tail))) { int this_shadowed = 0; @@ -3506,7 +3505,7 @@ specbind (Qstandard_output, Fcurrent_buffer ()); CHECK_VECTOR_OR_CHAR_TABLE (vector); describe_vector (vector, Qnil, describer, describe_vector_princ, 0, - Qnil, Qnil, (int *)0, 0, 0, 0); + Qnil, Qnil, 0, 0); return unbind_to (count, Qnil); } @@ -3539,9 +3538,6 @@ ARGS is simply passed as the second argument to ELT_DESCRIBER. - INDICES and CHAR_TABLE_DEPTH are ignored. They will be removed in - the near future. - KEYMAP_P is 1 if vector is known to be a keymap, so map ESC to M-. ARGS is simply passed as the second argument to ELT_DESCRIBER. */ @@ -3550,8 +3546,7 @@ describe_vector (Lisp_Object vector, Lisp_Object prefix, Lisp_Object args, void (*elt_describer) (Lisp_Object, Lisp_Object), int partial, Lisp_Object shadow, Lisp_Object entire_map, - int *indices, int char_table_depth, int keymap_p, - int mention_shadow) + int keymap_p, int mention_shadow) { Lisp_Object definition; Lisp_Object tem2; === modified file 'src/w32.c' --- src/w32.c 2011-03-25 15:39:59 +0000 +++ src/w32.c 2011-03-26 02:48:03 +0000 @@ -2376,8 +2376,8 @@ if (wnet_enum_handle != INVALID_HANDLE_VALUE) { if (!read_unc_volume (wnet_enum_handle, - dir_find_data.cFileName, - MAX_PATH)) + dir_find_data.cFileName, + MAX_PATH)) return NULL; } /* If we aren't dir_finding, do a find-first, otherwise do a find-next. */ @@ -2487,7 +2487,7 @@ count = 1; buffer = alloca (bufsize); - result = WNetEnumResource (wnet_enum_handle, &count, buffer, &bufsize); + result = WNetEnumResource (henum, &count, buffer, &bufsize); if (result != NO_ERROR) return NULL;