linux - How to use unix login user names in Emacs lisp/config? -


i wondering if possible use current login user name in emacs config files (in elisp)?

for example, times username , default database postgresql database same current login unix/linux user name in many multi-user environment. when configuring emacs sql mode , supplying user , database connect to, following can used in emacs config.

(setq sql-postgres-login-params       '((user :default "postgres")         (database :default "postgres")         (server :default "localhost")         (port :default 5432))) 

how can replace username , database "postgres" value of $(whoami) in linux/unix?

that user-login-name. in case don't know, sure no write inside quoted list. can use backquote:

`((user :default ,user-login-name)) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -