changeset 109528:56a8db5db6ae

Merge from mainline.
author Katsumi Yamaoka <katsumi@flagship2>
date Thu, 22 Jul 2010 14:43:25 +0000
parents 9f9765ec5fc2 (current diff) ced3f5ab1023 (diff)
children 35be6b7aa0ff
files
diffstat 30 files changed, 438 insertions(+), 252 deletions(-) [+]
line wrap: on
line diff
--- a/etc/ChangeLog	Tue Jul 20 14:21:52 2010 +0000
+++ b/etc/ChangeLog	Thu Jul 22 14:43:25 2010 +0000
@@ -1,3 +1,7 @@
+2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
+
+	* PROBLEMS: Add note about use of backslashes in Windows paths.
+
 2010-07-19  Juanma Barranquero  <lekktu@gmail.com>
 
 	* NEWS: Mention --enable-checking is now supported on Windows.
--- a/etc/NEWS	Tue Jul 20 14:21:52 2010 +0000
+++ b/etc/NEWS	Thu Jul 22 14:43:25 2010 +0000
@@ -296,6 +296,17 @@
 SQLite database without prompting; the "prd" connection would prompt
 for the users password and then connect to the Oracle database.
 
+**** Added SQL->Start... submenu when connections are defined.
+When connections have been defined, There is a submenu available that
+allows the user to select one to start a SQLi session.  The "Start
+SQLi Session" item moves to the "Start..." submenu when cnnections
+have been defined.
+
+**** Added "Save Connection" menu item in SQLi buffers.
+When a SQLi session is not started by a connection then
+`sql-save-connection' will gather the login params specified for the
+session and save them as a new connection.
+
 *** Added option `sql-send-terminator'.
 When set makes sure that each command sent with `sql-send-*' commands
 are properly terminated and submitted to the SQL processor.
--- a/etc/PROBLEMS	Tue Jul 20 14:21:52 2010 +0000
+++ b/etc/PROBLEMS	Thu Jul 22 14:43:25 2010 +0000
@@ -1037,7 +1037,7 @@
 
 This happens sometimes when using Metacity.  Resizing Emacs or ALT-Tab:bing
 makes the system unresponsive to the mouse or the keyboard.  Killing Emacs
-or shifting out from X11 and back again usually cures it (i.e. Ctrl-Alt-F1 
+or shifting out from X11 and back again usually cures it (i.e. Ctrl-Alt-F1
 and then Alt-F7).  A bug for it is here:
 https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/231034.
 Note that a permanent fix seems to be to disable "assistive technologies".
@@ -1514,7 +1514,7 @@
 (the one running rlogin, not the one running rlogind) using the
 stty command, before starting the rlogin process.  On many systems,
 "stty start u stop u" will do this.  On some systems, use
-"stty -ixon" instead. 
+"stty -ixon" instead.
 
 Some versions of tcsh will prevent even this from working.  One way
 around this is to start another shell before starting rlogin, and
@@ -2433,6 +2433,20 @@
 	2. Install the latest Windows SDK.
 	3. Replace emacs.ico with an older or edited icon.
 
+*** Building the MS-Windows port complains about unknown escape sequences.
+
+Errors and warnings can look like this:
+
+ w32.c:1959:27: error: \x used with no following hex digits
+ w32.c:1959:27: warning: unknown escape sequence '\i'
+
+This happens when paths using backslashes are passed to the compiler or
+linker (via -I and possibly other compiler flags); when these paths are
+included in source code, the backslashes are interpreted as escape sequences.
+See http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg00995.html
+
+The fix is to use forward slashes in all paths passed to the compiler.
+
 ** Linking
 
 *** Building Emacs with a system compiler fails to link because of an
--- a/lib-src/ChangeLog	Tue Jul 20 14:21:52 2010 +0000
+++ b/lib-src/ChangeLog	Thu Jul 22 14:43:25 2010 +0000
@@ -1,3 +1,12 @@
+2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
+
+	* emacsclient.c (get_current_dir_name, w32_get_resource)
+	(w32_getenv, w32_set_user_model_id, w32_window_app, w32_execvp)
+	(close_winsock, initialize_sockets, w32_find_emacs_process)
+	(w32_give_focus):
+	* ntlib.c (getlogin, getuid, getgid, getegid):
+	Convert definitions to standard C.
+
 2010-07-12  Andreas Schwab  <schwab@linux-m68k.org>
 
 	* Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS)
--- a/lib-src/emacsclient.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/lib-src/emacsclient.c	Thu Jul 22 14:43:25 2010 +0000
@@ -235,7 +235,7 @@
    Any other returned value must be freed with free.  This is used
    only when get_current_dir_name is not defined on the system.  */
 char*
-get_current_dir_name ()
+get_current_dir_name (void)
 {
   char *buf;
   char *pwd;
@@ -311,10 +311,7 @@
    Return NULL if the variable was not found, or it was empty.
    This code is based on w32_get_resource (w32.c).  */
 char *
-w32_get_resource (predefined, key, type)
-     HKEY predefined;
-     char *key;
-     LPDWORD type;
+w32_get_resource (HKEY predefined, char *key, LPDWORD type)
 {
   HKEY hrootkey = NULL;
   char *result = NULL;
@@ -347,8 +344,7 @@
   variables in the registry if they don't appear in the environment.
 */
 char *
-w32_getenv (envvar)
-     char *envvar;
+w32_getenv (char *envvar)
 {
   char *value;
   DWORD dwType;
@@ -396,7 +392,7 @@
 }
 
 void
-w32_set_user_model_id ()
+w32_set_user_model_id (void)
 {
   HMODULE shell;
   HRESULT (WINAPI * set_user_model) (wchar_t * id);
@@ -423,7 +419,7 @@
 }
 
 int
-w32_window_app ()
+w32_window_app (void)
 {
   static int window_app = -1;
   char szTitle[MAX_PATH];
@@ -446,13 +442,11 @@
   This is necessary due to the broken implementation of exec* routines in
   the Microsoft libraries: they concatenate the arguments together without
   quoting special characters, and pass the result to CreateProcess, with
-  predictably bad results.  By contrast, Posix execvp passes the arguments
+  predictably bad results.  By contrast, POSIX execvp passes the arguments
   directly into the argv array of the child process.
 */
 int
-w32_execvp (path, argv)
-     char *path;
-     char **argv;
+w32_execvp (const char *path, char **argv)
 {
   int i;
 
@@ -900,15 +894,15 @@
 
 #ifdef WINDOWSNT
 /* Wrapper to make WSACleanup a cdecl, as required by atexit.  */
-void
-__cdecl close_winsock ()
+void __cdecl
+close_winsock (void)
 {
   WSACleanup ();
 }
 
 /* Initialize the WinSock2 library.  */
 void
-initialize_sockets ()
+initialize_sockets (void)
 {
   WSADATA wsaData;
 
@@ -1408,9 +1402,7 @@
 FARPROC get_wc;  /* Pointer to RealGetWindowClassA.  */
 
 BOOL CALLBACK
-w32_find_emacs_process (hWnd, lParam)
-     HWND hWnd;
-     LPARAM lParam;
+w32_find_emacs_process (HWND hWnd, LPARAM lParam)
 {
   DWORD pid;
   char class[6];
@@ -1438,7 +1430,7 @@
  * process id = emacs_pid.  If found, allow it to grab the focus.
  */
 void
-w32_give_focus ()
+w32_give_focus (void)
 {
   HANDLE user32;
 
--- a/lib-src/ntlib.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/lib-src/ntlib.c	Thu Jul 22 14:43:25 2010 +0000
@@ -38,7 +38,7 @@
    would necessitate including windows.h in the files that used it.
    This is much easier.  */
 void
-sleep(unsigned long seconds)
+sleep (unsigned long seconds)
 {
   Sleep (seconds * 1000);
 }
@@ -56,7 +56,7 @@
 static int    getppid_ppid;
 
 int
-getppid(void)
+getppid (void)
 {
   char *ppid;
   DWORD result;
@@ -64,7 +64,7 @@
   ppid = getenv ("EM_PARENT_PROCESS_ID");
   if (!ppid)
     {
-      printf("no pid.\n");
+      printf ("no pid.\n");
       return 0;
     }
   else
@@ -74,11 +74,11 @@
 
   if (!getppid_parent)
     {
-      getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi(ppid));
+      getppid_parent = OpenProcess (SYNCHRONIZE, FALSE, atoi (ppid));
       if (!getppid_parent)
 	{
 	  printf ("Failed to open handle to parent process: %d\n",
-		 GetLastError());
+		 GetLastError ());
 	  exit (1);
 	}
     }
@@ -94,13 +94,13 @@
       return 1;
     case WAIT_FAILED:
     default:
-      printf ("Checking parent status failed: %d\n", GetLastError());
+      printf ("Checking parent status failed: %d\n", GetLastError ());
       exit (1);
     }
 }
 
 char *
-getlogin ()
+getlogin (void)
 {
   static char user_name[256];
   DWORD  length = sizeof (user_name);
@@ -120,19 +120,19 @@
 }
 
 unsigned
-getuid ()
+getuid (void)
 {
   return 0;
 }
 
 unsigned
-getgid ()
+getgid (void)
 {
   return 0;
 }
 
 unsigned
-getegid ()
+getegid (void)
 {
   return 0;
 }
@@ -219,7 +219,7 @@
 }
 
 FILE *
-sys_fopen(const char * path, const char * mode)
+sys_fopen (const char * path, const char * mode)
 {
   return fopen (path, mode);
 }
--- a/lisp/ChangeLog	Tue Jul 20 14:21:52 2010 +0000
+++ b/lisp/ChangeLog	Thu Jul 22 14:43:25 2010 +0000
@@ -1,3 +1,45 @@
+2010-07-22  Juanma Barranquero  <lekktu@gmail.com>
+
+	* dired.el (dired-no-confirm): Document value t and fix defcustom to
+	accept it (bug#6597).  Suggested by Drew Adams <drew.adams@oracle.com>.
+
+2010-07-22  Teemu Likonen  <tlikonen@iki.fi>  (tiny change)
+
+	* dired.el (dired-mode-map): Use command remapping (bug#6632).
+
+2010-07-22  Lawrence Mitchell  <wence@gmx.li>
+
+	* term/vt100.el (vt100-wide-mode): Fix :init-value keyword (bug#6620).
+
+2010-07-21  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-get-ls-command)
+	(tramp-get-ls-command-with-dired): Run tests on "/dev/null"
+	instead of "/".
+
+2010-07-20  Michael R. Mauger  <mmaug@yahoo.com>
+
+	* progmodes/sql.el: Version 2.3.
+	(sql-connection-alist): Changed keys from symbols to strings;
+	enhanced the widget definition.
+	(sql-mode-menu): Added submenu to select connections.
+	(sql-interactive-mode-menu): Added "Save Connection" item.
+	(sql-add-product): Fixed menu item.
+	(sql-get-product-feature): Improved error handling.
+	(sql--alt-buffer-part, sql--alt-if-not-empty): Removed.
+	(sql-make-alternate-buffer-name): Simplified.
+	(sql-product-interactive): Handle missing product.
+	(sql-connect): Support string keys, minor improvements.
+	(sql-save-connection): New function.
+	(sql-connection-menu-filter): New function.
+
+2010-07-20  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (tramp-file-name-handler): Trace 'quit.
+	(tramp-open-connection-setup-interactive-shell): Apply
+	workaround for IRIX64 bug.  Move argument of last
+	`tramp-send-command' where it belongs to.
+
 2010-07-20  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp.el (tramp-perl-file-attributes)
