5

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.)

2 Answers 2

9

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.
4

Google is your friend. =/

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.