I'm running Emacs on a linux system and the function user-full-name, when called with no arguments, always returns an empty string.

How can I fix this?

I assume it's something I need to configure on my user account, maybe an environment variable.

(The variable user-login-name works fine.)


The function user-full-name with no arguments returns the value of the variable user-full-name. This variable is initialised:

  • to the value of the environment variable NAME if it is defined; or
  • to the Gecos field of the passwd entry.

Therefore, you can do one of the following:

  • set the Gecos field of your passwd entry using one of the chfn or usermod commands;
  • set your user name in the NAME environment variable in your shell's initialisation file;
  • set the user-full-name variable in your Emacs' initialisation file.

Google is your friend. =/

$ chfn -f "Full Name"
  • Tsk Tsk, Malabarba. – nanny Dec 18 '14 at 21:44
  • @Gilles is that better? ☺ – Malabarba Dec 22 '14 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.