--- a/lisp/dired.el	Tue Jul 20 14:21:52 2010 +0000
+++ b/lisp/dired.el	Thu Jul 22 14:43:25 2010 +0000
@@ -1380,10 +1380,8 @@
     (define-key map ">" 'dired-next-dirline)
     (define-key map "^" 'dired-up-directory)
     (define-key map " "  'dired-next-line)
-    (define-key map "\C-n" 'dired-next-line)
-    (define-key map "\C-p" 'dired-previous-line)
-    (define-key map [down] 'dired-next-line)
-    (define-key map [up] 'dired-previous-line)
+    (define-key map [remap next-line] 'dired-next-line)
+    (define-key map [remap previous-line] 'dired-previous-line)
     ;; hiding
     (define-key map "$" 'dired-hide-subdir)
     (define-key map "\M-$" 'dired-hide-all)
@@ -1393,7 +1391,7 @@
     (define-key map (kbd "M-s f C-s")   'dired-isearch-filenames)
     (define-key map (kbd "M-s f M-C-s") 'dired-isearch-filenames-regexp)
     ;; misc
-    (define-key map "\C-x\C-q" 'dired-toggle-read-only)
+    (define-key map [remap toggle-read-only] 'dired-toggle-read-only)
     (define-key map "?" 'dired-summary)
     (define-key map "\177" 'dired-unmark-backward)
     (define-key map [remap undo] 'dired-undo)
@@ -2765,17 +2763,19 @@
     (fit-window-to-buffer (get-buffer-window buf) nil 1)))
 
 (defcustom dired-no-confirm nil
-  "A list of symbols for commands Dired should not confirm.
+  "A list of symbols for commands Dired should not confirm, or t.
 Command symbols are `byte-compile', `chgrp', `chmod', `chown', `compress',
 `copy', `delete', `hardlink', `load', `move', `print', `shell', `symlink',
-`touch' and `uncompress'."
+`touch' and `uncompress'.
+If t, confirmation is never needed."
   :group 'dired
-  :type '(set (const byte-compile) (const chgrp)
-	      (const chmod) (const chown) (const compress)
-	      (const copy) (const delete) (const hardlink)
-	      (const load) (const move) (const print)
-	      (const shell) (const symlink) (const touch)
-	      (const uncompress)))
+  :type '(choice (const :tag "Confirmation never needed" t)
+		 (set (const byte-compile) (const chgrp)
+		      (const chmod) (const chown) (const compress)
+		      (const copy) (const delete) (const hardlink)
+		      (const load) (const move) (const print)
+		      (const shell) (const symlink) (const touch)
+		      (const uncompress))))
 
 (defun dired-mark-pop-up (bufname op-symbol files function &rest args)
   "Return FUNCTION's result on ARGS after showing which files are marked.
--- a/lisp/gnus/ChangeLog	Tue Jul 20 14:21:52 2010 +0000
+++ b/lisp/gnus/ChangeLog	Thu Jul 22 14:43:25 2010 +0000
@@ -1,3 +1,8 @@
+2010-07-21  Daiki Ueno  <ueno@unixuser.org>
+
+	* mml.el (mml-parse-1): Collect "certfile" attributes in "<#secure>"
+	tag (Bug#6654).
+
 2010-07-20  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-sum.el (gnus-summary-bookmark-make-record): Bookmark position in
--- a/lisp/gnus/mml.el	Tue Jul 20 14:21:52 2010 +0000
+++ b/lisp/gnus/mml.el	Thu Jul 22 14:43:25 2010 +0000
@@ -228,7 +228,10 @@
 	(let* (secure-mode
 	       (taginfo (mml-read-tag))
 	       (keyfile (cdr (assq 'keyfile taginfo)))
-	       (certfile (cdr (assq 'certfile taginfo)))
+	       (certfiles (delq nil (mapcar (lambda (tag)
+					      (if (eq (car-safe tag) 'certfile)
+						  (cdr tag)))
+					    taginfo)))
 	       (recipients (cdr (assq 'recipients taginfo)))
 	       (sender (cdr (assq 'sender taginfo)))
 	       (location (cdr (assq 'tag-location taginfo)))
@@ -254,8 +257,10 @@
 				 ,@tags
 				 ,(if keyfile "keyfile")
 				 ,keyfile
-				 ,(if certfile "certfile")
-				 ,certfile
+				 ,@(apply #'append
+					  (mapcar (lambda (certfile)
+						    (list "certfile" certfile))
+						  certfiles))
 				 ,(if recipients "recipients")
 				 ,recipients
 				 ,(if sender "sender")
--- a/lisp/net/tramp.el	Tue Jul 20 14:21:52 2010 +0000
+++ b/lisp/net/tramp.el	Thu Jul 22 14:43:25 2010 +0000
@@ -5565,12 +5565,23 @@
 	    (if foreign
 		(condition-case err
 		    (apply foreign operation args)
+
+		  ;; Trace that somebody has interrupted the
+		  ;; operation.
+		  (quit
+		   (let (tramp-message-show-message)
+		     (tramp-message
+		      v 1 "Interrupt received in operation %s"
+		      (append (list operation) args)))
+		   ;; Propagate the quit signal.
+		   (signal (car err) (cdr err)))
+
+		  ;; When we are in completion mode, some failed
+		  ;; operations shall return at least a default value
+		  ;; in order to give the user a chance to correct the
+		  ;; file name in the minibuffer.
 		  (error
 		   (cond
-		    ;; When we are in completion mode, some failed
-		    ;; operations shall return at least a default
-		    ;; value in order to give the user a chance to
-		    ;; correct the file name in the minibuffer.
 		    ((and completion (zerop (length localname))
 			  (memq operation '(file-exists-p file-directory-p)))
 		     t)
@@ -5580,6 +5591,7 @@
 		     filename)
 		    ;; Propagate the error.
 		    (t (signal (car err) (cdr err))))))
+
 	      ;; Nothing to do for us.
 	      (tramp-run-real-handler operation args)))))
 
@@ -7033,6 +7045,12 @@
   ;; Disable unexpected output.
   (tramp-send-command vec "mesg n; biff n" t)
 
+  ;; IRIX64 bash expands "!" even when in single quotes.  This
+  ;; destroys our shell functions, we must disable it.  See
+  ;; <http://stackoverflow.com/questions/3291692/irix-bash-shell-expands-expression-in-single-quotes-yet-shouldnt>.
+  (when (string-match "^IRIX64" (tramp-get-connection-property vec "uname" ""))
+    (tramp-send-command vec "set +H" t))
+
   ;; Set the environment.
   (tramp-message vec 5 "Setting default environment")
 
@@ -7048,7 +7066,7 @@
       (setq env (cdr env)))
     (when unset
       (tramp-send-command
-       vec (format "unset %s" (mapconcat 'identity unset " "))))) t)
+       vec (format "unset %s" (mapconcat 'identity unset " ")) t))))
 
 ;; CCC: We should either implement a Perl version of base64 encoding
 ;; and decoding.  Then we just use that in the last item.  The other
@@ -8326,7 +8344,8 @@
 	     (when (zerop (tramp-send-command-and-check
 			   vec (format "%s -lnd /" result)))
 	       (when (zerop (tramp-send-command-and-check
-			     vec (format "%s --color=never -al /" result)))
+			     vec (format
+				  "%s --color=never -al /dev/null" result)))
 		 (setq result (concat result " --color=never")))
 	       (throw 'ls-found result))
 	     (setq dl (cdr dl))))))
@@ -8340,7 +8359,8 @@
       ;; they fail when "-al" is after the "--dired" argument (for
       ;; example on FreeBSD).
       (zerop (tramp-send-command-and-check
-	      vec (format "%s --dired -al /" (tramp-get-ls-command vec)))))))
+	      vec (format "%s --dired -al /dev/null"
+			  (tramp-get-ls-command vec)))))))
 
 (defun tramp-get-test-command (vec)
   (with-connection-property vec "test"
--- a/lisp/progmodes/sql.el	Tue Jul 20 14:21:52 2010 +0000
+++ b/lisp/progmodes/sql.el	Thu Jul 22 14:43:25 2010 +0000
@@ -5,7 +5,7 @@
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Michael Mauger <mmaug@yahoo.com>
-;; Version: 2.2
+;; Version: 2.3
 ;; Keywords: comm languages processes
 ;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el
 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode
@@ -188,7 +188,7 @@
 ;;           (sql-comint product params)))
 ;;
 ;;     (sql-set-product-feature 'xyz
-;;                              :sqli-connect-func 'my-sql-comint-xyz)
+;;                              :sqli-comint-func 'my-sql-comint-xyz)
 
 ;; 6) Define a convienence function to invoke the SQL interpreter.
 
@@ -236,9 +236,8 @@
 (eval-when-compile
   (require 'regexp-opt))
 (require 'custom)
-(require 'assoc)
 (eval-when-compile ;; needed in Emacs 19, 20
-  (setq max-specpdl-size 2000))
+  (setq max-specpdl-size (max max-specpdl-size 2000)))
 
 (defvar font-lock-keyword-face)
 (defvar font-lock-set-defaults)
@@ -539,7 +538,7 @@
 If a SQL-VARIABLE is part of the connection, it will not be
 prompted for during login."
 
-  :type `(alist :key-type (symbol :tag "Connection")
+  :type `(alist :key-type (string :tag "Connection")
                 :value-type
                 (set
                  (group (const :tag "Product"  sql-product)
@@ -554,7 +553,11 @@
                  (group (const :tag "Password" sql-password) string)
                  (group (const :tag "Server"   sql-server)   string)
                  (group (const :tag "Database" sql-database) string)
-                 (group (const :tag "Port"     sql-port)     integer)))
+                 (group (const :tag "Port"     sql-port)     integer)
+                 (repeat :inline t
+                         (list :tab "Other"
+                               (symbol :tag " Variable Symbol")
+                               (sexp   :tag "Value Expression")))))
   :version "24.1"
   :group 'SQL)
 
@@ -1115,8 +1118,17 @@
 				       (get-buffer-process sql-buffer))]
    ["Send String" sql-send-string (and (buffer-live-p sql-buffer)
 				       (get-buffer-process sql-buffer))]
-   ["--" nil nil]
-   ["Start SQLi session" sql-product-interactive (sql-get-product-feature sql-product :sqli-comint-func)]
+   "--"
+   ["Start SQLi session" sql-product-interactive
+    :visible (not sql-connection-alist)
+    :enable (sql-get-product-feature sql-product :sqli-comint-func)]
+   ("Start..."
+    :visible sql-connection-alist
+    :filter sql-connection-menu-filter
+    "--"
+    ["New SQLi Session" sql-product-interactive (sql-get-product-feature sql-product :sqli-comint-func)])
+   ["--"
+    :visible sql-connection-alist]
    ["Show SQLi buffer" sql-show-sqli-buffer t]
    ["Set SQLi buffer" sql-set-sqli-buffer t]
    ["Pop to SQLi buffer after send"
@@ -1144,7 +1156,8 @@
  sql-interactive-mode-menu sql-interactive-mode-map
  "Menu for `sql-interactive-mode'."
  '("SQL"
-   ["Rename Buffer" sql-rename-buffer t]))
+   ["Rename Buffer" sql-rename-buffer t]
+   ["Save Connection" sql-save-connection (not sql-connection)]))
 
 ;; Abbreviations -- if you want more of them, define them in your
 ;; ~/.emacs file.  Abbrevs have to be enabled in your ~/.emacs, too.
@@ -2028,7 +2041,7 @@
 			;; Each product is represented by a radio
 			;; button with it's display name.
 			`[,display
-			  (lambda () (interactive) (sql-set-product ',product))
+			  (sql-set-product ',product)
 			 :style radio
 			 :selected (eq sql-product ',product)]
 			;; Maintain the product list in
@@ -2103,7 +2116,8 @@
                (symbolp v))
               (symbol-value v)
             v))
-      (message "`%s' is not a known product; use `sql-add-product' to add it first." product))))
+      (message "`%s' is not a known product; use `sql-add-product' to add it first." product)
+      nil)))
 
 (defun sql-product-font-lock (keywords-only imenu)
   "Configure font-lock and imenu with product-specific settings.
@@ -2480,13 +2494,6 @@
 	(message "Buffer %s has no process." (buffer-name sql-buffer))
       (message "Current SQLi buffer is %s." (buffer-name sql-buffer)))))
 
-(defun sql--alt-buffer-part (delim part)
-  (unless (string= "" part)
-    (list delim part)))
-
-(defun sql--alt-if-not-empty (s)
-  (if (string= "" s) nil s))
-
 (defun sql-make-alternate-buffer-name ()
   "Return a string that can be used to rename a SQLi buffer.
 
@@ -2502,40 +2509,44 @@
 If all else fails, the alternate name would be the user and
 server/database name."
 
-  (or
-   ;; If started by sql-connect, use that
-   (sql--alt-if-not-empty
-    (when sql-connection (symbol-name sql-connection)))
-
-   ;; based on :sqli-login setting
-   (sql--alt-if-not-empty
-    (apply 'concat
-           (cdr
-            (apply 'append nil
-                   (mapcar
-                    (lambda (v)
-                      (cond
-                       ((eq v 'user)     (sql--alt-buffer-part "/" sql-user))
-                       ((eq v 'server)   (sql--alt-buffer-part "@" sql-server))
-                       ((eq v 'database) (sql--alt-buffer-part "@" sql-database))
-                       ((eq v 'port)     (sql--alt-buffer-part ":" sql-port))
-
-                       ((eq v 'password) nil)
-                       (t                nil)))
-                    (sql-get-product-feature sql-product :sqli-login))))))
-
-   ;; Default: username/server format
-   (sql--alt-if-not-empty
-    (concat (if (string= "" sql-user)
-                (if (string= "" (user-login-name))
-                    ()
-                  (concat (user-login-name) "/"))
-              (concat sql-user "/"))
-            (if (string= "" sql-database)
-                (if (string= "" sql-server)
-                    (system-name)
-                  sql-server)
-              sql-database)))))
+  (let ((name ""))
+
+    ;; Try using the :sqli-login setting
+    (when (string= "" (or name ""))
+      (setq name
+            (apply 'concat
+                   (apply 'append nil
+                          (mapcar
+                           (lambda (v)
+                             (cond
+                              ((eq v 'user)     (list "/" sql-user))
+                              ((eq v 'server)   (list "." sql-server))
+                              ((eq v 'database) (list "@" sql-database))
+                              ((eq v 'port)     (list ":" sql-port))
+
+                              ((eq v 'password) nil)
+                              (t                nil)))
+                           (sql-get-product-feature sql-product :sqli-login))))))
+
+    ;; Default: username/server format
+    (when (string= "" (or name ""))
+      (setq name
+            (concat " "
+                    (if (string= "" sql-user)
+                        (if (string= "" (user-login-name))
+                            ()
+                          (concat (user-login-name) "/"))
+                      (concat sql-user "/"))
+                    (if (string= "" sql-database)
+                        (if (string= "" sql-server)
+                            (system-name)
+                          sql-server)
+                      sql-database))))
+
+    ;; Return the final string; prefixed by the connection name
+    (if sql-connection
+        (format "<%s>%s" sql-connection (or name ""))
+      (substring (or name " ") 1))))
 
 (defun sql-rename-buffer ()
   "Rename a SQLi buffer."
@@ -2959,55 +2970,58 @@
                                            sql-product-alist)
                                    nil 'require-match
                                    (or (and sql-product (symbol-name sql-product)) "ansi"))))
-         ((symbolp product) product)    ; Product specified
+         ((and product                  ; Product specified
+               (symbolp product)) product)
          (t sql-product)))              ; Default to sql-product
 
-  (when (sql-get-product-feature product :sqli-comint-func)
-    (if (and sql-buffer
-             (buffer-live-p sql-buffer)
-	     (comint-check-proc sql-buffer))
-	(pop-to-buffer sql-buffer)
-
-      ;; Is the current buffer in sql-mode and
-      ;; there is a buffer local setting of sql-buffer
-      (let* ((start-buffer
-	      (and (derived-mode-p 'sql-mode)
-		   (current-buffer)))
-	     (start-sql-buffer
-	      (and start-buffer
-		   (let (found)
-		     (dolist (var (buffer-local-variables))
-		       (and (consp var)
-			    (eq (car var) 'sql-buffer)
-			    (buffer-live-p (cdr var))
-			    (get-buffer-process (cdr var))
-			    (setq found (cdr var))))
-		     found)))
-	     new-sqli-buffer)
-
-	;; Get credentials.
-	(apply 'sql-get-login (sql-get-product-feature product :sqli-login))
-
-	;; Connect to database.
-	(message "Login...")
-	(funcall (sql-get-product-feature product :sqli-comint-func)
-                 product
-                 (sql-get-product-feature product :sqli-options))
-
-	;; Set SQLi mode.
-	(setq sql-interactive-product product
-	      new-sqli-buffer (current-buffer)
-	      sql-buffer new-sqli-buffer)
-	(sql-interactive-mode)
-
-	;; Set `sql-buffer' in the start buffer
-	(when (and start-buffer (not start-sql-buffer))
-	  (with-current-buffer start-buffer
-	    (setq sql-buffer new-sqli-buffer)))
-
-	;; All done.
-	(message "Login...done")
-	(pop-to-buffer sql-buffer)))))
+  (if product
+      (when (sql-get-product-feature product :sqli-comint-func)
+        (if (and sql-buffer
+                 (buffer-live-p sql-buffer)
+                 (comint-check-proc sql-buffer))
+            (pop-to-buffer sql-buffer)
+
+          ;; Is the current buffer in sql-mode and
+          ;; there is a buffer local setting of sql-buffer
+          (let* ((start-buffer
+                  (and (derived-mode-p 'sql-mode)
+                       (current-buffer)))
+                 (start-sql-buffer
+                  (and start-buffer
+                       (let (found)
+                         (dolist (var (buffer-local-variables))
+                           (and (consp var)
+                                (eq (car var) 'sql-buffer)
+                                (buffer-live-p (cdr var))
+                                (get-buffer-process (cdr var))
+                                (setq found (cdr var))))
+                         found)))
+                 new-sqli-buffer)
+
+            ;; Get credentials.
+            (apply 'sql-get-login (sql-get-product-feature product :sqli-login))
+
+            ;; Connect to database.
+            (message "Login...")
+            (funcall (sql-get-product-feature product :sqli-comint-func)
+                     product
+                     (sql-get-product-feature product :sqli-options))
+
+            ;; Set SQLi mode.
+            (setq sql-interactive-product product
+                  new-sqli-buffer (current-buffer)
+                  sql-buffer new-sqli-buffer)
+            (sql-interactive-mode)
+
+            ;; Set `sql-buffer' in the start buffer
+            (when (and start-buffer (not start-sql-buffer))
+              (with-current-buffer start-buffer
+                (setq sql-buffer new-sqli-buffer)))
+
+            ;; All done.
+            (message "Login...done")
+            (pop-to-buffer sql-buffer))))
+    (message "No default SQL product defined.  Set `sql-product'.")))
 
 (defun sql-comint (product params)
   "Set up a comint buffer to run the SQL processor.
@@ -3032,11 +3046,11 @@
   (interactive
    (if sql-connection-alist
        (list
-        (intern
-         (completing-read "Connection: "
-                          (mapcar (lambda (c) (symbol-name (car c)))
-                                  sql-connection-alist)
-                          nil t)))
+        (let ((completion-ignore-case t))
+          (completing-read "Connection: "
+                           (mapcar (lambda (c) (car c))
+                                   sql-connection-alist)
+                           nil t nil nil '(()))))
      nil))
 
   ;; Are there connections defined
@@ -3044,12 +3058,12 @@
       ;; Was one selected
       (when connection
         ;; Get connection settings
-        (let ((connect-set  (aget sql-connection-alist connection)))
+        (let ((connect-set  (assoc connection sql-connection-alist)))
           ;; Settings are defined
           (if connect-set
               ;; Set the desired parameters
               (eval `(let*
-                         (,@connect-set
+                         (,@(cdr connect-set)
                           ;; :sqli-login params variable
                           (param-var    (sql-get-product-feature sql-product
                                                                  :sqli-login nil t))
@@ -3066,14 +3080,14 @@
                                             ((eq (car v) 'sql-database) 'database)
                                             ((eq (car v) 'sql-port)     'port)
                                             (t                          (car v))))
-                                         connect-set))
+                                         (cdr connect-set)))
                           ;; the remaining params (w/o the connection params)
-                          (rem-params   (apply 'append nil
-                                               (mapcar
-                                                (lambda (l)
-                                                  (unless (member l set-params)
-                                                    (list l)))
-                                                login-params)))
+                          (rem-params   (delq nil
+                                              (mapcar
+                                               (lambda (l)
+                                                 (unless (member l set-params)
+                                                   l))
+                                               login-params)))
                           ;; Remember the connection
                           (sql-connection connection))
 
@@ -3081,11 +3095,66 @@
                        ;; interactive session
                        (eval `(let ((,param-var ',rem-params))
                                 (sql-product-interactive sql-product)))))
-            (message "SQL Connection \"%s\" does not exist" connection)
+            (message "SQL Connection <%s> does not exist" connection)
             nil)))
     (message "No SQL Connections defined")
     nil))
 
+(defun sql-save-connection (name)
+  "Captures the connection information of the current SQLi session.
+
+The information is appended to `sql-connection-alist' and
+optionally is saved to the user's init file."
+
+  (interactive "sNew connection name: ")
+
+  (if sql-connection
+      (message "This session was started by a connection; it's already been saved.")
+
+    (let ((login (sql-get-product-feature sql-product :sqli-login))
+          (alist sql-connection-alist)
+          connect)
+
+      ;; Remove the existing connection if the user says so
+      (when (and (assoc name alist)
+                 (yes-or-no-p (format "Replace connection definition <%s>? " name)))
+        (setq alist (assq-delete-all name alist)))
+
+      ;; Add the new connection if it doesn't exist
+      (if (assoc name alist)
+          (message "Connection <%s> already exists" name)
+        (setq connect
+              (append (list name)
+                      (delq nil
+                            (mapcar
+                             (lambda (param)
+                               (cond
+                                ((eq param 'product)  `(sql-product  (quote ,sql-product)))
+                                ((eq param 'user)     `(sql-user     ,sql-user))
+                                ((eq param 'database) `(sql-database ,sql-database))
+                                ((eq param 'server)   `(sql-server   ,sql-server))
+                                ((eq param 'port)     `(sql-port     ,sql-port))))
+                             (append (list 'product) login)))))
+
+        (setq alist (append alist (list connect)))
+
+        ;; confirm whether we want to save the connections
+        (if (yes-or-no-p "Save the connections for future sessions? ")
+            (customize-save-variable 'sql-connection-alist alist)
+          (customize-set-variable 'sql-connection-alist alist))))))
+
+(defun sql-connection-menu-filter (tail)
+  "Generates menu entries for using each connection."
+  (append
+   (mapcar
+    (lambda (conn)
+      (vector
+       (format "Connection <%s>" (car conn))
+       (list 'sql-connect (car conn))
+       t))
+    sql-connection-alist)
+   tail))
+
 ;;;###autoload
 (defun sql-oracle ()
   "Run sqlplus by Oracle as an inferior process.
--- a/lisp/term/vt100.el	Tue Jul 20 14:21:52 2010 +0000
+++ b/lisp/term/vt100.el	Thu Jul 22 14:43:25 2010 +0000
@@ -45,7 +45,7 @@
   "Toggle 132/80 column mode for vt100s.
 With positive argument, switch to 132-column mode.
 With negative argument, switch to 80-column mode."
-  :global t :initial-value (= (frame-width) 132)
+  :global t :init-value (= (frame-width) 132)
   (send-string-to-terminal (if vt100-wide-mode "\e[?3h" "\e[?3l"))
   (set-frame-width terminal-frame (if vt100-wide-mode 132 80)))
 
--- a/nt/ChangeLog	Tue Jul 20 14:21:52 2010 +0000
+++ b/nt/ChangeLog	Thu Jul 22 14:43:25 2010 +0000
@@ -1,3 +1,20 @@
+2010-07-21  Juanma Barranquero  <lekktu@gmail.com>
+
+	* INSTALL: Add note about backslashes in Windows paths.
+	Fix typos.  Simplify references to Windows versions.
+
+2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
+
+	* addpm.c (add_registry, main):
+	* cmdproxy.c (get_env_size):
+	* ddeclient.c (main):
+	* runemacs.c (set_user_model_id):
+	Convert definitions to standard C.
+
+2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
+
+	* gmake.defs (CHECKING_CFLAGS) [ENABLECHECKS]: Add -fno-crossjumping.
+
 2010-07-18  Juanma Barranquero  <lekktu@gmail.com>
 
 	* configure.bat: New option --enable-checking.
--- a/nt/INSTALL	Tue Jul 20 14:21:52 2010 +0000
+++ b/nt/INSTALL	Thu Jul 22 14:43:25 2010 +0000
@@ -1,5 +1,5 @@
-		      Building and Installing Emacs
-		on Windows NT/2K/XP and Windows 95/98/ME
+		    Building and Installing Emacs on Windows
+                          (from 95 to 7 and beyond)
 
   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
     Free Software Foundation, Inc.
@@ -158,7 +158,7 @@
         emacs source with text!=binary.
     [2] fails when needs to invoke shell commands; okay invoking gcc etc.
     [3] requires LC_MESSAGES support to build; cannot build with early
-        versions of cygwin.
+        versions of Cygwin.
     [4] may fail on Windows 9X and Windows ME; if so, install Bash.
     [5] fails when building leim due to the use of cygwin style paths.
         May work if building emacs without leim.
@@ -174,8 +174,8 @@
   like this, we recommend the use of the supported compilers mentioned
   in the previous paragraph.
 
-  You will also need a copy of the Posix cp, rm and mv programs.  These
-  and other useful Posix utilities can be obtained from one of several
+  You will also need a copy of the POSIX cp, rm and mv programs.  These
+  and other useful POSIX utilities can be obtained from one of several
   projects:
 
   * http://gnuwin32.sourceforge.net/              ( GnuWin32 )
@@ -183,13 +183,12 @@
   * http://www.cygwin.com/                        ( Cygwin   )
   * http://unxutils.sourceforge.net/              ( UnxUtils )
 
-  If you build Emacs on Windows 9X or ME, not on Windows 2K/XP or
-  Windows NT, we suggest to install the Cygwin port of Bash.  That is
-  because the native Windows shell COMMAND.COM is too limited; the
-  Emacs build procedure tries very hard to support even such limited
-  shells, but as none of the Windows developers of Emacs work on
-  Windows 9x, we cannot guarantee that it works without a more
-  powerful shell.
+  If you build Emacs on 16-bit versions of Windows (9X or ME), we
+  suggest to install the Cygwin port of Bash.  That is because the
+  native Windows shell COMMAND.COM is too limited; the Emacs build
+  procedure tries very hard to support even such limited shells, but
+  as none of the Windows developers of Emacs work on Windows 9X, we
+  cannot guarantee that it works without a more powerful shell.
 
   Additional instructions and help for building Emacs on Windows can be
   found at the Emacs Wiki:
@@ -224,7 +223,7 @@
 
   N.B.  It is normal to see a few error messages output while configure
   is running, when gcc support is being tested.  These cannot be
-  suppressed because of limitations in the Windows 9x command.com shell.
+  suppressed because of limitations in the Windows 9X command.com shell.
 
   You are encouraged to look at the file config.log which shows details
   for failed tests, after configure.bat finishes.  Any unexplained failure
@@ -249,6 +248,10 @@
   wrong.  (Usually, any such failures happen because some headers are
   missing due to bad packaging of the image support libraries.)
 
+  Note that any file path passed to the compiler or linker must use
+  forward slashes; using backslashes will cause compiler warnings or
+  errors about unrecognized escape sequences.
+
   To use the external image support, the DLLs implementing the
   functionality must be found when Emacs first needs them, either on the
   PATH, or in the same directory as emacs.exe.  Failure to find a
@@ -430,10 +433,10 @@
 
   The main problems that are likely to be encountered when building
   Emacs stem from using an old version of GCC, or old MinGW or W32 API
-  headers.  Additionally, cygwin ports of GNU make may require the Emacs
+  headers.  Additionally, Cygwin ports of GNU make may require the Emacs
   source tree to be mounted with text!=binary, because the makefiles
   generated by configure.bat necessarily use DOS line endings.  Also,
-  cygwin ports of make must run in UNIX mode, either by specifying
+  Cygwin ports of make must run in UNIX mode, either by specifying
   --unix on the command line, or MAKE_MODE=UNIX in the environment.
 
   When configure runs, it attempts to detect when GCC itself, or the
--- a/nt/addpm.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/nt/addpm.c	Thu Jul 22 14:43:25 2010 +0000
@@ -83,8 +83,7 @@
 };
 
 BOOL
-add_registry (path)
-     char *path;
+add_registry (char *path)
 {
   HKEY hrootkey = NULL;
   int i;
@@ -175,9 +174,7 @@
 }
 
 int
-main (argc, argv)
-     int argc;
-     char *argv[];
+main (int argc, char *argv[])
 {
   char start_folder[MAX_PATH + 1];
   int shortcuts_created = 0;
@@ -315,10 +312,10 @@
 		  if (SUCCEEDED (IPersistFile_Save (lnk, unicode_path, TRUE)))
 		    shortcuts_created = 1;
 		  IPersistFile_Release (lnk);
-		  
+
 		}
 	    }
-	}      
+	}
     }
 
   if (com_available)
--- a/nt/cmdproxy.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/nt/cmdproxy.c	Thu Jul 22 14:43:25 2010 +0000
@@ -407,7 +407,7 @@
 
 /* Return size of current environment block.  */
 int
-get_env_size ()
+get_env_size (void)
 {
   char * start = GetEnvironmentStrings ();
   char * tmp = start;
--- a/nt/ddeclient.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/nt/ddeclient.c	Thu Jul 22 14:43:25 2010 +0000
@@ -35,9 +35,7 @@
 		              CF_TEXT, XTYP_EXECUTE, 30000, NULL)
 
 int
-main (argc, argv)
-     int argc;
-     char *argv[];
+main (int argc, char *argv[])
 {
   DWORD idDde = 0;
   HCONV HConversation;
--- a/nt/gmake.defs	Tue Jul 20 14:21:52 2010 +0000
+++ b/nt/gmake.defs	Thu Jul 22 14:43:25 2010 +0000
@@ -200,7 +200,7 @@
 endif
 
 ifdef ENABLECHECKS
-CHECKING_CFLAGS	= -DENABLE_CHECKING -DXASSERTS
+CHECKING_CFLAGS	= -DENABLE_CHECKING -DXASSERTS -fno-crossjumping
 else
 CHECKING_CFLAGS	=
 endif
--- a/nt/runemacs.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/nt/runemacs.c	Thu Jul 22 14:43:25 2010 +0000
@@ -174,7 +174,8 @@
   return 1;
 }
 
-void set_user_model_id ()
+void
+set_user_model_id (void)
 {
   HMODULE shell;
   HRESULT (WINAPI * set_user_model) (wchar_t * id);
--- a/src/ChangeLog	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/ChangeLog	Thu Jul 22 14:43:25 2010 +0000
@@ -1,3 +1,24 @@
+2010-07-20  Juanma Barranquero  <lekktu@gmail.com>
+
+	* alloc.c (emacs_blocked_free, emacs_blocked_malloc)
+	(emacs_blocked_realloc, uninterrupt_malloc):
+	* fringe.c (w32_reset_fringes):
+	* image.c (convert_mono_to_color_image, lookup_rgb_color)
+	(init_color_table, XPutPixel, jpeg_resync_to_restart_wrapper):
+	* sound.c (be2hs, do_play_sound):
+	* vm-limit.c (get_lim_data, ret_lim_data):
+	* w32term.c (x_free_frame_resources):
+	* xfaces.c (x_create_gc, x_free_gc):
+	Convert definitions to standard C.
+
+2010-07-20  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* eval.c (Feval, Ffuncall): Use the new names.
+
+	* lisp.h (struct Lisp_Subr): Rename `am' to aMANY and add aUNEVALLED.
+	(DEFUN): Add braces around the union initialisation and use ## to
+	specify the right union alternative and avoid a cast.
+
 2010-07-18  Juanma Barranquero  <lekktu@gmail.com>
 
 	* makefile.w32-in ($(BLD)/keyboard.$(O)): Update dependencies.
--- a/src/alloc.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/alloc.c	Thu Jul 22 14:43:25 2010 +0000
@@ -1161,9 +1161,7 @@
 /* This function is used as the hook for free to call.  */
 
 static void
-emacs_blocked_free (ptr, ptr2)
-     void *ptr;
-     const void *ptr2;
+emacs_blocked_free (void *ptr, const void *ptr2)
 {
   BLOCK_INPUT_ALLOC;
 
@@ -1211,9 +1209,7 @@
 /* This function is the malloc hook that Emacs uses.  */
 
 static void *
-emacs_blocked_malloc (size, ptr)
-     size_t size;
-     const void *ptr;
+emacs_blocked_malloc (size_t size, const void *ptr)
 {
   void *value;
 
@@ -1260,10 +1256,7 @@
 /* This function is the realloc hook that Emacs uses.  */
 
 static void *
-emacs_blocked_realloc (ptr, size, ptr2)
-     void *ptr;
-     size_t size;
-     const void *ptr2;
+emacs_blocked_realloc (void *ptr, size_t size, const void *ptr2)
 {
   void *value;
 
@@ -1337,7 +1330,7 @@
 /* Called from main to set up malloc to use our hooks.  */
 
 void
-uninterrupt_malloc ()
+uninterrupt_malloc (void)
 {
 #ifdef HAVE_GTK_AND_PTHREAD
 #ifdef DOUG_LEA_MALLOC
--- a/src/eval.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/eval.c	Thu Jul 22 14:43:25 2010 +0000
@@ -2299,7 +2299,7 @@
       if (XSUBR (fun)->max_args == UNEVALLED)
 	{
 	  backtrace.evalargs = 0;
-	  val = (XSUBR (fun)->function.a1) (args_left);
+	  val = (XSUBR (fun)->function.aUNEVALLED) (args_left);
 	  goto done;
 	}
 
@@ -2325,7 +2325,7 @@
 	  backtrace.args = vals;
 	  backtrace.nargs = XINT (numargs);
 
-	  val = (XSUBR (fun)->function.am) (XINT (numargs), vals);
+	  val = (XSUBR (fun)->function.aMANY) (XINT (numargs), vals);
 	  UNGCPRO;
 	  goto done;
 	}
@@ -2968,7 +2968,7 @@
 
       if (XSUBR (fun)->max_args == MANY)
 	{
-	  val = (XSUBR (fun)->function.am) (numargs, args + 1);
+	  val = (XSUBR (fun)->function.aMANY) (numargs, args + 1);
 	  goto done;
 	}
 
--- a/src/fringe.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/fringe.c	Thu Jul 22 14:43:25 2010 +0000
@@ -1836,7 +1836,7 @@
 }
 
 void
-w32_reset_fringes ()
+w32_reset_fringes (void)
 {
   /* Destroy row bitmaps.  */
   int bt;
--- a/src/image.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/image.c	Thu Jul 22 14:43:25 2010 +0000
@@ -2560,10 +2560,8 @@
 }
 
 static void
-convert_mono_to_color_image (f, img, foreground, background)
-     struct frame *f;
-     struct image *img;
-     COLORREF foreground, background;
+convert_mono_to_color_image (struct frame *f, struct image *img,
+			     COLORREF foreground, COLORREF background)
 {
   HDC hdc, old_img_dc, new_img_dc;
   HGDIOBJ old_prev, new_prev;
@@ -4357,9 +4355,7 @@
 #else /* COLOR_TABLE_SUPPORT */
 
 static unsigned long
-lookup_rgb_color (f, r, g, b)
-     struct frame *f;
-     int r, g, b;
+lookup_rgb_color (struct frame *f, int r, int g, int b)
 {
   unsigned long pixel;
 
@@ -4374,7 +4370,7 @@
 }
 
 static void
-init_color_table ()
+init_color_table (void)
 {
 }
 #endif /* COLOR_TABLE_SUPPORT */
@@ -4492,10 +4488,7 @@
    stored in ximg->data.  */
 
 static void
-XPutPixel (ximg, x, y, color)
-     XImagePtr  ximg;
-     int x, y;
-     COLORREF color;
+XPutPixel (XImagePtr ximg, int x, int y, COLORREF color)
 {
   int width = ximg->info.bmiHeader.biWidth;
   int height = ximg->info.bmiHeader.biHeight;
@@ -6071,9 +6064,7 @@
 /* Wrapper since we can't directly assign the function pointer
    to another function pointer that was declared more completely easily.  */
 static boolean
-jpeg_resync_to_restart_wrapper (cinfo, desired)
-     j_decompress_ptr cinfo;
-     int desired;
+jpeg_resync_to_restart_wrapper (j_decompress_ptr cinfo, int desired)
 {
   return fn_jpeg_resync_to_restart (cinfo, desired);
 }
--- a/src/lisp.h	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/lisp.h	Thu Jul 22 14:43:25 2010 +0000
@@ -971,7 +971,8 @@
       Lisp_Object (*a6) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
       Lisp_Object (*a7) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
       Lisp_Object (*a8) (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object);
-      Lisp_Object (*am) (int, Lisp_Object *);
+      Lisp_Object (*aUNEVALLED) (Lisp_Object args);
+      Lisp_Object (*aMANY) (int, Lisp_Object *);
     } function;
     short min_args, max_args;
     const char *symbol_name;
@@ -1775,7 +1776,8 @@
   Lisp_Object fnname DEFUN_ARGS_ ## maxargs ;				\
   DECL_ALIGN (struct Lisp_Subr, sname) =				\
     { PVEC_SUBR | (sizeof (struct Lisp_Subr) / sizeof (EMACS_INT)),	\
-      (Lisp_Object(*)(void)) fnname, minargs, maxargs, lname, intspec, 0}; \
+      { .a ## maxargs = fnname },				\
+      minargs, maxargs, lname, intspec, 0};				\
   Lisp_Object fnname
 
 /* Note that the weird token-substitution semantics of ANSI C makes
--- a/src/sound.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/sound.c	Thu Jul 22 14:43:25 2010 +0000
@@ -522,8 +522,7 @@
    to host byte-order.  */
 
 static u_int16_t
-be2hs (value)
-     u_int16_t value;
+be2hs (u_int16_t value)
 {
 #ifndef WORDS_BIG_ENDIAN
   unsigned char *p = (unsigned char *) &value;
@@ -1209,7 +1208,8 @@
 }
 
 static void
-snd_error_quiet (const char *file, int line, const char *function, int err, const char *fmt)
+snd_error_quiet (const char *file, int line, const char *function, int err,
+		 const char *fmt)
 {
 }
 
@@ -1266,9 +1266,7 @@
   }
 
 static int
-do_play_sound (psz_file, ui_volume)
-     const char *psz_file;
-     unsigned long ui_volume;
+do_play_sound (const char *psz_file, unsigned long ui_volume)
 {
   int i_result = 0;
   MCIERROR mci_error = 0;
--- a/src/vm-limit.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/vm-limit.c	Thu Jul 22 14:43:25 2010 +0000
@@ -69,7 +69,7 @@
 #ifdef USG
 
 static void
-get_lim_data ()
+get_lim_data (void)
 {
   extern long ulimit ();
 
@@ -93,7 +93,7 @@
 #ifdef WINDOWSNT
 
 static void
-get_lim_data ()
+get_lim_data (void)
 {
   extern unsigned long reserved_heap_size;
   lim_data = reserved_heap_size;
@@ -104,7 +104,7 @@
 
 #ifdef MSDOS
 void
-get_lim_data ()
+get_lim_data (void)
 {
   _go32_dpmi_meminfo info;
   unsigned long lim1, lim2;
@@ -135,14 +135,14 @@
 }
 
 unsigned long
-ret_lim_data ()
+ret_lim_data (void)
 {
   get_lim_data ();
   return lim_data;
 }
 #else /* not MSDOS */
 static void
-get_lim_data ()
+get_lim_data (void)
 {
   lim_data = vlimit (LIM_DATA, -1);
 }
@@ -151,7 +151,7 @@
 #else /* BSD4_2 */
 
 static void
-get_lim_data ()
+get_lim_data (void)
 {
   struct rlimit XXrlimit;
 
--- a/src/w32term.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/w32term.c	Thu Jul 22 14:43:25 2010 +0000
@@ -5694,8 +5694,7 @@
 /* Free X resources of frame F.  */
 
 void
-x_free_frame_resources (f)
-     struct frame *f;
+x_free_frame_resources (struct frame *f)
 {
   struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
 
--- a/src/xfaces.c	Tue Jul 20 14:21:52 2010 +0000
+++ b/src/xfaces.c	Thu Jul 22 14:43:25 2010 +0000
@@ -726,10 +726,7 @@
 /* W32 emulation of GCs */
 
 static INLINE GC
-x_create_gc (f, mask, xgcv)
-     struct frame *f;
-     unsigned long mask;
-     XGCValues *xgcv;
+x_create_gc (struct frame *f, unsigned long mask, XGCValues *xgcv)
 {
   GC gc;
   BLOCK_INPUT;
@@ -743,9 +740,7 @@
 /* Free GC which was used on frame F.  */
 
 static INLINE void
-x_free_gc (f, gc)
-     struct frame *f;
-     GC gc;
+x_free_gc (struct frame *f, GC gc)
 {
   IF_DEBUG (xassert (--ngcs >= 0));
   xfree (gc);