Using saved parent location: http://bzr.savannah.gnu.org/r/emacs/trunk/ Now on revision 101175. ------------------------------------------------------------ revno: 101175 committer: Michael Albinus branch nick: trunk timestamp: Mon 2010-08-23 15:57:55 +0200 message: * NEWS: dbus.el supports alternative buses. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2010-08-14 08:46:48 +0000 +++ etc/ChangeLog 2010-08-23 13:57:55 +0000 @@ -1,3 +1,7 @@ +2010-08-23 Michael Albinus + + * NEWS: dbus.el supports alternative buses. + 2010-08-14 Eli Zaretskii * tutorials/TUTORIAL.he: Use MAQAF instead of hyphen where appropriate. === modified file 'etc/NEWS' --- etc/NEWS 2010-08-22 21:15:20 +0000 +++ etc/NEWS 2010-08-23 13:57:55 +0000 @@ -413,6 +413,11 @@ supports multithread non-stop debugging and debugging of several threads simultaneously. +** D-Bus + +*** It is possible now, to access alternative buses than the default +system or session bus. + * New Modes and Packages in Emacs 24.1 ------------------------------------------------------------ revno: 101174 committer: Michael Albinus branch nick: trunk timestamp: Mon 2010-08-23 15:48:48 +0200 message: * dbus.texi (Alternative Buses): New chapter. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2010-08-12 09:02:02 +0000 +++ doc/misc/ChangeLog 2010-08-23 13:48:48 +0000 @@ -1,3 +1,7 @@ +2010-08-23 Michael Albinus + + * dbus.texi (Alternative Buses): New chapter. + 2010-08-12 Stefan Monnier * cl.texi (Mapping over Sequences): Rename mapc => cl-mapc. === modified file 'doc/misc/dbus.texi' --- doc/misc/dbus.texi 2010-07-09 19:24:38 +0000 +++ doc/misc/dbus.texi 2010-08-23 13:48:48 +0000 @@ -53,6 +53,7 @@ * Asynchronous Methods:: Calling methods non-blocking. * Receiving Method Calls:: Offering own methods. * Signals:: Sending and receiving signals. +* Alternative Buses:: Alternative buses. * Errors and Events:: Errors and events. * Index:: Index including concepts, functions, variables. @@ -1579,6 +1580,56 @@ @end defun +@node Alternative Buses +@chapter Alternative buses. +@cindex bus names +@cindex UNIX domain socket + +Until now, we have spoken about the system and the session buses, +which are the default buses to be connected to. However, it is +possible to connect to any bus, from which the address is known. This +is a UNIX domain socket. Everywhere, where a @var{bus} is mentioned +as argument of a function (the symbol @code{:system} or the symbol +@code{:session}), this address can be used instead. The connection to +this bus must be initialized first. + +@defun dbus-init-bus bus +Establish the connection to D-Bus @var{bus}. + +@var{bus} can be either the symbol @code{:system} or the symbol +@code{:session}, or it can be a string denoting the address of the +corresponding bus. For the system and session busses, this function +is called when loading @file{dbus.el}, there is no need to call it +again. + +Example: You open another session bus in a terminal window on your host: + +@example +# eval `dbus-launch --auto-syntax` +# echo $DBUS_SESSION_BUS_ADDRESS + +@print{} unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e +@end example + +In Emacs, you can access to this bus via its address: + +@lisp +(setq my-bus + "unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e") + +@result{} "unix:abstract=/tmp/dbus-JoFtAVG92w,guid=2f320a1ebe50b7ef58e" + +(dbus-init-bus my-bus) + +@result{} nil + +(dbus-get-unique-name my-bus) + +@result{} ":1.0" +@end lisp +@end defun + + @node Errors and Events @chapter Errors and events. @cindex debugging ------------------------------------------------------------ revno: 101173 committer: Michael Albinus branch nick: trunk timestamp: Mon 2010-08-23 15:08:54 +0200 message: * net/dbus.el: Accept UNIX domain sockets as bus address. (top): Don't initialize `dbus-registered-objects-table' anymore, this is done in dbusbind,c. (dbus-check-event): Adapt test for bus. (dbus-return-values-table, dbus-unregister-service) (dbus-event-bus-name, dbus-introspect, dbus-register-property): Adapt doc string. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-23 10:21:01 +0000 +++ lisp/ChangeLog 2010-08-23 13:08:54 +0000 @@ -1,3 +1,13 @@ +2010-08-23 Michael Albinus + + * net/dbus.el: Accept UNIX domain sockets as bus address. + (top): Don't initialize `dbus-registered-objects-table' anymore, + this is done in dbusbind,c. + (dbus-check-event): Adapt test for bus. + (dbus-return-values-table, dbus-unregister-service) + (dbus-event-bus-name, dbus-introspect, dbus-register-property): + Adapt doc string. + 2010-08-23 Juanma Barranquero * ido.el (ido-use-virtual-buffers): Fix typo in docstring. === modified file 'lisp/net/dbus.el' --- lisp/net/dbus.el 2010-07-04 14:32:00 +0000 +++ lisp/net/dbus.el 2010-08-23 13:08:54 +0000 @@ -108,15 +108,12 @@ ;;; Hash table of registered functions. -;; We create it here. So we have a simple test in dbusbind.c, whether -;; the Lisp code has been loaded. -(setq dbus-registered-objects-table (make-hash-table :test 'equal)) - (defvar dbus-return-values-table (make-hash-table :test 'equal) "Hash table for temporary storing arguments of reply messages. -A key in this hash table is a list (BUS SERIAL). BUS is either the -symbol `:system' or the symbol `:session'. SERIAL is the serial number -of the reply message. See `dbus-call-method-non-blocking-handler' and +A key in this hash table is a list (BUS SERIAL). BUS is either a +Lisp symbol, `:system' or `:session', or a string denoting the +bus address. SERIAL is the serial number of the reply message. +See `dbus-call-method-non-blocking-handler' and `dbus-call-method-non-blocking'.") (defun dbus-list-hash-table () @@ -187,8 +184,8 @@ (defun dbus-unregister-service (bus service) "Unregister all objects related to SERVICE from D-Bus BUS. -BUS must be either the symbol `:system' or the symbol `:session'. -SERVICE must be a known service name." +BUS is either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. SERVICE must be a known service name." (maphash (lambda (key value) (dolist (elt value) @@ -353,15 +350,15 @@ (dbus-event BUS TYPE SERIAL SERVICE PATH INTERFACE MEMBER HANDLER &rest ARGS) BUS identifies the D-Bus the message is coming from. It is -either the symbol `:system' or the symbol `:session'. TYPE is -the D-Bus message type which has caused the event, SERIAL is the -serial number of the received D-Bus message. SERVICE and PATH -are the unique name and the object path of the D-Bus object -emitting the message. INTERFACE and MEMBER denote the message -which has been sent. HANDLER is the function which has been -registered for this message. ARGS are the arguments passed to -HANDLER, when it is called during event handling in -`dbus-handle-event'. +either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. TYPE is the D-Bus message type which +has caused the event, SERIAL is the serial number of the received +D-Bus message. SERVICE and PATH are the unique name and the +object path of the D-Bus object emitting the message. INTERFACE +and MEMBER denote the message which has been sent. HANDLER is +the function which has been registered for this message. ARGS +are the arguments passed to HANDLER, when it is called during +event handling in `dbus-handle-event'. This function raises a `dbus-error' signal in case the event is not well formed." @@ -369,7 +366,8 @@ (unless (and (listp event) (eq (car event) 'dbus-event) ;; Bus symbol. - (symbolp (nth 1 event)) + (or (symbolp (nth 1 event)) + (stringp (nth 1 event))) ;; Type. (and (natnump (nth 2 event)) (< dbus-message-type-invalid (nth 2 event))) @@ -434,9 +432,10 @@ (defun dbus-event-bus-name (event) "Return the bus name the event is coming from. -The result is either the symbol `:system' or the symbol `:session'. -EVENT is a D-Bus event, see `dbus-check-event'. This function -raises a `dbus-error' signal in case the event is not well formed." +The result is either a Lisp symbol, `:system' or `:session', or a +string denoting the bus address. EVENT is a D-Bus event, see +`dbus-check-event'. This function raises a `dbus-error' signal +in case the event is not well formed." (dbus-check-event event) (nth 1 event)) @@ -566,10 +565,11 @@ "Return all interfaces and sub-nodes of SERVICE, registered at object path PATH at bus BUS. -BUS must be either the symbol `:system' or the symbol `:session'. -SERVICE must be a known service name, and PATH must be a valid -object path. The last two parameters are strings. The result, -the introspection data, is a string in XML format." +BUS is either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. SERVICE must be a known service name, +and PATH must be a valid object path. The last two parameters +are strings. The result, the introspection data, is a string in +XML format." ;; We don't want to raise errors. `dbus-call-method-non-blocking' ;; is used, because the handler can be registered in our Emacs ;; instance; caller an callee would block each other. @@ -873,7 +873,8 @@ (bus service path interface property access value &optional emits-signal) "Register property PROPERTY on the D-Bus BUS. -BUS is either the symbol `:system' or the symbol `:session'. +BUS is either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. SERVICE is the D-Bus service name of the D-Bus. It must be a known name. ------------------------------------------------------------ revno: 101172 committer: Michael Albinus branch nick: trunk timestamp: Mon 2010-08-23 15:02:00 +0200 message: * dbusbind.c: Accept UNIX domain sockets as bus address. (Fdbus_close_bus): New function. (Vdbus_registered_buses): New variable. (xd_initialize): Implement string as bus address. (Fdbus_init_bus): Add bus to Vdbus_registered_buses). (Fdbus_get_unique_name, Fdbus_call_method) (Fdbus_call_method_asynchronously, Fdbus_method_return_internal) (Fdbus_method_error_internal, Fdbus_send_signal) (Fdbus_register_signal, Fdbus_register_method): Remove bus type check. This is done in xd_initialize_bus. Adapt doc string, if necessary. (xd_pending_messages, xd_read_queued_messages): Loop over buses in Vdbus_registered_buses. (Vdbus_registered_objects_table): Create hash. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-23 10:28:12 +0000 +++ src/ChangeLog 2010-08-23 13:02:00 +0000 @@ -1,3 +1,20 @@ +2010-08-23 Michael Albinus + + * dbusbind.c: Accept UNIX domain sockets as bus address. + (Fdbus_close_bus): New function. + (Vdbus_registered_buses): New variable. + (xd_initialize): Implement string as bus address. + (Fdbus_init_bus): Add bus to Vdbus_registered_buses). + (Fdbus_get_unique_name, Fdbus_call_method) + (Fdbus_call_method_asynchronously, Fdbus_method_return_internal) + (Fdbus_method_error_internal, Fdbus_send_signal) + (Fdbus_register_signal, Fdbus_register_method): Remove bus type + check. This is done in xd_initialize_bus. Adapt doc string, if + necessary. + (xd_pending_messages, xd_read_queued_messages): Loop over buses in + Vdbus_registered_buses. + (Vdbus_registered_objects_table): Create hash. + 2010-08-22 Juri Linkov * keyboard.c (Fexecute_extended_command): Move reading a command name === modified file 'src/dbusbind.c' --- src/dbusbind.c 2010-07-12 19:03:53 +0000 +++ src/dbusbind.c 2010-08-23 13:02:00 +0000 @@ -31,6 +31,7 @@ /* Subroutines. */ Lisp_Object Qdbus_init_bus; +Lisp_Object Qdbus_close_bus; Lisp_Object Qdbus_get_unique_name; Lisp_Object Qdbus_call_method; Lisp_Object Qdbus_call_method_asynchronously; @@ -59,6 +60,9 @@ Lisp_Object QCdbus_type_array, QCdbus_type_variant; Lisp_Object QCdbus_type_struct, QCdbus_type_dict_entry; +/* Registered buses. */ +Lisp_Object Vdbus_registered_buses; + /* Hash table which keeps function definitions. */ Lisp_Object Vdbus_registered_objects_table; @@ -111,7 +115,7 @@ } while (0) /* Macros for debugging. In order to enable them, build with - "make MYCPPFLAGS='-DDBUS_DEBUG -Wall'". */ + "MYCPPFLAGS='-DDBUS_DEBUG -Wall' make". */ #ifdef DBUS_DEBUG #define XD_DEBUG_MESSAGE(...) \ do { \ @@ -713,10 +717,10 @@ } } -/* Initialize D-Bus connection. BUS is a Lisp symbol, either :system - or :session. It tells which D-Bus to initialize. If RAISE_ERROR - is non-zero signal an error when the connection cannot be - initialized. */ +/* Initialize D-Bus connection. BUS is either a Lisp symbol, :system + or :session, or a string denoting the bus address. It tells which + D-Bus to initialize. If RAISE_ERROR is non-zero, signal an error + when the connection cannot be initialized. */ static DBusConnection * xd_initialize (Lisp_Object bus, int raise_error) { @@ -724,34 +728,66 @@ DBusError derror; /* Parameter check. */ - CHECK_SYMBOL (bus); - if (!(EQ (bus, QCdbus_system_bus) || EQ (bus, QCdbus_session_bus))) - if (raise_error) - XD_SIGNAL2 (build_string ("Wrong bus name"), bus); - else - return NULL; + if (!STRINGP (bus)) + { + CHECK_SYMBOL (bus); + if (!(EQ (bus, QCdbus_system_bus) || EQ (bus, QCdbus_session_bus))) + { + if (raise_error) + XD_SIGNAL2 (build_string ("Wrong bus name"), bus); + else + return NULL; + } - /* We do not want to have an autolaunch for the session bus. */ - if (EQ (bus, QCdbus_session_bus) - && getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL) - if (raise_error) - XD_SIGNAL2 (build_string ("No connection to bus"), bus); - else - return NULL; + /* We do not want to have an autolaunch for the session bus. */ + if (EQ (bus, QCdbus_session_bus) + && getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL) + { + if (raise_error) + XD_SIGNAL2 (build_string ("No connection to bus"), bus); + else + return NULL; + } + } /* Open a connection to the bus. */ dbus_error_init (&derror); - if (EQ (bus, QCdbus_system_bus)) - connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror); + if (STRINGP (bus)) + connection = dbus_connection_open (SDATA (bus), &derror); else - connection = dbus_bus_get (DBUS_BUS_SESSION, &derror); - - if (dbus_error_is_set (&derror)) - if (raise_error) - XD_ERROR (derror); + if (EQ (bus, QCdbus_system_bus)) + connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror); else - connection = NULL; + connection = dbus_bus_get (DBUS_BUS_SESSION, &derror); + + if (dbus_error_is_set (&derror)) + { + if (raise_error) + XD_ERROR (derror); + else + connection = NULL; + } + + /* If it is not the system or session bus, we must register + ourselves. Otherwise, we have called dbus_bus_get, which has + configured us to exit if the connection closes - we undo this + setting. */ + if (connection != NULL) + { + if (STRINGP (bus)) + dbus_bus_register (connection, &derror); + else + dbus_connection_set_exit_on_disconnect (connection, FALSE); + } + + if (dbus_error_is_set (&derror)) + { + if (raise_error) + XD_ERROR (derror); + else + connection = NULL; + } if (connection == NULL && raise_error) XD_SIGNAL2 (build_string ("No connection to bus"), bus); @@ -794,7 +830,8 @@ } /* Remove connection file descriptor from input_wait_mask. DATA is - the used bus, either QCdbus_system_bus or QCdbus_session_bus. */ + the used bus, either a string or QCdbus_system_bus or + QCdbus_session_bus. */ void xd_remove_watch (DBusWatch *watch, void *data) { @@ -830,15 +867,11 @@ } DEFUN ("dbus-init-bus", Fdbus_init_bus, Sdbus_init_bus, 1, 1, 0, - doc: /* Initialize connection to D-Bus BUS. -This is an internal function, it shall not be used outside dbus.el. */) + doc: /* Initialize connection to D-Bus BUS. */) (Lisp_Object bus) { DBusConnection *connection; - /* Check parameters. */ - CHECK_SYMBOL (bus); - /* Open a connection to the bus. */ connection = xd_initialize (bus, TRUE); @@ -850,6 +883,28 @@ NULL, (void*) XHASH (bus), NULL)) XD_SIGNAL1 (build_string ("Cannot add watch functions")); + /* Add bus to list of registered buses. */ + Vdbus_registered_buses = Fcons (bus, Vdbus_registered_buses); + + /* Return. */ + return Qnil; +} + +DEFUN ("dbus-close-bus", Fdbus_close_bus, Sdbus_close_bus, 1, 1, 0, + doc: /* Close connection to D-Bus BUS. */) + (Lisp_Object bus) +{ + DBusConnection *connection; + + /* Open a connection to the bus. */ + connection = xd_initialize (bus, TRUE); + + /* Decrement reference count to the bus. */ + dbus_connection_unref (connection); + + /* Remove bus from list of registered buses. */ + Vdbus_registered_buses = Fdelete (bus, Vdbus_registered_buses); + /* Return. */ return Qnil; } @@ -862,9 +917,6 @@ DBusConnection *connection; const char *name; - /* Check parameters. */ - CHECK_SYMBOL (bus); - /* Open a connection to the bus. */ connection = xd_initialize (bus, TRUE); @@ -880,7 +932,8 @@ DEFUN ("dbus-call-method", Fdbus_call_method, Sdbus_call_method, 5, MANY, 0, doc: /* Call METHOD on the D-Bus BUS. -BUS is either the symbol `:system' or the symbol `:session'. +BUS is either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. SERVICE is the D-Bus service name to be used. PATH is the D-Bus object path SERVICE is registered at. INTERFACE is an interface @@ -967,7 +1020,6 @@ interface = args[3]; method = args[4]; - CHECK_SYMBOL (bus); CHECK_STRING (service); CHECK_STRING (path); CHECK_STRING (interface); @@ -1082,7 +1134,8 @@ Sdbus_call_method_asynchronously, 6, MANY, 0, doc: /* Call METHOD on the D-Bus BUS asynchronously. -BUS is either the symbol `:system' or the symbol `:session'. +BUS is either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. SERVICE is the D-Bus service name to be used. PATH is the D-Bus object path SERVICE is registered at. INTERFACE is an interface @@ -1148,7 +1201,6 @@ method = args[4]; handler = args[5]; - CHECK_SYMBOL (bus); CHECK_STRING (service); CHECK_STRING (path); CHECK_STRING (interface); @@ -1271,7 +1323,6 @@ serial = args[1]; service = args[2]; - CHECK_SYMBOL (bus); CHECK_NUMBER (serial); CHECK_STRING (service); GCPRO3 (bus, serial, service); @@ -1363,7 +1414,6 @@ serial = args[1]; service = args[2]; - CHECK_SYMBOL (bus); CHECK_NUMBER (serial); CHECK_STRING (service); GCPRO3 (bus, serial, service); @@ -1436,7 +1486,8 @@ DEFUN ("dbus-send-signal", Fdbus_send_signal, Sdbus_send_signal, 5, MANY, 0, doc: /* Send signal SIGNAL on the D-Bus BUS. -BUS is either the symbol `:system' or the symbol `:session'. +BUS is either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. SERVICE is the D-Bus service name SIGNAL is sent from. PATH is the D-Bus object path SERVICE is registered at. INTERFACE is an interface @@ -1480,7 +1531,6 @@ interface = args[3]; signal = args[4]; - CHECK_SYMBOL (bus); CHECK_STRING (service); CHECK_STRING (path); CHECK_STRING (interface); @@ -1552,7 +1602,8 @@ } /* Check, whether there is pending input in the message queue of the - D-Bus BUS. BUS is a Lisp symbol, either :system or :session. */ + D-Bus BUS. BUS is either a Lisp symbol, :system or :session, or a + string denoting the bus address. */ int xd_get_dispatch_status (Lisp_Object bus) { @@ -1572,24 +1623,31 @@ ? TRUE : FALSE; } -/* Check for queued incoming messages from the system and session buses. */ +/* Check for queued incoming messages from the buses. */ int xd_pending_messages (void) { - - /* Vdbus_registered_objects_table will be initialized as hash table - in dbus.el. When this package isn't loaded yet, it doesn't make - sense to handle D-Bus messages. */ - return (HASH_TABLE_P (Vdbus_registered_objects_table) - ? (xd_get_dispatch_status (QCdbus_system_bus) - || ((getenv ("DBUS_SESSION_BUS_ADDRESS") != NULL) - ? xd_get_dispatch_status (QCdbus_session_bus) - : FALSE)) - : FALSE); + Lisp_Object busp = Vdbus_registered_buses; + + while (!NILP (busp)) + { + /* We do not want to have an autolaunch for the session bus. */ + if (EQ ((CAR_SAFE (busp)), QCdbus_session_bus) + && getenv ("DBUS_SESSION_BUS_ADDRESS") == NULL) + continue; + + if (xd_get_dispatch_status (CAR_SAFE (busp))) + return TRUE; + + busp = CDR_SAFE (busp); + } + + return FALSE; } -/* Read queued incoming message of the D-Bus BUS. BUS is a Lisp - symbol, either :system or :session. */ +/* Read queued incoming message of the D-Bus BUS. BUS is either a + Lisp symbol, :system or :session, or a string denoting the bus + address. */ static Lisp_Object xd_read_message (Lisp_Object bus) { @@ -1746,29 +1804,28 @@ RETURN_UNGCPRO (Qnil); } -/* Read queued incoming messages from the system and session buses. */ +/* Read queued incoming messages from all buses. */ void xd_read_queued_messages (void) { + Lisp_Object busp = Vdbus_registered_buses; - /* Vdbus_registered_objects_table will be initialized as hash table - in dbus.el. When this package isn't loaded yet, it doesn't make - sense to handle D-Bus messages. Furthermore, we ignore all Lisp - errors during the call. */ - if (HASH_TABLE_P (Vdbus_registered_objects_table)) + xd_in_read_queued_messages = 1; + while (!NILP (busp)) { - xd_in_read_queued_messages = 1; - internal_catch (Qdbus_error, xd_read_message, QCdbus_system_bus); - internal_catch (Qdbus_error, xd_read_message, QCdbus_session_bus); - xd_in_read_queued_messages = 0; + /* We ignore all Lisp errors during the call. */ + internal_catch (Qdbus_error, xd_read_message, CAR_SAFE (busp)); + busp = CDR_SAFE (busp); } + xd_in_read_queued_messages = 0; } DEFUN ("dbus-register-signal", Fdbus_register_signal, Sdbus_register_signal, 6, MANY, 0, doc: /* Register for signal SIGNAL on the D-Bus BUS. -BUS is either the symbol `:system' or the symbol `:session'. +BUS is either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. SERVICE is the D-Bus service name used by the sending D-Bus object. It can be either a known name or the unique name of the D-Bus object @@ -1822,7 +1879,6 @@ signal = args[4]; handler = args[5]; - CHECK_SYMBOL (bus); if (!NILP (service)) CHECK_STRING (service); if (!NILP (path)) CHECK_STRING (path); CHECK_STRING (interface); @@ -1915,7 +1971,8 @@ 6, 6, 0, doc: /* Register for method METHOD on the D-Bus BUS. -BUS is either the symbol `:system' or the symbol `:session'. +BUS is either a Lisp symbol, `:system' or `:session', or a string +denoting the bus address. SERVICE is the D-Bus service name of the D-Bus object METHOD is registered for. It must be a known name. @@ -1933,7 +1990,6 @@ DBusError derror; /* Check parameters. */ - CHECK_SYMBOL (bus); CHECK_STRING (service); CHECK_STRING (path); CHECK_STRING (interface); @@ -1978,6 +2034,10 @@ staticpro (&Qdbus_init_bus); defsubr (&Sdbus_init_bus); + Qdbus_close_bus = intern_c_string ("dbus-close-bus"); + staticpro (&Qdbus_close_bus); + defsubr (&Sdbus_close_bus); + Qdbus_get_unique_name = intern_c_string ("dbus-get-unique-name"); staticpro (&Qdbus_get_unique_name); defsubr (&Sdbus_get_unique_name); @@ -2074,18 +2134,25 @@ QCdbus_type_dict_entry = intern_c_string (":dict-entry"); staticpro (&QCdbus_type_dict_entry); + DEFVAR_LISP ("dbus-registered-buses", + &Vdbus_registered_buses, + doc: /* List of D-Bus buses we are polling for messages. */); + Vdbus_registered_buses = Qnil; + DEFVAR_LISP ("dbus-registered-objects-table", &Vdbus_registered_objects_table, doc: /* Hash table of registered functions for D-Bus. + There are two different uses of the hash table: for accessing registered interfaces properties, targeted by signals or method calls, and for calling handlers in case of non-blocking method call returns. In the first case, the key in the hash table is the list (BUS -INTERFACE MEMBER). BUS is either the symbol `:system' or the symbol -`:session'. INTERFACE is a string which denotes a D-Bus interface, -and MEMBER, also a string, is either a method, a signal or a property -INTERFACE is offering. All arguments but BUS must not be nil. +INTERFACE MEMBER). BUS is either a Lisp symbol, `:system' or +`:session', or a string denoting the bus address. INTERFACE is a +string which denotes a D-Bus interface, and MEMBER, also a string, is +either a method, a signal or a property INTERFACE is offering. All +arguments but BUS must not be nil. The value in the hash table is a list of quadruple lists \((UNAME SERVICE PATH OBJECT) (UNAME SERVICE PATH OBJECT) ...). @@ -2097,15 +2164,18 @@ arrives (methods and signals), or a cons cell containing the value of the property. -In the second case, the key in the hash table is the list (BUS SERIAL). -BUS is either the symbol `:system' or the symbol `:session'. SERIAL -is the serial number of the non-blocking method call, a reply is -expected. Both arguments must not be nil. The value in the hash -table is HANDLER, the function to be called when the D-Bus reply -message arrives. */); - /* We initialize Vdbus_registered_objects_table in dbus.el, because - we need to define a hash table function first. */ - Vdbus_registered_objects_table = Qnil; +In the second case, the key in the hash table is the list (BUS +SERIAL). BUS is either a Lisp symbol, `:system' or `:session', or a +string denoting the bus address. SERIAL is the serial number of the +non-blocking method call, a reply is expected. Both arguments must +not be nil. The value in the hash table is HANDLER, the function to +be called when the D-Bus reply message arrives. */); + { + Lisp_Object args[2]; + args[0] = QCtest; + args[1] = Qequal; + Vdbus_registered_objects_table = Fmake_hash_table (2, args); + } DEFVAR_LISP ("dbus-debug", &Vdbus_debug, doc: /* If non-nil, debug messages of D-Bus bindings are raised. */); ------------------------------------------------------------ revno: 101171 committer: Andreas Schwab branch nick: emacs timestamp: Mon 2010-08-23 14:54:09 +0200 message: Fix configure checks * configure.in: Fix check for librsvg, imagemagick and MagickExportImagePixels. diff: === modified file 'ChangeLog' --- ChangeLog 2010-08-21 02:21:51 +0000 +++ ChangeLog 2010-08-23 12:54:09 +0000 @@ -1,3 +1,8 @@ +2010-08-23 Andreas Schwab + + * configure.in: Fix check for librsvg, imagemagick and + MagickExportImagePixels. + 2010-08-18 Joakim Verona * Makefile.in, configure.in: Checks for ImageMagick. === modified file 'configure' --- configure 2010-08-20 19:55:21 +0000 +++ configure 2010-08-23 12:54:09 +0000 @@ -2442,7 +2442,6 @@ as_fn_append ac_header_list " stdlib.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_header_list " sys/param.h" -as_fn_append ac_func_list " MagickExportImagePixels" as_fn_append ac_header_list " sys/time.h" as_fn_append ac_func_list " alarm" # Check that the precious variables saved in the cache have kept the same @@ -8597,7 +8596,7 @@ fi if test $succeeded = yes; then - : + HAVE_RSVG=yes else : fi @@ -8605,8 +8604,7 @@ - if test ".${RSVG_CFLAGS}" != "."; then - HAVE_RSVG=yes + if test $HAVE_RSVG = yes; then $as_echo "#define HAVE_RSVG 1" >>confdefs.h @@ -8708,7 +8706,7 @@ fi if test $succeeded = yes; then - : + HAVE_IMAGEMAGICK=yes else : fi @@ -8716,38 +8714,24 @@ - if test ".${IMAGEMAGICK_CFLAGS}" != "."; then - HAVE_IMAGEMAGICK=yes + if test $HAVE_IMAGEMAGICK = yes; then $as_echo "#define HAVE_IMAGEMAGICK 1" >>confdefs.h CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" LIBS="$IMAGEMAGICK_LIBS $LIBS" - fi - - -$as_echo "#define HAVE_MAGICKEXPORTIMAGEPIXELS 0" >>confdefs.h - - - - - for ac_func in $ac_func_list + for ac_func in MagickExportImagePixels do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : + ac_fn_c_check_func "$LINENO" "MagickExportImagePixels" "ac_cv_func_MagickExportImagePixels" +if test "x$ac_cv_func_MagickExportImagePixels" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define HAVE_MAGICKEXPORTIMAGEPIXELS 1 _ACEOF fi done - - - - + fi fi @@ -11624,6 +11608,22 @@ + for ac_func in $ac_func_list +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 $as_echo_n "checking for working mktime... " >&6; } === modified file 'configure.in' --- configure.in 2010-08-20 19:55:21 +0000 +++ configure.in 2010-08-23 12:54:09 +0000 @@ -1825,12 +1825,11 @@ RSVG_REQUIRED=2.11.0 RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED" - PKG_CHECK_MODULES(RSVG, $RSVG_MODULE, :, :) + PKG_CHECK_MODULES(RSVG, $RSVG_MODULE, HAVE_RSVG=yes, :) AC_SUBST(RSVG_CFLAGS) AC_SUBST(RSVG_LIBS) - if test ".${RSVG_CFLAGS}" != "."; then - HAVE_RSVG=yes + if test $HAVE_RSVG = yes; then AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.]) CFLAGS="$CFLAGS $RSVG_CFLAGS" LIBS="$RSVG_LIBS $LIBS" @@ -1841,20 +1840,16 @@ HAVE_IMAGEMAGICK=no if test "${with_imagemagick}" != "no"; then IMAGEMAGICK_MODULE="Wand" - PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, :, :) + PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :) AC_SUBST(IMAGEMAGICK_CFLAGS) AC_SUBST(IMAGEMAGICK_LIBS) - if test ".${IMAGEMAGICK_CFLAGS}" != "."; then - HAVE_IMAGEMAGICK=yes + if test $HAVE_IMAGEMAGICK = yes; then AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.]) CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" LIBS="$IMAGEMAGICK_LIBS $LIBS" + AC_CHECK_FUNCS(MagickExportImagePixels) fi - - AC_DEFINE(HAVE_MAGICKEXPORTIMAGEPIXELS, 0, [Define to 1 if MagickExportImagePixels is defined.]) - AC_CHECK_FUNCS_ONCE(MagickExportImagePixels) - fi ------------------------------------------------------------ revno: 101170 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2010-08-23 12:28:12 +0200 message: src/ChangeLog: Fix typos. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-22 23:27:59 +0000 +++ src/ChangeLog 2010-08-23 10:28:12 +0000 @@ -27,10 +27,10 @@ * doc.c (Fsnarf_documentation): Initialize skip_file before build-files test. -2010-08-22 Peter O'Gorman (tiny change) +2010-08-22 Peter O'Gorman (tiny change) - * s/hpux10-20.h (HAVE_TERMIOS, NO_TERMIO, ORDINARY_LINK): New - definitions. + * s/hpux10-20.h (HAVE_TERMIOS, NO_TERMIO, ORDINARY_LINK): + New definitions. (HAVE_TERMIO): Remove. 2010-08-22 Eli Zaretskii @@ -486,10 +486,10 @@ 2010-08-08 Kenichi Handa - * charset.c: Include + * charset.c: Include . (struct charset_sort_data): New struct. (charset_compare): New function. - (Fsort_charsets): New funciton. + (Fsort_charsets): New function. (syms_of_charset): Declare Fsort_charsets as a Lisp function. * coding.c (decode_coding_iso_2022): Fix checking of dimension ------------------------------------------------------------ revno: 101169 committer: Juanma Barranquero branch nick: trunk timestamp: Mon 2010-08-23 12:21:01 +0200 message: * ido.el (ido-use-virtual-buffers): Fix typo in docstring. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-22 23:27:59 +0000 +++ lisp/ChangeLog 2010-08-23 10:21:01 +0000 @@ -1,3 +1,7 @@ +2010-08-23 Juanma Barranquero + + * ido.el (ido-use-virtual-buffers): Fix typo in docstring. + 2010-08-22 Juri Linkov * simple.el (read-extended-command): New function with the logic === modified file 'lisp/ido.el' --- lisp/ido.el 2010-08-22 20:02:16 +0000 +++ lisp/ido.el 2010-08-23 10:21:01 +0000 @@ -780,7 +780,7 @@ the buffer gets cleaned up by mignight.el. Later, you want to switch to that buffer, but find it's no longer open. With virtual buffers enabled, the buffer name stays in the buffer -list (using the ido-virtual face, and always at the end), and if +list (using the `ido-virtual' face, and always at the end), and if you select it, it opens the file back up again. This allows you to think less about whether recently opened files are still open or not. Most of the time you can quit Emacs, restart, and then ------------------------------------------------------------ revno: 101168 committer: Juri Linkov branch nick: trunk timestamp: Mon 2010-08-23 00:27:59 +0100 message: Move reading an extended command to Elisp (bug#5364, bug#5214). * lisp/simple.el (read-extended-command): New function with the logic for `completing-read' moved to Elisp from `execute-extended-command'. Use `function-called-at-point' in `minibuffer-default-add-function' to get a command name for M-n (bug#5364, bug#5214). * src/keyboard.c (Fexecute_extended_command): Move reading a command name with `completing-read' to a new Elisp function `read-extended-command'. Call it to read a command to `function' (bug#5364, bug#5214). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-22 21:15:20 +0000 +++ lisp/ChangeLog 2010-08-22 23:27:59 +0000 @@ -1,3 +1,10 @@ +2010-08-22 Juri Linkov + + * simple.el (read-extended-command): New function with the logic + for `completing-read' moved to Elisp from `execute-extended-command'. + Use `function-called-at-point' in `minibuffer-default-add-function' + to get a command name for M-n (bug#5364, bug#5214). + 2010-08-22 Chong Yidong * startup.el (command-line-1): Issue warning for ignored arguments === modified file 'lisp/simple.el' --- lisp/simple.el 2010-08-22 20:02:16 +0000 +++ lisp/simple.el 2010-08-22 23:27:59 +0000 @@ -1301,6 +1301,40 @@ (if command-history (error "Argument %d is beyond length of command history" arg) (error "There are no previous complex commands to repeat"))))) + +(defun read-extended-command () + "Read command name to invoke in `execute-extended-command'." + (minibuffer-with-setup-hook + (lambda () + (set (make-local-variable 'minibuffer-default-add-function) + (lambda () + ;; Get a command name at point in the original buffer + ;; to propose it after M-n. + (with-current-buffer (window-buffer (minibuffer-selected-window)) + (and (commandp (function-called-at-point)) + (format "%S" (function-called-at-point))))))) + ;; Read a string, completing from and restricting to the set of + ;; all defined commands. Don't provide any initial input. + ;; Save the command read on the extended-command history list. + (completing-read + (concat (cond + ((eq current-prefix-arg '-) "- ") + ((and (consp current-prefix-arg) + (eq (car current-prefix-arg) 4)) "C-u ") + ((and (consp current-prefix-arg) + (integerp (car current-prefix-arg))) + (format "%d " (car current-prefix-arg))) + ((integerp current-prefix-arg) + (format "%d " current-prefix-arg))) + ;; This isn't strictly correct if `execute-extended-command' + ;; is bound to anything else (e.g. [menu]). + ;; It could use (key-description (this-single-command-keys)), + ;; but actually a prompt other than "M-x" would be confusing, + ;; because "M-x" is a well-known prompt to read a command + ;; and it serves as a shorthand for "Extended command: ". + "M-x ") + obarray 'commandp t nil 'extended-command-history))) + (defvar minibuffer-history nil "Default minibuffer history list. === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-22 21:15:20 +0000 +++ src/ChangeLog 2010-08-22 23:27:59 +0000 @@ -1,3 +1,9 @@ +2010-08-22 Juri Linkov + + * keyboard.c (Fexecute_extended_command): Move reading a command name + with `completing-read' to a new Elisp function `read-extended-command'. + Call it to read a command to `function' (bug#5364, bug#5214). + 2010-08-22 Chong Yidong * emacs.c (main): Remove handling of --unibyte arg (Bug#6886). === modified file 'src/keyboard.c' --- src/keyboard.c 2010-08-22 15:14:37 +0000 +++ src/keyboard.c 2010-08-22 23:27:59 +0000 @@ -10345,13 +10345,12 @@ (Lisp_Object prefixarg) { Lisp_Object function; - char buf[40]; int saved_last_point_position; Lisp_Object saved_keys, saved_last_point_position_buffer; Lisp_Object bindings, value; struct gcpro gcpro1, gcpro2, gcpro3; #ifdef HAVE_WINDOW_SYSTEM - /* The call to Fcompleting_read wil start and cancel the hourglass, + /* The call to Fcompleting_read will start and cancel the hourglass, but if the hourglass was already scheduled, this means that no hourglass will be shown for the actual M-x command itself. So we restart it if it is already scheduled. Note that checking @@ -10364,31 +10363,9 @@ XVECTOR (this_command_keys)->contents); saved_last_point_position_buffer = last_point_position_buffer; saved_last_point_position = last_point_position; - buf[0] = 0; GCPRO3 (saved_keys, prefixarg, saved_last_point_position_buffer); - if (EQ (prefixarg, Qminus)) - strcpy (buf, "- "); - else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4) - strcpy (buf, "C-u "); - else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg))) - sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg))); - else if (INTEGERP (prefixarg)) - sprintf (buf, "%ld ", (long) XINT (prefixarg)); - - /* This isn't strictly correct if execute-extended-command - is bound to anything else. Perhaps it should use - this_command_keys? */ - strcat (buf, "M-x "); - - /* Prompt with buf, and then read a string, completing from and - restricting to the set of all defined commands. Don't provide - any initial input. Save the command read on the extended-command - history list. */ - function = Fcompleting_read (build_string (buf), - Vobarray, Qcommandp, - Qt, Qnil, Qextended_command_history, Qnil, - Qnil); + function = call0 (intern ("read-extended-command")); #ifdef HAVE_WINDOW_SYSTEM if (hstarted) start_hourglass (); ------------------------------------------------------------ revno: 101167 committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-08-22 17:15:20 -0400 message: Make obsolete --unibyte argument do nothing (Bug#6886). * src/emacs.c (main): Remove --unibyte handling (Bug#6886). * lisp/startup.el (command-line-1): Issue warning for ignored arguments --unibyte, etc (Bug#6886). * doc/lispref/nonascii.texi (Text Representations): * doc/lispref/loading.texi (Loading Non-ASCII): * doc/lispref/compile.texi (Byte Compilation): Don't mention obsolete --unibyte command-line argument. diff: === modified file 'admin/unidata/Makefile.in' --- admin/unidata/Makefile.in 2010-06-12 15:52:43 +0000 +++ admin/unidata/Makefile.in 2010-08-22 21:15:20 +0000 @@ -21,7 +21,7 @@ EMACS = ../../src/emacs DSTDIR = ../../lisp/international -RUNEMACS = ${EMACS} -Q --multibyte -batch +RUNEMACS = ${EMACS} -Q -batch all: ${DSTDIR}/charprop.el ../../src/biditype.h ../../src/bidimirror.h === modified file 'admin/unidata/makefile.w32-in' --- admin/unidata/makefile.w32-in 2010-06-12 15:52:43 +0000 +++ admin/unidata/makefile.w32-in 2010-08-22 21:15:20 +0000 @@ -27,7 +27,7 @@ # lisp/subdirs.el is not generated yet when the commands below run. EMACSLOADPATH = $(lisp);$(lisp)/international;$(lisp)/emacs-lisp # Quote EMACS so it could be a file name with embedded whitespace -RUNEMACS = "$(EMACS)" -Q --multibyte -batch +RUNEMACS = "$(EMACS)" -Q -batch all: $(DSTDIR)/charprop.el ../../src/biditype.h ../../src/bidimirror.h === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-08-22 20:02:16 +0000 +++ doc/lispref/ChangeLog 2010-08-22 21:15:20 +0000 @@ -1,5 +1,12 @@ 2010-08-22 Chong Yidong + * nonascii.texi (Text Representations): + * loading.texi (Loading Non-ASCII): + * compile.texi (Byte Compilation): Don't mention obsolete + --unibyte command-line argument. + +2010-08-22 Chong Yidong + * modes.texi (Defining Minor Modes): Doc fix (Bug#6880). 2010-08-22 Chong Yidong === modified file 'doc/lispref/compile.texi' --- doc/lispref/compile.texi 2010-06-23 03:36:56 +0000 +++ doc/lispref/compile.texi 2010-08-22 21:15:20 +0000 @@ -22,12 +22,6 @@ transportable from machine to machine without recompilation. It is not, however, as fast as true compiled code. - Compiling a Lisp file with the Emacs byte compiler always reads the -file as multibyte text, even if Emacs was started with @samp{--unibyte}, -unless the file specifies otherwise. This is so that compilation gives -results compatible with running the same file without compilation. -@xref{Loading Non-ASCII}. - In general, any version of Emacs can run byte-compiled code produced by recent earlier versions of Emacs, but the reverse is not true. === modified file 'doc/lispref/loading.texi' --- doc/lispref/loading.texi 2010-06-23 03:36:56 +0000 +++ doc/lispref/loading.texi 2010-08-22 21:15:20 +0000 @@ -367,13 +367,6 @@ unibyte text, and its string constants will be unibyte strings. @xref{Coding Systems}. - To make the results more predictable, Emacs always performs decoding -into the multibyte representation when loading Lisp files, even if it -was started with the @samp{--unibyte} option. This means that string -constants with non-@acronym{ASCII} characters translate into multibyte -strings. The only exception is when a particular file specifies no -decoding. - The reason Emacs is designed this way is so that Lisp programs give predictable results, regardless of how Emacs was started. In addition, this enables programs that depend on using multibyte text to work even === modified file 'doc/lispref/nonascii.texi' --- doc/lispref/nonascii.texi 2010-05-08 13:25:31 +0000 +++ doc/lispref/nonascii.texi 2010-08-22 21:15:20 +0000 @@ -102,9 +102,6 @@ You cannot set this variable directly; instead, use the function @code{set-buffer-multibyte} to change a buffer's representation. - -The @samp{--unibyte} command line option does its job by setting the -default value to @code{nil} early in startup. @end defvar @defun position-bytes position === modified file 'etc/NEWS' --- etc/NEWS 2010-08-19 15:43:45 +0000 +++ etc/NEWS 2010-08-22 21:15:20 +0000 @@ -59,6 +59,10 @@ * Startup Changes in Emacs 24.1 +** The --unibyte, --multibyte, --no-multibyte, and --no-unibyte +command line arguments no longer have any effect. (They were declared +obsolete in Emacs 23.) + * Changes in Emacs 24.1 === modified file 'leim/Makefile.in' --- leim/Makefile.in 2010-05-15 00:42:22 +0000 +++ leim/Makefile.in 2010-08-22 21:15:20 +0000 @@ -48,7 +48,7 @@ # How to run Emacs. RUN-EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \ - ${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte + ${BUILT-EMACS} -batch --no-init-file --no-site-file # Subdirectories to be made if ${srcdir} is different from the current # directory. === modified file 'leim/makefile.w32-in' --- leim/makefile.w32-in 2010-03-27 12:01:22 +0000 +++ leim/makefile.w32-in 2010-08-22 21:15:20 +0000 @@ -37,7 +37,7 @@ buildlisppath=$(CURDIR)/$(dot)$(dot)/lisp # How to run Emacs. -RUN_EMACS = "$(BUILT_EMACS)" -batch --no-init-file --no-site-file --multibyte +RUN_EMACS = "$(BUILT_EMACS)" -batch --no-init-file --no-site-file # Set EMACSLOADPATH correctly (already defined in environment). EMACSLOADPATH=$(buildlisppath) === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-22 20:02:16 +0000 +++ lisp/ChangeLog 2010-08-22 21:15:20 +0000 @@ -1,5 +1,10 @@ 2010-08-22 Chong Yidong + * startup.el (command-line-1): Issue warning for ignored arguments + --unibyte, etc (Bug#6886). + +2010-08-22 Chong Yidong + * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix (Bug#6880). 2010-08-22 Leo === modified file 'lisp/Makefile.in' --- lisp/Makefile.in 2010-05-15 00:42:22 +0000 +++ lisp/Makefile.in 2010-08-22 21:15:20 +0000 @@ -33,10 +33,9 @@ # to use an absolute file name. EMACS = ${abs_top_builddir}/src/emacs -# Command line flags for Emacs. This must include --multibyte, -# otherwise some files will not compile. +# Command line flags for Emacs. -EMACSOPT = -batch --no-site-file --multibyte +EMACSOPT = -batch --no-site-file # Extra flags to pass to the byte compiler BYTE_COMPILE_EXTRA_FLAGS = === modified file 'lisp/international/mule.el' --- lisp/international/mule.el 2010-08-08 21:12:29 +0000 +++ lisp/international/mule.el 2010-08-22 21:15:20 +0000 @@ -326,8 +326,7 @@ (with-current-buffer buffer ;; So that we don't get completely screwed if the ;; file is encoded in some complicated character set, - ;; read it with real decoding, as a multibyte buffer, - ;; even if this is a --unibyte Emacs session. + ;; read it with real decoding, as a multibyte buffer. (set-buffer-multibyte t) ;; Don't let deactivate-mark remain set. (let (deactivate-mark) @@ -346,12 +345,7 @@ (eval-buffer buffer nil ;; This is compatible with what `load' does. (if purify-flag file fullname) - ;; If this Emacs is running with --unibyte, - ;; convert multibyte strings to unibyte - ;; after reading them. -;; (not (default-value 'enable-multibyte-characters)) - nil t - )) + nil t)) (let (kill-buffer-hook kill-buffer-query-functions) (kill-buffer buffer))) (do-after-load-evaluation fullname) === modified file 'lisp/makefile.w32-in' --- lisp/makefile.w32-in 2010-06-11 21:26:13 +0000 +++ lisp/makefile.w32-in 2010-08-22 21:15:20 +0000 @@ -32,10 +32,9 @@ EMACS = $(THISDIR)/../bin/emacs.exe -# Command line flags for Emacs. This must include --multibyte, -# otherwise some files will not compile. +# Command line flags for Emacs. -EMACSOPT = -batch --no-init-file --no-site-file --multibyte +EMACSOPT = -batch --no-init-file --no-site-file # Extra flags to pass to the byte compiler BYTE_COMPILE_EXTRA_FLAGS = === modified file 'lisp/startup.el' --- lisp/startup.el 2010-06-30 22:58:19 +0000 +++ lisp/startup.el 2010-08-22 21:15:20 +0000 @@ -785,15 +785,16 @@ argi (match-string 1 argi))) (when (string-match "\\`--." orig-argi) (let ((completion (try-completion argi longopts))) - (if (eq completion t) - (setq argi (substring argi 1)) - (if (stringp completion) - (let ((elt (assoc completion longopts))) - (or elt - (error "Option `%s' is ambiguous" argi)) - (setq argi (substring (car elt) 1))) - (setq argval nil - argi orig-argi))))) + (cond ((eq completion t) + (setq argi (substring argi 1))) + ((stringp completion) + (let ((elt (assoc completion longopts))) + (unless elt + (error "Option `%s' is ambiguous" argi)) + (setq argi (substring (car elt) 1)))) + (t + (setq argval nil + argi orig-argi))))) (cond ;; The --display arg is handled partly in C, partly in Lisp. ;; When it shows up here, we just put it back to be handled @@ -2231,6 +2232,11 @@ (move-to-column (1- cl1-column))) (setq cl1-column 0)) + ;; These command lines now have no effect. + ((string-match "\\`--?\\(no-\\)?\\(uni\\|multi\\)byte$" argi) + (display-warning 'initialization + (format "Ignoring obsolete arg %s" argi))) + ((equal argi "--") (setq just-files t)) (t === modified file 'msdos/sedleim.inp' --- msdos/sedleim.inp 2010-01-13 08:35:10 +0000 +++ msdos/sedleim.inp 2010-08-22 21:15:20 +0000 @@ -34,7 +34,7 @@ /RUN-EMACS *=/,/^$/c\ export EMACSLOADPATH=${buildlisppath}\ -RUN-EMACS = ${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte +RUN-EMACS = ${BUILT-EMACS} -batch --no-init-file --no-site-file /^ cd ../c\ ${MAKE} -C ../src ${MFLAGS} emacs === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-22 20:02:16 +0000 +++ src/ChangeLog 2010-08-22 21:15:20 +0000 @@ -1,3 +1,7 @@ +2010-08-22 Chong Yidong + + * emacs.c (main): Remove handling of --unibyte arg (Bug#6886). + 2010-08-22 Andreas Schwab * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA_LISP === modified file 'src/doc.c' --- src/doc.c 2010-08-22 20:02:16 +0000 +++ src/doc.c 2010-08-22 21:15:20 +0000 @@ -285,8 +285,7 @@ to - (get_doc_string_buffer + offset)); else { - /* Let the data determine whether the string is multibyte, - even if Emacs is running in --unibyte mode. */ + /* The data determines whether the string is multibyte. */ int nchars = multibyte_chars_in_text (get_doc_string_buffer + offset, to - (get_doc_string_buffer + offset)); return make_string_from_bytes (get_doc_string_buffer + offset, === modified file 'src/emacs.c' --- src/emacs.c 2010-08-22 15:14:37 +0000 +++ src/emacs.c 2010-08-22 21:15:20 +0000 @@ -1332,68 +1332,6 @@ init_atimer (); running_asynch_code = 0; - /* Handle --unibyte and the EMACS_UNIBYTE envvar, - but not while dumping. */ - if (1) - { - int inhibit_unibyte = 0; - - /* --multibyte overrides EMACS_UNIBYTE. */ - if (argmatch (argv, argc, "-no-unibyte", "--no-unibyte", 4, NULL, &skip_args) - || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args) - /* Ignore EMACS_UNIBYTE before dumping. */ - || (!initialized && noninteractive)) - inhibit_unibyte = 1; - - /* --unibyte requests that we set up to do everything with single-byte - buffers and strings. We need to handle this before calling - init_lread, init_editfns and other places that generate Lisp strings - from text in the environment. */ - /* Actually this shouldn't be needed as of 20.4 in a generally - unibyte environment. As handa says, environment values - aren't now decoded; also existing buffers are now made - unibyte during startup if .emacs sets unibyte. Tested with - 8-bit data in environment variables and /etc/passwd, setting - unibyte and Latin-1 in .emacs. -- Dave Love */ - if (argmatch (argv, argc, "-unibyte", "--unibyte", 4, NULL, &skip_args) - || argmatch (argv, argc, "-no-multibyte", "--no-multibyte", 4, NULL, &skip_args) - || (getenv ("EMACS_UNIBYTE") && !inhibit_unibyte)) - { - Lisp_Object old_log_max; - Lisp_Object symbol, tail; - - symbol = intern_c_string ("enable-multibyte-characters"); - Fset_default (symbol, Qnil); - - if (initialized) - { - /* Erase pre-dump messages in *Messages* now so no abort. */ - old_log_max = Vmessage_log_max; - XSETFASTINT (Vmessage_log_max, 0); - message_dolog ("", 0, 1, 0); - Vmessage_log_max = old_log_max; - } - - for (tail = Vbuffer_alist; CONSP (tail); - tail = XCDR (tail)) - { - Lisp_Object buffer; - - buffer = Fcdr (XCAR (tail)); - /* Make a multibyte buffer unibyte. */ - if (BUF_Z_BYTE (XBUFFER (buffer)) > BUF_Z (XBUFFER (buffer))) - { - struct buffer *current = current_buffer; - - set_buffer_temp (XBUFFER (buffer)); - Fset_buffer_multibyte (Qnil); - set_buffer_temp (current); - } - } - message ("Warning: unibyte sessions are obsolete and will disappear"); - } - } - no_loadup = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); @@ -1792,10 +1730,6 @@ { "-script", "--script", 100, 1 }, { "-daemon", "--daemon", 99, 0 }, { "-help", "--help", 90, 0 }, - { "-no-unibyte", "--no-unibyte", 83, 0 }, - { "-multibyte", "--multibyte", 82, 0 }, - { "-unibyte", "--unibyte", 81, 0 }, - { "-no-multibyte", "--no-multibyte", 80, 0 }, { "-nl", "--no-loadup", 70, 0 }, /* -d must come last before the options handled in startup.el. */ { "-d", "--display", 60, 1 }, ------------------------------------------------------------ revno: 101166 [merge] committer: Chong Yidong branch nick: trunk timestamp: Sun 2010-08-22 16:04:34 -0400 message: Merge changes from emacs-23 branch. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2010-07-31 17:13:03 +0000 +++ doc/emacs/ChangeLog 2010-08-22 20:02:16 +0000 @@ -1,3 +1,7 @@ +2010-08-21 Glenn Morris + + * misc.texi (Amusements): Mention bubbles and animate. + 2010-07-31 Eli Zaretskii * files.texi (Visiting): Add more index entries for === modified file 'doc/emacs/misc.texi' --- doc/emacs/misc.texi 2010-06-23 02:46:43 +0000 +++ doc/emacs/misc.texi 2010-08-21 02:14:07 +0000 @@ -2784,6 +2784,10 @@ If you want a little more personal involvement, try @kbd{M-x gomoku}, which plays the game Go Moku with you. +@findex bubbles + @kbd{M-x bubbles} is a game in which the object is to remove as many +bubbles as you can in the smallest number of moves. + @findex blackbox @findex mpuz @findex 5x5 @@ -2832,6 +2836,11 @@ @kbd{M-x solitaire} plays a game of solitaire in which you jump pegs across other pegs. +@findex animate-birthday-present +@cindex animate +The @code{animate} package makes text dance. For an example, try +@kbd{M-x animate-birthday-present}. + @findex studlify-region @cindex StudlyCaps @kbd{M-x studlify-region} studlify-cases the region, producing === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2010-08-20 20:07:29 +0000 +++ doc/lispref/ChangeLog 2010-08-22 20:02:16 +0000 @@ -1,3 +1,11 @@ +2010-08-22 Chong Yidong + + * modes.texi (Defining Minor Modes): Doc fix (Bug#6880). + +2010-08-22 Chong Yidong + + * objects.texi (Bool-Vector Type): Minor definition tweak (Bug#6878). + 2010-08-20 Eli Zaretskii * commands.texi (Misc Events): Add cross-references to where === modified file 'doc/lispref/modes.texi' --- doc/lispref/modes.texi 2010-07-29 00:58:16 +0000 +++ doc/lispref/modes.texi 2010-08-22 19:30:26 +0000 @@ -1411,14 +1411,20 @@ when the mode is enabled; if it is @code{nil}, the mode is not displayed in the mode line. -The optional argument @var{keymap} specifies the keymap for the minor mode. -It can be a variable name, whose value is the keymap, or it can be an alist -specifying bindings in this form: +The optional argument @var{keymap} specifies the keymap for the minor +mode. If non-@code{nil}, it should be a variable name (whose value is +a keymap), a keymap, or an alist of the form @example (@var{key-sequence} . @var{definition}) @end example +@noindent +where each @var{key-sequence} and @var{definition} are arguments +suitable for passing to @code{define-key} (@pxref{Changing Key +Bindings}). If @var{keymap} is a keymap or an alist, this also +defines the variable @code{@var{mode}-map}. + The above three arguments @var{init-value}, @var{lighter}, and @var{keymap} can be (partially) omitted when @var{keyword-args} are used. The @var{keyword-args} consist of keywords followed by === modified file 'doc/lispref/objects.texi' --- doc/lispref/objects.texi 2010-03-06 20:27:19 +0000 +++ doc/lispref/objects.texi 2010-08-19 23:23:13 +0000 @@ -1189,8 +1189,8 @@ @node Bool-Vector Type @subsection Bool-Vector Type - A @dfn{bool-vector} is a one-dimensional array of elements that -must be @code{t} or @code{nil}. + A @dfn{bool-vector} is a one-dimensional array whose elements must +be @code{t} or @code{nil}. The printed representation of a bool-vector is like a string, except that it begins with @samp{#&} followed by the length. The string === modified file 'leim/ChangeLog' --- leim/ChangeLog 2010-07-24 11:53:19 +0000 +++ leim/ChangeLog 2010-08-22 20:02:16 +0000 @@ -1,3 +1,26 @@ +2010-08-15 Andreas Schwab + + * quail/vntelex.el ("vietnamese-telex"): Doc fix. + + * quail/georgian.el: Remove extra backslashes. + +2010-08-14 Andreas Schwab + + * quail/arabic.el: Quote [ and ]. + * quail/latin-ltx.el: Likewise. + + * quail/greek.el ("greek", "greek-postfix"): Change string to + character. + +2010-08-13 Kenichi Handa + + * quail/greek.el ("greek-postfix"): Add rules for Greek style + quotes. + +2010-08-09 Kenichi Handa + + * quail/greek.el ("greek"): Add rules for Greek style quotes. + 2010-05-15 Glenn Morris * Makefile.in (install): Remove references to CVS-related files. === modified file 'leim/quail/arabic.el' --- leim/quail/arabic.el 2010-01-13 08:35:10 +0000 +++ leim/quail/arabic.el 2010-08-14 08:20:08 +0000 @@ -57,8 +57,8 @@ ("A" ?ِ) ("S" ?ٍ) - ("D" ?]) - ("F" ?[) + ("D" ?\]) + ("F" ?\[) ("G" ["لأ"]) ("H" ?أ) ("J" ?ـ) === modified file 'leim/quail/georgian.el' --- leim/quail/georgian.el 2010-01-13 08:35:10 +0000 +++ leim/quail/georgian.el 2010-08-15 09:34:53 +0000 @@ -51,7 +51,7 @@ ("n" ?ნ) ("o" ?ო) (".p" ?პ) - ("\+z" ?ჟ) + ("+z" ?ჟ) ("r" ?რ) ("s" ?ს) (".t" ?ტ) @@ -60,14 +60,14 @@ ("k" ?ქ) (".g" ?ღ) ("q" ?ყ) - ("\+s" ?შ) - ("\+c" ?ჩ) + ("+s" ?შ) + ("+c" ?ჩ) ("c" ?ც) ("j" ?ძ) (".c" ?წ) - (".\+c" ?ჭ) + (".+c" ?ჭ) ("x" ?ხ) - ("\+j" ?ჯ) + ("+j" ?ჯ) ("h" ?ჰ) ("q1" ?ჴ) ("e0" ?ჱ) === modified file 'leim/quail/greek.el' --- leim/quail/greek.el 2010-01-13 08:35:10 +0000 +++ leim/quail/greek.el 2010-08-14 08:00:34 +0000 @@ -1279,7 +1279,9 @@ (";:i" ?,F@(B) (":;i" ?,F@(B) (";:y" ?,F`(B) - (":;y" ?,F`(B)) + (":;y" ?,F`(B) + (";<" ?$(Q)((B) + (";>" ?$(Q)2(B)) (quail-define-package "greek-postfix" "GreekPost" ",FX(B" nil @@ -1419,7 +1421,12 @@ ("i:;" ?,F@(B) ("i;:" ?,F@(B) ("y:;" ?,F`(B) - ("y;:" ?,F`(B)) + ("y;:" ?,F`(B) + ;; These two are asymmetric with ";<" and ";>" in "greek" input + ;; method. But, as the other Latin postfix methods adopt "<<" and + ;; ">>", it may be better to follow them. + ("<<" ?$(Q)((B) + (">>" ?$(Q)2(B)) ;; arch-tag: 2a37e042-db1b-4ecf-b755-117775a3c150 === modified file 'leim/quail/latin-ltx.el' --- leim/quail/latin-ltx.el 2010-01-13 08:35:10 +0000 +++ leim/quail/latin-ltx.el 2010-08-14 08:20:08 +0000 @@ -653,7 +653,7 @@ ("\\lambda" ?λ) ("\\langle" ?〈) ("\\lbrace" ?{) - ("\\lbrack" ?[) + ("\\lbrack" ?\[) ("\\lceil" ?⌈) ("\\ldots" ?…) ("\\le" ?≤) @@ -788,7 +788,7 @@ ("\\quad" ? ) ("\\rangle" ?〉) ("\\rbrace" ?}) - ("\\rbrack" ?]) + ("\\rbrack" ?\]) ("\\rceil" ?⌉) ("\\rfloor" ?⌋) ("\\rightarrow" ?→) === modified file 'leim/quail/vntelex.el' --- leim/quail/vntelex.el 2010-04-06 15:32:15 +0000 +++ leim/quail/vntelex.el 2010-08-15 09:36:19 +0000 @@ -53,7 +53,7 @@ acute s as -> ,1a(B grave f af -> ,1`(B hook above r ar -> ,1d(B - tilde x ax -> ,1c(B + tilde x ax -> ,1c(B dot below j aj -> ,1U(B d bar dd -> ,1p(B === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2010-08-21 19:26:43 +0000 +++ lisp/ChangeLog 2010-08-22 20:02:16 +0000 @@ -1,3 +1,74 @@ +2010-08-22 Chong Yidong + + * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix (Bug#6880). + +2010-08-22 Leo + + Fix buffer-list rename&refresh after after killing a buffer in ido. + * lisp/ido.el: Revert Óscar's. + (ido-kill-buffer-at-head): Exit the minibuffer with ido-exit=refresh. + Remember the buffers at head, rather than their name. + * lisp/iswitchb.el (iswitchb-kill-buffer): Re-make the list. + +2010-08-22 Kirk Kelsey (tiny change) + Stefan Monnier + + * progmodes/make-mode.el (makefile-fill-paragraph): Account for the + extra backslash added to each line (bug#6890). + +2010-08-22 Stefan Monnier + + * subr.el (read-key): Don't echo keystrokes (bug#6883). + +2010-08-22 Glenn Morris + + * menu-bar.el (menu-bar-games-menu): Add landmark. + +2010-08-22 Glenn Morris + + * align.el (align-regexp): Make group and spacing arguments + use the interactive defaults when non-interactive. (Bug#6698) + + * mail/rmail.el (rmail-forward): Replace mail-text-start with its + expansion, so as not to need sendmail. + (mail-text-start): Remove declaration. + (rmail-retry-failure): Require sendmail. + +2010-08-22 Chong Yidong + + * subr.el (read-key): Don't hide the menu-bar entries (bug#6881). + +2010-08-22 Michael Albinus + + * progmodes/flymake.el (flymake-start-syntax-check-process): + Use `start-file-process' in order to let it run also on remote hosts. + +2010-08-22 Kenichi Handa + + * files.el: Add `word-wrap' as safe local variable. + +2010-08-22 Glenn Morris + + * woman.el (woman-translate): Case matters. (Bug#6849) + +2010-08-22 Chong Yidong + + * simple.el (kill-region): Doc fix (Bug#6787). + +2010-08-22 Glenn Morris + + * calendar/diary-lib.el (diary-header-line-format): + Fit it to the window, not the frame. + +2010-08-22 Andreas Schwab + + * subr.el (ignore-errors): Add debug declaration. + +2010-08-22 Geoff Gole (tiny change) + + * whitespace.el (whitespace-color-off): Remove post-command-hook + locally. + 2010-08-21 Stefan Monnier * vc/add-log.el (add-log-file-name): Don't get confused by symlinks. @@ -346,7 +417,7 @@ (ctext-standard-encodings): New variable. (ctext-non-standard-encodings-table): List only elements for non-standard encodings. - (ctext-pre-write-conversion): Adjusted for the above change. + (ctext-pre-write-conversion): Adjust for the above change. Check ctext-standard-encodings. * international/mule-conf.el (compound-text): Doc fix. === modified file 'lisp/align.el' --- lisp/align.el 2010-07-30 00:50:13 +0000 +++ lisp/align.el 2010-08-20 07:33:06 +0000 @@ -1,7 +1,7 @@ ;;; align.el --- align text to a specific column, by regexp -;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: John Wiegley ;; Maintainer: FSF @@ -944,6 +944,8 @@ (list (concat "\\(\\s-*\\)" (read-string "Align regexp: ")) 1 align-default-spacing nil)))) + (or group (setq group 1)) + (or spacing (setq spacing align-default-spacing)) (let ((rule (list (list nil (cons 'regexp regexp) (cons 'group (abs group)) === modified file 'lisp/calendar/diary-lib.el' --- lisp/calendar/diary-lib.el 2010-01-27 04:00:54 +0000 +++ lisp/calendar/diary-lib.el 2010-08-14 02:23:56 +0000 @@ -383,14 +383,14 @@ "Some text is hidden - press \"s\" in calendar \ before edit/copy" "Diary")) - ?\s (frame-width))) + ?\s (window-width))) "Format of the header line displayed by `diary-simple-display'. Only used if `diary-header-line-flag' is non-nil." :group 'diary :type 'sexp :initialize 'custom-initialize-default :set 'diary-set-header - :version "22.1") + :version "23.3") ; frame-width -> window-width ;; The first version of this also checked for diary-selective-display ;; in the non-fancy case. This was an attempt to distinguish between === modified file 'lisp/emacs-lisp/easy-mmode.el' --- lisp/emacs-lisp/easy-mmode.el 2010-05-06 02:53:56 +0000 +++ lisp/emacs-lisp/easy-mmode.el 2010-08-22 20:02:16 +0000 @@ -86,25 +86,23 @@ ;;;###autoload (defmacro define-minor-mode (mode doc &optional init-value lighter keymap &rest body) "Define a new minor mode MODE. -This function defines the associated control variable MODE, keymap MODE-map, -and toggle command MODE. - +This defines the control variable MODE and the toggle command MODE. DOC is the documentation for the mode toggle command. + Optional INIT-VALUE is the initial value of the mode's variable. Optional LIGHTER is displayed in the modeline when the mode is on. -Optional KEYMAP is the default (defvar) keymap bound to the mode keymap. - If it is a list, it is passed to `easy-mmode-define-keymap' - in order to build a valid keymap. It's generally better to use - a separate MODE-map variable than to use this argument. -The above three arguments can be skipped if keyword arguments are -used (see below). - -BODY contains code to execute each time the mode is activated or deactivated. - It is executed after toggling the mode, - and before running the hook variable `MODE-hook'. - Before the actual body code, you can write keyword arguments (alternating - keywords and values). These following keyword arguments are supported (other - keywords will be passed to `defcustom' if the minor mode is global): +Optional KEYMAP is the default keymap bound to the mode keymap. + If non-nil, it should be a variable name (whose value is a keymap), + a keymap, or a list of arguments for `easy-mmode-define-keymap'. + If KEYMAP is a keymap or list, this also defines the variable MODE-map. + +BODY contains code to execute each time the mode is enabled or disabled. + It is executed after toggling the mode, and before running MODE-hook. + Before the actual body code, you can write keyword arguments, i.e. + alternating keywords and values. These following special keywords + are supported (other keywords are passed to `defcustom' if the minor + mode is global): + :group GROUP Custom group name to use in all generated `defcustom' forms. Defaults to MODE without the possible trailing \"-mode\". Don't use this default group name unless you have written a === modified file 'lisp/files.el' --- lisp/files.el 2010-08-19 21:21:21 +0000 +++ lisp/files.el 2010-08-22 20:02:16 +0000 @@ -2805,6 +2805,7 @@ (no-update-autoloads . booleanp) (tab-width . integerp) ;; C source code (truncate-lines . booleanp) ;; C source code + (word-wrap . booleanp) ;; C source code (bidi-display-reordering . booleanp))) ;; C source code (put 'bidi-paragraph-direction 'safe-local-variable === modified file 'lisp/ido.el' --- lisp/ido.el 2010-05-25 02:11:08 +0000 +++ lisp/ido.el 2010-08-22 20:02:16 +0000 @@ -1070,11 +1070,11 @@ ;; Stores the current list of items that will be searched through. ;; The list is ordered, so that the most interesting item comes first, ;; although by default, the files visible in the current frame are put -;; at the end of the list. -(defvar ido-cur-list nil) +;; at the end of the list. Created by `ido-make-item-list'. +(defvar ido-cur-list) ;; Stores the choice list for ido-completing-read -(defvar ido-choice-list nil) +(defvar ido-choice-list) ;; Stores the list of items which are ignored when building ;; `ido-cur-list'. It is in no specific order. @@ -3400,11 +3400,9 @@ (if ido-temp-list (nconc ido-temp-list ido-current-buffers) (setq ido-temp-list ido-current-buffers)) - (when (and default (buffer-live-p (get-buffer default))) - (setq ido-temp-list - (cons default (delete default ido-temp-list)))) - (if ido-use-virtual-buffers - (ido-add-virtual-buffers-to-list)) + (if default + (setq ido-temp-list + (cons default (delete default ido-temp-list)))) (run-hooks 'ido-make-buffer-list-hook) ido-temp-list)) @@ -3672,7 +3670,6 @@ ;; Used by `ido-get-buffers-in-frames' to walk through all windows (let ((buf (buffer-name (window-buffer win)))) (unless (or (member buf ido-bufs-in-frame) - (minibufferp buf) (member buf ido-ignore-item-temp-list)) ;; Only add buf if it is not already in list. ;; This prevents same buf in two different windows being @@ -3913,27 +3910,6 @@ ;;(add-hook 'completion-setup-hook 'completion-setup-function) (display-completion-list completion-list))))))) -(defun ido-kill-buffer-internal (buf) - "Kill buffer BUF and rebuild ido's buffer list if needed." - (if (not (kill-buffer buf)) - ;; buffer couldn't be killed. - (setq ido-rescan t) - ;; else buffer was killed so remove name from list. - (setq ido-cur-list (delq buf ido-cur-list)) - ;; Some packages, like uniquify.el, may rename buffers when one - ;; is killed, so we need to test this condition to avoid using - ;; an outdated list of buffer names. We don't want to always - ;; rebuild the list of buffers, as this alters the previous - ;; buffer order that the user was seeing on the prompt. However, - ;; when we rebuild the list, we try to keep the previous second - ;; buffer as the first one. - (catch 'update - (dolist (b ido-cur-list) - (unless (get-buffer b) - (setq ido-cur-list (ido-make-buffer-list (cadr ido-matches))) - (setq ido-rescan t) - (throw 'update nil)))))) - ;;; KILL CURRENT BUFFER (defun ido-kill-buffer-at-head () "Kill the buffer at the head of `ido-matches'. @@ -3942,15 +3918,26 @@ (if (not (eobp)) (delete-region (point) (line-end-position)) (let ((enable-recursive-minibuffers t) - (buf (ido-name (car ido-matches)))) - (when buf - (ido-kill-buffer-internal buf) - ;; Check if buffer still exists. - (if (get-buffer buf) - ;; buffer couldn't be killed. + (buf (ido-name (car ido-matches))) + (nextbuf (cadr ido-matches))) + (when (get-buffer buf) + ;; If next match names a buffer use the buffer object; buffer + ;; name may be changed by packages such as uniquify; mindful + ;; of virtual buffers. + (when (and nextbuf (get-buffer nextbuf)) + (setq nextbuf (get-buffer nextbuf))) + (if (null (kill-buffer buf)) + ;; Buffer couldn't be killed. (setq ido-rescan t) - ;; else buffer was killed so remove name from list. - (setq ido-cur-list (delq buf ido-cur-list))))))) + ;; Else `kill-buffer' succeeds so re-make the buffer list + ;; taking into account packages like uniquify may rename + ;; buffers. + (if (bufferp nextbuf) + (setq nextbuf (buffer-name nextbuf))) + (setq ido-default-item nextbuf + ido-text-init ido-text + ido-exit 'refresh) + (exit-minibuffer)))))) ;;; DELETE CURRENT FILE (defun ido-delete-file-at-head () @@ -3988,7 +3975,7 @@ ((eq method 'kill) (if record (ido-record-command 'kill-buffer buffer)) - (ido-kill-buffer-internal buffer)) + (kill-buffer buffer)) ((eq method 'other-window) (if record === modified file 'lisp/iswitchb.el' --- lisp/iswitchb.el 2010-02-10 09:19:32 +0000 +++ lisp/iswitchb.el 2010-08-21 13:35:27 +0000 @@ -1027,8 +1027,8 @@ (defun iswitchb-kill-buffer () "Kill the buffer at the head of `iswitchb-matches'." (interactive) - (let ( (enable-recursive-minibuffers t) - buf) + (let ((enable-recursive-minibuffers t) + buf) (setq buf (car iswitchb-matches)) ;; check to see if buf is non-nil. @@ -1042,8 +1042,10 @@ (if (get-buffer buf) ;; buffer couldn't be killed. (setq iswitchb-rescan t) - ;; else buffer was killed so remove name from list. - (setq iswitchb-buflist (delq buf iswitchb-buflist))))))) + ;; Else `kill-buffer' succeeds so re-make the buffer list + ;; taking into account packages like uniquify may rename + ;; buffers + (iswitchb-make-buflist iswitchb-default)))))) ;;; VISIT CHOSEN BUFFER (defun iswitchb-visit-buffer (buffer) === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2010-07-27 02:10:05 +0000 +++ lisp/mail/rmail.el 2010-08-22 20:02:16 +0000 @@ -191,8 +191,6 @@ :group 'rmail-retrieve :type '(repeat (directory))) -(declare-function mail-position-on-field "sendmail" (field &optional soft)) -(declare-function mail-text-start "sendmail" ()) (declare-function rmail-dont-reply-to "mail-utils" (destinations)) (declare-function rmail-update-summary "rmailsum" (&rest ignore)) @@ -1643,8 +1641,6 @@ (declare-function rmail-summary-mark-deleted "rmailsum" (&optional n undel)) (declare-function rfc822-addresses "rfc822" (header-text)) (declare-function mail-abbrev-make-syntax-table "mailabbrev.el" ()) -(declare-function mail-sendmail-delimit-header "sendmail" ()) -(declare-function mail-header-end "sendmail" ()) ;; RLK feature not added in this version: ;; argument specifies inbox file or files in various ways. @@ -3686,7 +3682,8 @@ ;; The mail buffer is now current. (save-excursion ;; Insert after header separator--before signature if any. - (goto-char (mail-text-start)) + (rfc822-goto-eoh) + (forward-line 1) (if (or rmail-enable-mime rmail-enable-mime-composing) (funcall rmail-insert-mime-forwarded-message-function forward-buffer) @@ -3841,6 +3838,10 @@ (1- (point)) (point-max))))))) +(declare-function mail-sendmail-delimit-header "sendmail" ()) +(declare-function mail-header-end "sendmail" ()) +(declare-function mail-position-on-field "sendmail" (field &optional soft)) + (defun rmail-retry-failure () "Edit a mail message which is based on the contents of the current message. For a message rejected by the mail system, extract the interesting headers and @@ -3932,6 +3933,8 @@ (goto-char (point-min)) (if bounce-indent (indent-rigidly (point-min) (point-max) bounce-indent)) + ;; FIXME better to replace sendmail functions. + (require 'sendmail) (mail-sendmail-delimit-header) (save-restriction (narrow-to-region (point-min) (mail-header-end)) === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2010-08-13 13:26:13 +0000 +++ lisp/menu-bar.el 2010-08-22 20:02:16 +0000 @@ -1272,6 +1272,9 @@ (define-key menu-bar-games-menu [life] `(menu-item ,(purecopy "Life") life :help ,(purecopy "Watch how John Conway's cellular automaton evolves"))) +(define-key menu-bar-games-menu [land] + `(menu-item ,(purecopy "Landmark") landmark + :help ,(purecopy "Watch a neural-network robot learn landmarks"))) (define-key menu-bar-games-menu [hanoi] `(menu-item ,(purecopy "Towers of Hanoi") hanoi :help ,(purecopy "Watch Towers-of-Hanoi puzzle solved by Emacs"))) === modified file 'lisp/progmodes/flymake.el' --- lisp/progmodes/flymake.el 2010-01-28 19:53:11 +0000 +++ lisp/progmodes/flymake.el 2010-08-18 18:24:52 +0000 @@ -1152,7 +1152,8 @@ (when dir (let ((default-directory dir)) (flymake-log 3 "starting process on dir %s" default-directory))) - (setq process (apply 'start-process "flymake-proc" (current-buffer) cmd args)) + (setq process (apply 'start-file-process + "flymake-proc" (current-buffer) cmd args)) (set-process-sentinel process 'flymake-process-sentinel) (set-process-filter process 'flymake-process-filter) (push process flymake-processes) === modified file 'lisp/progmodes/make-mode.el' --- lisp/progmodes/make-mode.el 2010-07-27 16:37:25 +0000 +++ lisp/progmodes/make-mode.el 2010-08-22 20:02:16 +0000 @@ -1300,7 +1300,9 @@ (save-restriction (narrow-to-region beginning end) (makefile-backslash-region (point-min) (point-max) t) - (let ((fill-paragraph-function nil)) + (let ((fill-paragraph-function nil) + ;; Adjust fill-column to allow space for the backslash. + (fill-column (- fill-column 1))) (fill-paragraph nil)) (makefile-backslash-region (point-min) (point-max) nil) (goto-char (point-max)) @@ -1314,7 +1316,9 @@ ;; resulting region. (save-restriction (narrow-to-region (point) (line-beginning-position 2)) - (let ((fill-paragraph-function nil)) + (let ((fill-paragraph-function nil) + ;; Adjust fill-column to allow space for the backslash. + (fill-column (- fill-column 1))) (fill-paragraph nil)) (makefile-backslash-region (point-min) (point-max) nil)) ;; Return non-nil to indicate it's been filled. === modified file 'lisp/simple.el' --- lisp/simple.el 2010-08-19 09:37:40 +0000 +++ lisp/simple.el 2010-08-22 20:02:16 +0000 @@ -3103,7 +3103,8 @@ the text, but put the text in the kill ring anyway. This means that you can use the killing commands to copy text from a read-only buffer. -This is the primitive for programs to kill text (as opposed to deleting it). +Lisp programs should use this function for killing text. + (To delete text, use `delete-region'.) Supply two arguments, character positions indicating the stretch of text to be killed. Any command that calls this function is a \"kill command\". === modified file 'lisp/subr.el' --- lisp/subr.el 2010-07-10 18:52:53 +0000 +++ lisp/subr.el 2010-08-22 20:02:16 +0000 @@ -219,6 +219,7 @@ (defmacro ignore-errors (&rest body) "Execute BODY; if an error occurs, return nil. Otherwise, return result of last form in BODY." + (declare (debug t) (indent 0)) `(condition-case nil (progn ,@body) (error nil))) ;;;; Basic Lisp functions. @@ -1818,6 +1819,7 @@ some sort of escape sequence, the ambiguity is resolved via `read-key-delay'." (let ((overriding-terminal-local-map read-key-empty-map) (overriding-local-map nil) + (echo-keystrokes 0) (old-global-map (current-global-map)) (timer (run-with-idle-timer ;; Wait long enough that Emacs has the time to receive and @@ -1842,7 +1844,12 @@ (throw 'read-key keys))))))) (unwind-protect (progn - (use-global-map read-key-empty-map) + (use-global-map + (let ((map (make-sparse-keymap))) + ;; Don't hide the menu-bar and tool-bar entries. + (define-key map [menu-bar] (lookup-key global-map [menu-bar])) + (define-key map [tool-bar] (lookup-key global-map [tool-bar])) + map)) (aref (catch 'read-key (read-key-sequence-vector prompt nil t)) 0)) (cancel-timer timer) (use-global-map old-global-map)))) === modified file 'lisp/woman.el' --- lisp/woman.el 2010-07-14 15:57:54 +0000 +++ lisp/woman.el 2010-08-22 20:02:16 +0000 @@ -3388,7 +3388,10 @@ "Translate up to marker TO. Do this last of all transformations." (if translations (let ((matches (car translations)) - (alist (cdr translations))) + (alist (cdr translations)) + ;; Translations are case-sensitive, eg ".tr ab" does not + ;; affect "A" (bug#6849). + (case-fold-search nil)) (while (re-search-forward matches to t) ;; Done like this to retain text properties and ;; support translation of special characters: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-22 17:18:52 +0000 +++ src/ChangeLog 2010-08-22 20:02:16 +0000 @@ -1,3 +1,28 @@ +2010-08-22 Andreas Schwab + + * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA_LISP + instead of SAFE_ALLOCA. + +2010-08-22 Chong Yidong + + * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA + (Bug#6214). + +2010-08-22 Jan Djärv + + * doc.c (Fsnarf_documentation): Set skip_file only if p[1] is S. + +2010-08-22 Jan Djärv + + * doc.c (Fsnarf_documentation): Initialize skip_file before + build-files test. + +2010-08-22 Peter O'Gorman (tiny change) + + * s/hpux10-20.h (HAVE_TERMIOS, NO_TERMIO, ORDINARY_LINK): New + definitions. + (HAVE_TERMIO): Remove. + 2010-08-22 Eli Zaretskii * deps.mk (sysdep.o, msdos.o): Depend on sysselect.h. === modified file 'src/doc.c' --- src/doc.c 2010-07-29 05:48:06 +0000 +++ src/doc.c 2010-08-22 20:02:16 +0000 @@ -622,24 +622,28 @@ p = buf; end = buf + (filled < 512 ? filled : filled - 128); while (p != end && *p != '\037') p++; - /* p points to ^_Ffunctionname\n or ^_Vvarname\n. */ + /* p points to ^_Ffunctionname\n or ^_Vvarname\n or ^_Sfilename\n. */ if (p != end) { end = strchr (p, '\n'); /* See if this is a file name, and if it is a file in build-files. */ - if (p[1] == 'S' && end - p > 4 && end[-2] == '.' - && (end[-1] == 'o' || end[-1] == 'c')) + if (p[1] == 'S') { - int len = end - p - 2; - char *fromfile = alloca (len + 1); - strncpy (fromfile, &p[2], len); - fromfile[len] = 0; - if (fromfile[len-1] == 'c') - fromfile[len-1] = 'o'; + skip_file = 0; + if (end - p > 4 && end[-2] == '.' + && (end[-1] == 'o' || end[-1] == 'c')) + { + int len = end - p - 2; + char *fromfile = alloca (len + 1); + strncpy (fromfile, &p[2], len); + fromfile[len] = 0; + if (fromfile[len-1] == 'c') + fromfile[len-1] = 'o'; - skip_file = NILP (Fmember (build_string (fromfile), - Vbuild_files)); + skip_file = NILP (Fmember (build_string (fromfile), + Vbuild_files)); + } } sym = oblookup (Vobarray, p + 2, === modified file 'src/eval.c' --- src/eval.c 2010-08-18 10:21:43 +0000 +++ src/eval.c 2010-08-22 20:02:16 +0000 @@ -1011,12 +1011,13 @@ int count = SPECPDL_INDEX (); register int argnum; struct gcpro gcpro1, gcpro2; + USE_SAFE_ALLOCA; varlist = Fcar (args); /* Make space to hold the values to give the bound variables */ elt = Flength (varlist); - temps = (Lisp_Object *) alloca (XFASTINT (elt) * sizeof (Lisp_Object)); + SAFE_ALLOCA_LISP (temps, XFASTINT (elt)); /* Compute the values and store them in `temps' */ @@ -1049,6 +1050,7 @@ } elt = Fprogn (Fcdr (args)); + SAFE_FREE (); return unbind_to (count, elt); } @@ -2301,8 +2303,9 @@ /* Pass a vector of evaluated arguments */ Lisp_Object *vals; register int argnum = 0; + USE_SAFE_ALLOCA; - vals = (Lisp_Object *) alloca (XINT (numargs) * sizeof (Lisp_Object)); + SAFE_ALLOCA_LISP (vals, XINT (numargs)); GCPRO3 (args_left, fun, fun); gcpro3.var = vals; @@ -2320,6 +2323,7 @@ val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals); UNGCPRO; + SAFE_FREE (); goto done; } @@ -2430,8 +2434,9 @@ register int i, numargs; register Lisp_Object spread_arg; register Lisp_Object *funcall_args; - Lisp_Object fun; + Lisp_Object fun, retval; struct gcpro gcpro1; + USE_SAFE_ALLOCA; fun = args [0]; funcall_args = 0; @@ -2470,8 +2475,7 @@ { /* Avoid making funcall cons up a yet another new vector of arguments by explicitly supplying nil's for optional values */ - funcall_args = (Lisp_Object *) alloca ((1 + XSUBR (fun)->max_args) - * sizeof (Lisp_Object)); + SAFE_ALLOCA_LISP (funcall_args, 1 + XSUBR (fun)->max_args); for (i = numargs; i < XSUBR (fun)->max_args;) funcall_args[++i] = Qnil; GCPRO1 (*funcall_args); @@ -2483,8 +2487,7 @@ function itself as well as its arguments. */ if (!funcall_args) { - funcall_args = (Lisp_Object *) alloca ((1 + numargs) - * sizeof (Lisp_Object)); + SAFE_ALLOCA_LISP (funcall_args, 1 + numargs); GCPRO1 (*funcall_args); gcpro1.nvars = 1 + numargs; } @@ -2500,7 +2503,11 @@ } /* By convention, the caller needs to gcpro Ffuncall's args. */ - RETURN_UNGCPRO (Ffuncall (gcpro1.nvars, funcall_args)); + retval = Ffuncall (gcpro1.nvars, funcall_args); + UNGCPRO; + SAFE_FREE (); + + return retval; } /* Run hook variables in various ways. */ @@ -3065,9 +3072,10 @@ struct gcpro gcpro1, gcpro2, gcpro3; register int i; register Lisp_Object tem; + USE_SAFE_ALLOCA; numargs = Flength (args); - arg_vector = (Lisp_Object *) alloca (XINT (numargs) * sizeof (Lisp_Object)); + SAFE_ALLOCA_LISP (arg_vector, XINT (numargs)); args_left = args; GCPRO3 (*arg_vector, args_left, fun); @@ -3096,6 +3104,7 @@ tem = call_debugger (Fcons (Qexit, Fcons (tem, Qnil))); /* Don't do it again when we return to eval. */ backtrace_list->debug_on_exit = 0; + SAFE_FREE (); return tem; } === modified file 'src/s/hpux10-20.h' --- src/s/hpux10-20.h 2010-07-29 03:25:08 +0000 +++ src/s/hpux10-20.h 2010-08-22 20:02:16 +0000 @@ -35,9 +35,10 @@ if system supports pty's. 'p' means it is /dev/ptym/ptyp0 */ #define FIRST_PTY_LETTER 'p' -/* Define HAVE_TERMIO if the system provides sysV-style ioctls - for terminal control. */ -#define HAVE_TERMIO +#define HAVE_TERMIOS +#define NO_TERMIO + +#define ORDINARY_LINK /* Define HAVE_PTYS if the system supports pty devices. */ #define HAVE_PTYS ------------------------------------------------------------ revno: 101165 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2010-08-22 20:20:55 +0300 message: Fix dependencies according to revno 101162. deps.mk (sysdep.o, msdos.o): Depend on sysselect.h. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-22 17:00:08 +0000 +++ src/ChangeLog 2010-08-22 17:18:52 +0000 @@ -1,5 +1,7 @@ 2010-08-22 Eli Zaretskii + * deps.mk (sysdep.o, msdos.o): Depend on sysselect.h. + * sysselect.h [WINDOWSNT]: Don't define the FD_* and select stuff for w32. === modified file 'src/deps.mk' --- src/deps.mk 2010-08-05 17:11:32 +0000 +++ src/deps.mk 2010-08-22 17:18:52 +0000 @@ -142,7 +142,7 @@ msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \ termopts.h termchar.h character.h coding.h ccl.h disptab.h window.h \ keyboard.h $(INTERVALS_H) buffer.h commands.h blockinput.h atimer.h \ - lisp.h $(config_h) + lisp.h sysselect.h $(config_h) nsfns.o: nsfns.m charset.h nsterm.h nsgui.h frame.h window.h buffer.h \ dispextern.h fontset.h $(INTERVALS_H) keyboard.h blockinput.h \ atimer.h systime.h epaths.h termhooks.h coding.h systime.h lisp.h $(config_h) @@ -176,7 +176,7 @@ sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \ process.h dispextern.h termhooks.h termchar.h termopts.h coding.h \ frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h lisp.h \ - $(config_h) composite.h + $(config_h) composite.h sysselect.h term.o: term.c termchar.h termhooks.h termopts.h lisp.h $(config_h) \ cm.h frame.h disptab.h keyboard.h character.h charset.h coding.h ccl.h \ xterm.h msdos.h window.h keymap.h blockinput.h atimer.h systime.h \ ------------------------------------------------------------ revno: 101164 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2010-08-22 20:00:08 +0300 message: Fix the w32 build after revno 101162. sysselect.h [WINDOWSNT]: Don't define the FD_* and select stuff for w32. s/ms-w32.h (HAVE_SYS_TIMEB_H): Don't #undef HAVE_SYS_SELECT_H, it's done in nt/config.nt. makefile.w32-in ($(BLD)/sysdep.$(O)): Depend on sysselect.h. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-22 15:43:00 +0000 +++ src/ChangeLog 2010-08-22 17:00:08 +0000 @@ -1,5 +1,13 @@ 2010-08-22 Eli Zaretskii + * sysselect.h [WINDOWSNT]: Don't define the FD_* and select stuff + for w32. + + * s/ms-w32.h (HAVE_SYS_TIMEB_H): Don't #undef HAVE_SYS_SELECT_H, + it's done in nt/config.nt. + + * makefile.w32-in ($(BLD)/sysdep.$(O)): Depend on sysselect.h. + * unexcoff.c (report_error, make_hdr, write_segment) (copy_text_and_data, copy_sym, mark_x, adjust_lnnoptrs, unexec): Convert argument lists and prototypes to ANSI C. === modified file 'src/makefile.w32-in' --- src/makefile.w32-in 2010-08-06 12:25:10 +0000 +++ src/makefile.w32-in 2010-08-22 17:00:08 +0000 @@ -1357,6 +1357,7 @@ $(SRC)/frame.h \ $(SRC)/keyboard.h \ $(SRC)/process.h \ + $(SRC)/sysselect.h \ $(SRC)/syssignal.h \ $(SRC)/systime.h \ $(SRC)/systty.h \ === modified file 'src/s/ms-w32.h' --- src/s/ms-w32.h 2010-07-29 03:25:08 +0000 +++ src/s/ms-w32.h 2010-08-22 17:00:08 +0000 @@ -106,7 +106,6 @@ #define HAVE_SOUND 1 #define LISP_FLOAT_TYPE 1 -#undef HAVE_SYS_SELECT_H #define HAVE_SYS_TIMEB_H 1 #define HAVE_SYS_TIME_H 1 #define HAVE_UNISTD_H 1 === modified file 'src/sysselect.h' --- src/sysselect.h 2010-01-13 08:35:10 +0000 +++ src/sysselect.h 2010-08-22 17:00:08 +0000 @@ -27,6 +27,10 @@ #endif #endif +/* The w32 build defines select stuff in w32.h, which is included + where w32 needs it, but not where sysselect.h is included. The w32 + definitions in w32.h are incompatible with the below. */ +#ifndef WINDOWSNT #ifdef FD_SET #ifdef FD_SETSIZE #define MAXDESC FD_SETSIZE @@ -44,6 +48,7 @@ #define FD_ISSET(n, p) (*(p) & (1 << (n))) #define FD_ZERO(p) (*(p) = 0) #endif /* no FD_SET */ +#endif /* not WINDOWSNT */ #if !defined (HAVE_SELECT) #define select sys_select ------------------------------------------------------------ revno: 101163 [merge] committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2010-08-22 18:43:00 +0300 message: Clean up and ANSIfy unexcoff.c. unexcoff.c (report_error, make_hdr, write_segment) (copy_text_and_data, copy_sym, mark_x, adjust_lnnoptrs, unexec): Convert argument lists and prototypes to ANSI C. (make_hdr, write_segment): Remove unused variables. (unexec): Remove commented-out line. Initialize `new' to shut up compiler warnings. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-22 15:14:37 +0000 +++ src/ChangeLog 2010-08-22 15:43:00 +0000 @@ -1,3 +1,12 @@ +2010-08-22 Eli Zaretskii + + * unexcoff.c (report_error, make_hdr, write_segment) + (copy_text_and_data, copy_sym, mark_x, adjust_lnnoptrs, unexec): + Convert argument lists and prototypes to ANSI C. + (make_hdr, write_segment): Remove unused variables. + (unexec): Remove commented-out line. Initialize `new' to shut up + compiler warnings. + 2010-08-22 Dan Nicolaescu Simplify termio code. === modified file 'src/unexcoff.c' --- src/unexcoff.c 2010-08-13 10:29:48 +0000 +++ src/unexcoff.c 2010-08-22 15:37:01 +0000 @@ -84,6 +84,7 @@ #ifdef MSDOS #include /* for O_RDONLY, O_RDWR */ #include /* for _crt0_startup_flags and its bits */ +#include static int save_djgpp_startup_flags; #define filehdr external_filehdr #define scnhdr external_scnhdr @@ -128,7 +129,7 @@ #endif -extern char *start_of_data (); /* Start of initialized data */ +extern char *start_of_data (void); /* Start of initialized data */ static long block_copy_start; /* Old executable start point */ static struct filehdr f_hdr; /* File header */ @@ -153,10 +154,8 @@ #include #include "lisp.h" -static -report_error (file, fd) - char *file; - int fd; +static void +report_error (const char *file, int fd) { if (fd) close (fd); @@ -167,20 +166,18 @@ #define ERROR1(msg,x) report_error_1 (new, msg, x, 0); return -1 #define ERROR2(msg,x,y) report_error_1 (new, msg, x, y); return -1 -static -report_error_1 (fd, msg, a1, a2) - int fd; - char *msg; - int a1, a2; +static void +report_error_1 (int fd, const char *msg, int a1, int a2) { close (fd); error (msg, a1, a2); } -static int make_hdr (); -static int copy_text_and_data (); -static int copy_sym (); -static void mark_x (); +static int make_hdr (int, int, unsigned, unsigned, unsigned, + const char *, const char *); +static int copy_text_and_data (int, int); +static int copy_sym (int, int, const char *, const char *); +static void mark_x (const char *); /* **************************************************************** * make_hdr @@ -189,13 +186,9 @@ * Modify the text and data sizes. */ static int -make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) - int new, a_out; - unsigned data_start, bss_start, entry_address; - char *a_name; - char *new_name; +make_hdr (int new, int a_out, unsigned data_start, unsigned bss_start, + unsigned entry_address, const char *a_name, const char *new_name) { - int tem; auto struct scnhdr f_thdr; /* Text section header */ auto struct scnhdr f_dhdr; /* Data section header */ auto struct scnhdr f_bhdr; /* Bss section header */ @@ -363,12 +356,10 @@ } -write_segment (new, ptr, end) - int new; - register char *ptr, *end; +void +write_segment (int new, const char *ptr, const char *end) { register int i, nwrite, ret; - char buf[80]; /* This is the normal amount to write at once. It is the size of block that NFS uses. */ int writesize = 1 << 13; @@ -411,8 +402,7 @@ * Copy the text and data segments from memory to the new a.out */ static int -copy_text_and_data (new, a_out) - int new, a_out; +copy_text_and_data (int new, int a_out) { register char *end; register char *ptr; @@ -456,9 +446,7 @@ * Copy the relocation information and symbol table from the a.out to the new */ static int -copy_sym (new, a_out, a_name, new_name) - int new, a_out; - char *a_name, *new_name; +copy_sym (int new, int a_out, const char *a_name, const char *new_name) { char page[1024]; int n; @@ -494,8 +482,7 @@ * After successfully building the new a.out, mark it executable */ static void -mark_x (name) - char *name; +mark_x (const char *name) { struct stat sbuf; int um; @@ -535,10 +522,8 @@ a reasonable size buffer. But I don't have time to work on such things, so I am installing it as submitted to me. -- RMS. */ -adjust_lnnoptrs (writedesc, readdesc, new_name) - int writedesc; - int readdesc; - char *new_name; +int +adjust_lnnoptrs (int writedesc, int readdesc, const char *new_name) { register int nsyms; register int new; @@ -585,11 +570,11 @@ * * driving logic. */ -unexec (new_name, a_name, data_start, bss_start, entry_address) - char *new_name, *a_name; - unsigned data_start, bss_start, entry_address; +int +unexec (const char *new_name, const char *a_name, + unsigned data_start, unsigned bss_start, unsigned entry_address) { - int new, a_out = -1; + int new = -1, a_out = -1; if (a_name && (a_out = open (a_name, O_RDONLY)) < 0) { @@ -607,7 +592,6 @@ ) { close (new); - /* unlink (new_name); /* Failed, unlink new a.out */ return -1; } ------------------------------------------------------------ revno: 101162 committer: Dan Nicolaescu branch nick: trunk timestamp: Sun 2010-08-22 08:14:37 -0700 message: Simplify termio code. All non-MSDOS non-WINDOWSNT platforms define HAVE_TERMIOS, so HAVE_TERMIO code is obsolete. Replace HAVE_TERMIOS conditionals with !DOS_NT. * src/systty.h: Do not define HAVE_TCATTR. Remove HAVE_TERMIO, HAVE_LTCHARS and HAVE_TCHARS code. Do not define EMACS_HAVE_TTY_PGRP. Only define EMACS_GET_TTY_PGRP for !DOS_NT. * src/sysdep.c: Include sysselect.h unconditionally. Do not include sys/ioctl.h and termios.h, systty.h does it. Use HAVE_SYS_UTSNAME_H instead of USG as an include guard. (init_baud_rate): Remove HAVE_TERMIO code. (child_setup_tty): Remove HAVE_TERMIO code. (emacs_get_tty, emacs_set_tty): Remove HAVE_TERMIO, HAVE_TCHARS and HAVE_LTCHARS code. Use !DOS_NT instead of HAVE_TCATTR. (new_ltchars, new_tchars): Remove, unused. (init_sys_modes): Remove HAVE_TERMIO, HAVE_TCHARS and HAVE_LTCHARS code. Remove special casing for __mips__, it was a no-op. Remove HAVE_TCATTR conditional, it is implied by HAVE_TERMIOS. (init_sys_modes): Remove HPUX special case. * src/process.c: Include stdlib.h unconditionally. Do not include fcntl.h, systty.h does it. Remove conditional code for HAVE_SERIAL, it is always true. (process_send_signal): Remove HAVE_TERMIOS conditional, it's always true when SIGNALS_VIA_CHARACTERS is true. (Fcontinue_process, Fprocess_send_eof): Simplify conditionals: !WINDOWSNT means HAVE_TERMIOS. (create_process): Remove HAVE_TERMIOS, it's inside a HAVE_PTYS conditional, which is true for all HAVE_TERMIOS systems. * src/keyboard.c (init_keyboard): Do not use HAVE_TERMIO, use !DOS_NT instead of HAVE_TERMIOS. * src/emacs.c (shut_down_emacs): Use !defined DOS_NT instead of EMACS_HAVE_TTY_PGRP. * src/callproc.c (child_setup): Move EMACS_SET_TTY_PGRP use to the non-MSDOS, non-WINDOWSNT code, it's only defined for such systems anyway. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2010-08-21 09:35:31 +0000 +++ src/ChangeLog 2010-08-22 15:14:37 +0000 @@ -1,3 +1,42 @@ +2010-08-22 Dan Nicolaescu + + Simplify termio code. + All non-MSDOS non-WINDOWSNT platforms define HAVE_TERMIOS, so + HAVE_TERMIO code is obsolete. + Replace HAVE_TERMIOS conditionals with !DOS_NT. + * systty.h: Do not define HAVE_TCATTR. + Remove HAVE_TERMIO, HAVE_LTCHARS and HAVE_TCHARS code. + Do not define EMACS_HAVE_TTY_PGRP. Only define + EMACS_GET_TTY_PGRP for !DOS_NT. + * sysdep.c: Include sysselect.h unconditionally. Do not include + sys/ioctl.h and termios.h, systty.h does it. Use + HAVE_SYS_UTSNAME_H instead of USG as an include guard. + (init_baud_rate): Remove HAVE_TERMIO code. + (child_setup_tty): Remove HAVE_TERMIO code. + (emacs_get_tty, emacs_set_tty): Remove HAVE_TERMIO, HAVE_TCHARS + and HAVE_LTCHARS code. Use !DOS_NT instead of HAVE_TCATTR. + (new_ltchars, new_tchars): Remove, unused. + (init_sys_modes): Remove HAVE_TERMIO, HAVE_TCHARS and HAVE_LTCHARS + code. Remove special casing for __mips__, it was a no-op. Remove + HAVE_TCATTR conditional, it is implied by HAVE_TERMIOS. + (init_sys_modes): Remove HPUX special case. + * process.c: Include stdlib.h unconditionally. Do not include + fcntl.h, systty.h does it. Remove conditional code for + HAVE_SERIAL, it is always true. + (process_send_signal): Remove HAVE_TERMIOS conditional, it's + always true when SIGNALS_VIA_CHARACTERS is true. + (Fcontinue_process, Fprocess_send_eof): Simplify conditionals: + !WINDOWSNT means HAVE_TERMIOS. + (create_process): Remove HAVE_TERMIOS, it's inside a HAVE_PTYS + conditional, which is true for all HAVE_TERMIOS systems. + * keyboard.c (init_keyboard): Do not use HAVE_TERMIO, use !DOS_NT + instead of HAVE_TERMIOS. + * emacs.c (shut_down_emacs): Use !defined DOS_NT instead of + EMACS_HAVE_TTY_PGRP. + * callproc.c (child_setup): Move EMACS_SET_TTY_PGRP use to the + non-MSDOS, non-WINDOWSNT code, it's only defined for such systems + anyway. + 2010-08-21 Eli Zaretskii * dispnew.c (buffer_posn_from_coords): Fix off-by-one error in === modified file 'src/callproc.c' --- src/callproc.c 2010-08-11 12:34:46 +0000 +++ src/callproc.c 2010-08-22 15:14:37 +0000 @@ -1231,8 +1231,6 @@ #else setpgrp (pid, pid); #endif /* USG */ - /* setpgrp_of_tty is incorrect here; it uses input_fd. */ - EMACS_SET_TTY_PGRP (0, &pid); #ifdef MSDOS pid = run_msdos_command (new_argv, pwd_var + 4, in, out, err, env); @@ -1251,6 +1249,9 @@ report_file_error ("Spawning child process", Qnil); return cpid; #else /* not WINDOWSNT */ + /* setpgrp_of_tty is incorrect here; it uses input_fd. */ + EMACS_SET_TTY_PGRP (0, &pid); + /* execvp does not accept an environment arg so the only way to pass this environment is to set environ. Our caller is responsible for restoring the ambient value of environ. */ === modified file 'src/emacs.c' --- src/emacs.c 2010-08-20 19:45:24 +0000 +++ src/emacs.c 2010-08-22 15:14:37 +0000 @@ -2096,7 +2096,7 @@ Vinhibit_redisplay = Qt; /* If we are controlling the terminal, reset terminal modes. */ -#ifdef EMACS_HAVE_TTY_PGRP +#ifndef DOS_NT { int pgrp = EMACS_GETPGRP (0); === modified file 'src/keyboard.c' --- src/keyboard.c 2010-08-16 02:33:17 +0000 +++ src/keyboard.c 2010-08-22 15:14:37 +0000 @@ -11506,11 +11506,11 @@ Emacs on SIGINT when there are no termcap frames on the controlling terminal. */ signal (SIGINT, interrupt_signal); -#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) +#ifndef DOS_NT /* For systems with SysV TERMIO, C-g is set up for both SIGINT and SIGQUIT and we can't tell which one it will give us. */ signal (SIGQUIT, interrupt_signal); -#endif /* HAVE_TERMIO */ +#endif /* not DOS_NT */ } /* Note SIGIO has been undef'd if FIONREAD is missing. */ #ifdef SIGIO === modified file 'src/process.c' --- src/process.c 2010-08-09 09:35:21 +0000 +++ src/process.c 2010-08-22 15:14:37 +0000 @@ -31,9 +31,7 @@ #ifdef HAVE_INTTYPES_H #include #endif -#ifdef STDC_HEADERS #include -#endif #ifdef HAVE_UNISTD_H #include @@ -61,9 +59,6 @@ #if defined(HAVE_SYS_IOCTL_H) #include -#if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5) -#include -#endif /* HAVE_PTYS and no O_NDELAY */ #if defined(HAVE_NET_IF_H) #include #endif /* HAVE_NET_IF_H */ @@ -182,16 +177,9 @@ extern const char *get_operating_system_release (void); -/* Serial processes require termios or Windows. */ -#if defined (HAVE_TERMIOS) || defined (WINDOWSNT) -#define HAVE_SERIAL -#endif - -#ifdef HAVE_SERIAL /* From sysdep.c or w32.c */ extern int serial_open (char *port); extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact); -#endif #ifndef HAVE_H_ERRNO extern int h_errno; @@ -1903,7 +1891,7 @@ setpgrp (); #endif /* USG */ #endif /* not HAVE_SETSID */ -#if defined (HAVE_TERMIOS) && defined (LDISC1) +#if defined (LDISC1) if (pty_flag && xforkin >= 0) { struct termios t; @@ -2569,7 +2557,6 @@ } -#ifdef HAVE_SERIAL DEFUN ("serial-process-configure", Fserial_process_configure, Sserial_process_configure, @@ -2865,7 +2852,6 @@ UNGCPRO; return proc; } -#endif /* HAVE_SERIAL */ /* Create a network stream/datagram client/server process. Treated exactly like a normal process when reading and writing. Primary @@ -5801,9 +5787,6 @@ /* If possible, send signals to the entire pgrp by sending an input character to it. */ - /* TERMIOS is the latest and bestest, and seems most likely to - work. If the system has it, use it. */ -#ifdef HAVE_TERMIOS struct termios t; cc_t *sig_char = NULL; @@ -5835,65 +5818,6 @@ } /* If we can't send the signal with a character, fall through and send it another way. */ -#else /* ! HAVE_TERMIOS */ - - /* On Berkeley descendants, the following IOCTL's retrieve the - current control characters. */ -#if defined (TIOCGLTC) && defined (TIOCGETC) - - struct tchars c; - struct ltchars lc; - - switch (signo) - { - case SIGINT: - ioctl (p->infd, TIOCGETC, &c); - send_process (proc, &c.t_intrc, 1, Qnil); - return; - case SIGQUIT: - ioctl (p->infd, TIOCGETC, &c); - send_process (proc, &c.t_quitc, 1, Qnil); - return; -#ifdef SIGTSTP - case SIGTSTP: - ioctl (p->infd, TIOCGLTC, &lc); - send_process (proc, &lc.t_suspc, 1, Qnil); - return; -#endif /* ! defined (SIGTSTP) */ - } - -#else /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ - - /* On SYSV descendants, the TCGETA ioctl retrieves the current control - characters. */ -#ifdef TCGETA - struct termio t; - switch (signo) - { - case SIGINT: - ioctl (p->infd, TCGETA, &t); - send_process (proc, &t.c_cc[VINTR], 1, Qnil); - return; - case SIGQUIT: - ioctl (p->infd, TCGETA, &t); - send_process (proc, &t.c_cc[VQUIT], 1, Qnil); - return; -#ifdef SIGTSTP - case SIGTSTP: - ioctl (p->infd, TCGETA, &t); - send_process (proc, &t.c_cc[VSWTCH], 1, Qnil); - return; -#endif /* ! defined (SIGTSTP) */ - } -#else /* ! defined (TCGETA) */ - Your configuration files are messed up. - /* If your system configuration files define SIGNALS_VIA_CHARACTERS, - you'd better be using one of the alternatives above! */ -#endif /* ! defined (TCGETA) */ -#endif /* ! defined (TIOCGLTC) && defined (TIOCGETC) */ - /* In this case, the code above should alway return. */ - abort (); -#endif /* ! defined HAVE_TERMIOS */ /* The code above may fall through if it can't handle the signal. */ @@ -6065,10 +5989,9 @@ #ifdef WINDOWSNT if (fd_info[ p->infd ].flags & FILE_SERIAL) PurgeComm (fd_info[ p->infd ].hnd, PURGE_RXABORT | PURGE_RXCLEAR); -#endif -#ifdef HAVE_TERMIOS +#else /* not WINDOWSNT */ tcflush (p->infd, TCIFLUSH); -#endif +#endif /* not WINDOWSNT */ } p->command = Qnil; return process; @@ -6282,10 +6205,10 @@ send_process (proc, "\004", 1, Qnil); else if (EQ (XPROCESS (proc)->type, Qserial)) { -#ifdef HAVE_TERMIOS +#ifndef WINDOWSNT if (tcdrain (XPROCESS (proc)->outfd) != 0) error ("tcdrain() failed: %s", emacs_strerror (errno)); -#endif +#endif /* not WINDOWSNT */ /* Do nothing on Windows because writes are blocking. */ } else @@ -7672,10 +7595,8 @@ defsubr (&Slist_processes); defsubr (&Sprocess_list); defsubr (&Sstart_process); -#ifdef HAVE_SERIAL defsubr (&Sserial_process_configure); defsubr (&Smake_serial_process); -#endif /* HAVE_SERIAL */ defsubr (&Sset_network_process_option); defsubr (&Smake_network_process); defsubr (&Sformat_network_address); === modified file 'src/sysdep.c' --- src/sysdep.c 2010-08-09 09:35:21 +0000 +++ src/sysdep.c 2010-08-22 15:14:37 +0000 @@ -35,15 +35,7 @@ #endif #include "lisp.h" -/* Including stdlib.h isn't necessarily enough to get srandom - declared, e.g. without __USE_XOPEN_EXTENDED with glibc 2. */ - -/* The w32 build defines select stuff in w32.h, which is included by - sys/select.h (included below). */ -#ifndef WINDOWSNT #include "sysselect.h" -#endif - #include "blockinput.h" #ifdef WINDOWSNT @@ -84,17 +76,13 @@ #include #endif -#ifndef MSDOS -#include -#endif - #include "systty.h" #include "syswait.h" -#if defined (USG) +#ifdef HAVE_SYS_UTSNAME_H #include #include -#endif /* USG */ +#endif /* HAVE_SYS_UTSNAME_H */ #include "keyboard.h" #include "frame.h" @@ -149,17 +137,6 @@ 1800, 2400, 4800, 9600, 19200, 38400 }; -#ifdef HAVE_SPEED_T -#include -#else -#if defined (HAVE_LIBNCURSES) && ! defined (NCURSES_OSPEED_T) -#else -#if defined (HAVE_TERMIOS_H) && defined (GNU_LINUX) -#include -#endif -#endif -#endif - int emacs_ospeed; void croak (char *) NO_RETURN; @@ -308,32 +285,11 @@ #ifdef DOS_NT emacs_ospeed = 15; #else /* not DOS_NT */ -#ifdef HAVE_TERMIOS struct termios sg; sg.c_cflag = B9600; tcgetattr (fd, &sg); emacs_ospeed = cfgetospeed (&sg); -#else /* not TERMIOS */ -#ifdef HAVE_TERMIO - struct termio sg; - - sg.c_cflag = B9600; -#ifdef HAVE_TCATTR - tcgetattr (fd, &sg); -#else - ioctl (fd, TCGETA, &sg); -#endif - emacs_ospeed = sg.c_cflag & CBAUD; -#else /* neither TERMIOS nor TERMIO */ - struct sgttyb sg; - - sg.sg_ospeed = B9600; - if (ioctl (fd, TIOCGETP, &sg) < 0) - abort (); - emacs_ospeed = sg.sg_ospeed; -#endif /* not HAVE_TERMIO */ -#endif /* not HAVE_TERMIOS */ #endif /* not DOS_NT */ } @@ -417,7 +373,7 @@ void flush_pending_output (int channel) { -#ifdef HAVE_TERMIOS +#ifndef DOS_NT /* If we try this, we get hit with SIGTTIN, because the child's tty belongs to the child's pgrp. */ #else @@ -447,8 +403,6 @@ struct emacs_tty s; EMACS_GET_TTY (out, &s); - -#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) s.main.c_oflag |= OPOST; /* Enable output postprocessing */ s.main.c_oflag &= ~ONLCR; /* Disable map of NL to CR-NL on output */ #ifdef NLDLY @@ -526,19 +480,7 @@ s.main.c_cc[VTIME] = 0; #endif -#else /* not HAVE_TERMIO */ - - s.main.sg_flags &= ~(ECHO | CRMOD | ANYP | ALLDELAY | RAW | LCASE - | CBREAK | TANDEM); - s.main.sg_flags |= LPASS8; - s.main.sg_erase = 0377; - s.main.sg_kill = 0377; - s.lmode = LLITOUT | s.lmode; /* Don't strip 8th bit */ - -#endif /* not HAVE_TERMIO */ - EMACS_SET_TTY (out, &s, 0); - #endif /* not WINDOWSNT */ } #endif /* MSDOS */ @@ -841,38 +783,11 @@ emacs_get_tty (int fd, struct emacs_tty *settings) { /* Retrieve the primary parameters - baud rate, character size, etcetera. */ -#ifdef HAVE_TCATTR +#ifndef DOS_NT /* We have those nifty POSIX tcmumbleattr functions. */ memset (&settings->main, 0, sizeof (settings->main)); if (tcgetattr (fd, &settings->main) < 0) return -1; - -#else -#ifdef HAVE_TERMIO - /* The SYSV-style interface? */ - if (ioctl (fd, TCGETA, &settings->main) < 0) - return -1; - -#else -#ifndef DOS_NT - /* I give up - I hope you have the BSD ioctls. */ - if (ioctl (fd, TIOCGETP, &settings->main) < 0) - return -1; -#endif /* not DOS_NT */ -#endif -#endif - - /* Suivant - Do we have to get struct ltchars data? */ -#ifdef HAVE_LTCHARS - if (ioctl (fd, TIOCGLTC, &settings->ltchars) < 0) - return -1; -#endif - - /* How about a struct tchars and a wordful of lmode bits? */ -#ifdef HAVE_TCHARS - if (ioctl (fd, TIOCGETC, &settings->tchars) < 0 - || ioctl (fd, TIOCLGET, &settings->lmode) < 0) - return -1; #endif /* We have survived the tempest. */ @@ -888,7 +803,7 @@ emacs_set_tty (int fd, struct emacs_tty *settings, int flushp) { /* Set the primary parameters - baud rate, character size, etcetera. */ -#ifdef HAVE_TCATTR +#ifndef DOS_NT int i; /* We have those nifty POSIX tcmumbleattr functions. William J. Smith writes: @@ -926,34 +841,6 @@ else continue; } - -#else -#ifdef HAVE_TERMIO - /* The SYSV-style interface? */ - if (ioctl (fd, flushp ? TCSETAF : TCSETAW, &settings->main) < 0) - return -1; - -#else -#ifndef DOS_NT - /* I give up - I hope you have the BSD ioctls. */ - if (ioctl (fd, (flushp) ? TIOCSETP : TIOCSETN, &settings->main) < 0) - return -1; -#endif /* not DOS_NT */ - -#endif -#endif - - /* Suivant - Do we have to get struct ltchars data? */ -#ifdef HAVE_LTCHARS - if (ioctl (fd, TIOCSLTC, &settings->ltchars) < 0) - return -1; -#endif - - /* How about a struct tchars and a wordful of lmode bits? */ -#ifdef HAVE_TCHARS - if (ioctl (fd, TIOCSETC, &settings->tchars) < 0 - || ioctl (fd, TIOCLSET, &settings->lmode) < 0) - return -1; #endif /* We have survived the tempest. */ @@ -976,13 +863,6 @@ char _sobuf[BUFSIZ]; #endif -#ifdef HAVE_LTCHARS -static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1}; -#endif -#ifdef HAVE_TCHARS -static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1}; -#endif - /* Initialize the terminal mode on all tty devices that are currently open. */ @@ -1016,7 +896,7 @@ tty = *tty_out->old_tty; -#if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) +#if !defined (DOS_NT) XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]); tty.main.c_iflag |= (IGNBRK); /* Ignore break condition */ @@ -1088,12 +968,11 @@ of C-z */ #endif /* VSWTCH */ -#if defined (__mips__) || defined (HAVE_TCATTR) #ifdef VSUSP - tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z. */ + tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off handling of C-z. */ #endif /* VSUSP */ #ifdef V_DSUSP - tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off mips handling of C-y. */ + tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off handling of C-y. */ #endif /* V_DSUSP */ #ifdef VDSUSP /* Some systems have VDSUSP, some have V_DSUSP. */ tty.main.c_cc[VDSUSP] = CDISABLE; @@ -1129,7 +1008,6 @@ tty.main.c_cc[VSTOP] = CDISABLE; #endif /* VSTOP */ } -#endif /* mips or HAVE_TCATTR */ #ifdef AIX tty.main.c_cc[VSTRT] = CDISABLE; @@ -1152,41 +1030,8 @@ tty.main.c_iflag &= ~IGNBRK; tty.main.c_iflag &= ~BRKINT; #endif -#else /* if not HAVE_TERMIO */ -#ifndef DOS_NT - XSETINT (Vtty_erase_char, tty.main.sg_erase); - tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS); - if (meta_key) - tty.main.sg_flags |= ANYP; - tty.main.sg_flags |= interrupt_input ? RAW : CBREAK; #endif /* not DOS_NT */ -#endif /* not HAVE_TERMIO */ - - /* If going to use CBREAK mode, we must request C-g to interrupt - and turn off start and stop chars, etc. If not going to use - CBREAK mode, do this anyway so as to turn off local flow - control for user coming over network on 4.2; in this case, - only t_stopc and t_startc really matter. */ -#ifndef HAVE_TERMIO -#ifdef HAVE_TCHARS - /* Note: if not using CBREAK mode, it makes no difference how we - set this */ - tty.tchars = new_tchars; - tty.tchars.t_intrc = quit_char; - if (tty_out->flow_control) - { - tty.tchars.t_startc = '\021'; - tty.tchars.t_stopc = '\023'; - } - - tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode; - -#endif /* HAVE_TCHARS */ -#endif /* not HAVE_TERMIO */ - -#ifdef HAVE_LTCHARS - tty.ltchars = new_ltchars; -#endif /* HAVE_LTCHARS */ + #ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */ if (!tty_out->term_initted) internal_terminal_init (); @@ -1205,7 +1050,7 @@ if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0); #endif -#if defined (HAVE_TERMIOS) || defined (HPUX) +#if !defined (DOS_NT) #ifdef TCOON if (!tty_out->flow_control) tcflow (fileno (tty_out->input), TCOON); #endif @@ -2688,7 +2533,7 @@ } #endif /* HAVE_STRSIGNAL */ -#ifdef HAVE_TERMIOS +#ifndef DOS_NT /* For make-serial-process */ int serial_open (char *port) @@ -2717,9 +2562,6 @@ return fd; } -#endif /* TERMIOS */ - -#ifdef HAVE_TERMIOS #if !defined (HAVE_CFMAKERAW) /* Workaround for targets which are missing cfmakeraw. */ @@ -2906,7 +2748,7 @@ p->childp = childp2; } -#endif /* TERMIOS */ +#endif /* not DOS_NT */ /* System depended enumeration of and access to system processes a-la ps(1). */ === modified file 'src/systty.h' --- src/systty.h 2010-06-08 03:02:41 +0000 +++ src/systty.h 2010-08-22 15:14:37 +0000 @@ -17,34 +17,17 @@ You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . */ -#ifdef HAVE_TERMIOS -#define HAVE_TCATTR -#endif - - /* Include the proper files. */ -#ifdef HAVE_TERMIO +#ifndef DOS_NT #ifndef NO_TERMIO #include #endif /* not NO_TERMIO */ -#include -#else /* not HAVE_TERMIO */ -#ifdef HAVE_TERMIOS -#ifndef NO_TERMIO -#include -#endif #include #include -#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */ -#ifndef DOS_NT -#include #endif /* not DOS_NT */ -#endif /* not HAVE_TERMIOS */ -#endif /* not HAVE_TERMIO */ -#ifdef __GNU_LIBRARY__ +#ifdef HAVE_SYS_IOCTL_H #include -#include #endif #ifdef HPUX @@ -74,17 +57,6 @@ #undef SIGIO #endif -/* On TERMIOS systems, the tcmumbleattr calls take care of these - parameters, and it's a bad idea to use them (on AIX, it makes the - tty hang for a long time). */ -#if defined (TIOCGLTC) && !defined (HAVE_TERMIOS) -#define HAVE_LTCHARS -#endif - -#if defined (TIOCGETC) && !defined (HAVE_TERMIOS) -#define HAVE_TCHARS -#endif - /* Try to establish the correct character to disable terminal functions in a system-independent manner. Note that USG (at least) define @@ -111,60 +83,19 @@ #define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TIOCOUTQ, (size))) #endif -#ifdef HAVE_TERMIO -#ifdef TCOUTQ -#undef EMACS_OUTQSIZE -#define EMACS_OUTQSIZE(fd, size) (ioctl ((fd), TCOUTQ, (size))) -#endif -#endif - /* Manipulate a terminal's current process group. */ -/* EMACS_HAVE_TTY_PGRP is true if we can get and set the tty's current - controlling process group. - - EMACS_GET_TTY_PGRP(int FD, int *PGID) sets *PGID the terminal FD's +/* EMACS_GET_TTY_PGRP(int FD, int *PGID) sets *PGID the terminal FD's current process group. Return -1 if there is an error. EMACS_SET_TTY_PGRP(int FD, int *PGID) sets the terminal FD's current process group to *PGID. Return -1 if there is an error. */ -/* HPUX tty process group stuff doesn't work, says the anonymous voice - from the past. */ -#ifndef HPUX -#ifdef TIOCGPGRP -#define EMACS_HAVE_TTY_PGRP -#else -#ifdef HAVE_TERMIOS -#define EMACS_HAVE_TTY_PGRP -#endif /* HAVE_TERMIOS */ -#endif /* TIOCGPGRP */ -#endif /* not HPUX */ - -#ifdef EMACS_HAVE_TTY_PGRP - -#if defined (HAVE_TERMIOS) - +#ifndef DOS_NT #define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp ((fd))) #define EMACS_SET_TTY_PGRP(fd, pgid) (tcsetpgrp ((fd), *(pgid))) - -#else /* not HAVE_TERMIOS */ -#ifdef TIOCSPGRP - -#define EMACS_GET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCGPGRP, (pgid))) -#define EMACS_SET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCSPGRP, (pgid))) - -#endif /* TIOCSPGRP */ -#endif /* HAVE_TERMIOS */ - -#else /* not EMACS_SET_TTY_PGRP */ - -/* Just ignore this for now and hope for the best */ -#define EMACS_GET_TTY_PGRP(fd, pgid) 0 -#define EMACS_SET_TTY_PGRP(fd, pgif) 0 - -#endif /* not EMACS_SET_TTY_PGRP */ +#endif /* not DOS_NT */ /* EMACS_GETPGRP (arg) returns the process group of the process. */ @@ -207,32 +138,11 @@ /* There is always one of the following elements, so there is no need for dummy get and set definitions. */ -#ifdef HAVE_TCATTR +#ifndef DOS_NT struct termios main; -#else /* not HAVE_TCATTR */ -#ifdef HAVE_TERMIO - struct termio main; -#else /* not HAVE_TERMIO */ -#ifdef DOS_NT +#else /* DOS_NT */ int main; -#else /* not DOS_NT */ - struct sgttyb main; -#endif /* not DOS_NT */ -#endif /* not HAVE_TERMIO */ -#endif /* not HAVE_TCATTR */ - -/* If we have TERMIOS, we don't need to do this - they're taken care of - by the tc*attr calls. */ -#ifndef HAVE_TERMIOS -#ifdef HAVE_LTCHARS - struct ltchars ltchars; -#endif /* HAVE_LTCHARS */ - -#ifdef HAVE_TCHARS - struct tchars tchars; - int lmode; -#endif /* HAVE_TCHARS */ -#endif /* not defined HAVE_TERMIOS */ +#endif /* DOS_NT */ }; /* Define EMACS_GET_TTY and EMACS_SET_TTY, @@ -249,7 +159,7 @@ /* Define EMACS_TTY_TABS_OK. */ -#ifdef HAVE_TERMIOS +#ifndef DOS_NT #ifdef TABDLY #define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3) @@ -257,21 +167,9 @@ #define EMACS_TTY_TABS_OK(p) 1 #endif /* not TABDLY */ -#else /* not def HAVE_TERMIOS */ -#ifdef HAVE_TERMIO - -#define EMACS_TTY_TABS_OK(p) (((p)->main.c_oflag & TABDLY) != TAB3) - -#else /* neither HAVE_TERMIO nor HAVE_TERMIOS */ - -#ifdef DOS_NT +#else /* DOS_NT */ #define EMACS_TTY_TABS_OK(p) 0 -#else /* not DOS_NT */ -#define EMACS_TTY_TABS_OK(p) (((p)->main.sg_flags & XTABS) != XTABS) -#endif /* not DOS_NT */ - -#endif /* not def HAVE_TERMIO */ -#endif /* not def HAVE_TERMIOS */ +#endif /* DOS_NT */ /* arch-tag: cf4b90bc-be41-401c-be98-40619178a712 (do not change this comment) */ ------------------------------------------------------------ revno: 101161 committer: Vinicius Jose Latorre - * whitespace.el: Fix slow cursor movement. Reported by Christoph - Groth and Liu Xin . + * whitespace.el: Fix slow cursor movement (Bug#6172). Reported by + Christoph Groth and Liu Xin . New version 13.0. (whitespace-empty-at-bob-regexp, whitespace-empty-at-eob-regexp): Adjust initialization. ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.