--- alt/sql.el 2007-09-26 02:28:25.000000000 +0200 +++ neu/sql.el 2008-02-29 12:28:49.000000000 +0100 @@ -246,6 +246,12 @@ ;; These four variables will be used as defaults, if set. +(defcustom sql-automatic-login t + "Login from default values without query" + +:type 'boolean +:group 'SQL) + (defcustom sql-user "" "*Default username." :type 'string @@ -1929,37 +1935,40 @@ (defun sql-get-login (&rest what) "Get username, password and database from the user. - The variables `sql-user', `sql-password', `sql-server', and `sql-database' can be customized. They are used as the default values. Usernames, servers and databases are stored in `sql-user-history', `sql-server-history' and `database-history'. Passwords are not stored in a history. - Parameter WHAT is a list of the arguments passed to this function. The function asks for the username if WHAT contains symbol `user', for the password if it contains symbol `password', for the server if it contains symbol `server', and for the database if it contains symbol `database'. The members of WHAT are processed in the order in which they are provided. - In order to ask the user for username, password and database, call the function like this: (sql-get-login 'user 'password 'database)." (interactive) (while what (cond - ((eq (car what) 'user) ; user + ((eq (car what) 'user) ; user (setq sql-user - (read-from-minibuffer "User: " sql-user nil nil - sql-user-history))) - ((eq (car what) 'password) ; password + (if sql-automatic-login + sql-user + (read-from-minibuffer "User: " sql-user nil nil + sql-user-history)))) + ((eq (car what) 'password) ; password (setq sql-password - (sql-read-passwd "Password: " sql-password))) - ((eq (car what) 'server) ; server + (if sql-automatic-login + sql-password + (sql-read-passwd "Password: " sql-password)))) + ((eq (car what) 'server) ; server (setq sql-server - (read-from-minibuffer "Server: " sql-server nil nil - sql-server-history))) - ((eq (car what) 'database) ; database + (if sql-automatic-login + sql-server + (read-from-minibuffer "Server: " sql-server nil nil + sql-server-history)))) + ((eq (car what) 'database) ; database (setq sql-database (read-from-minibuffer "Database: " sql-database nil nil sql-database-history)))) Diff finished. Fri Feb 29 12:33:48 2008