2

There command-line option -e behaves similar to the --eval option, but yet it is not the same. For example, of these two invocations, only the first one works:

emacs --eval '(global-linum-mode)'
emacs     -e '(global-linum-mode)'

And of these two invocations, only the second one works:

emacs --eval 'global-linum-mode'
emacs     -e 'global-linum-mode'

I had mistakenly assumed that -e was the "short form" for --eval based on this line from the manual:

There are two ways of writing options: the short forms that start with a single ‘-’, and the long forms that start with ‘--’. For example, ‘-d’ is a short form and ‘--display’ is the corresponding long form.

But as I noted, it has a behavior which differs from the long option. Is this mysterious -e option documented anywhere?

nispio
  • 8,175
  • 2
  • 35
  • 73

1 Answers1

5

It's a synonym for -f / --funcall, included for backwards compatibility.

The argument-handling code in command-line-1 says:

"-f"    ; what the manual claims
"-funcall"
"-e"))  ; what the source used to say
phils
  • 48,657
  • 3
  • 76
  • 115
  • So backward compatibility with a *mistake* in the old sources won out over [doing what the manual says](https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Invocation.html)? If they are going to keep this legacy cruft around, they should at least document it. `M-x report-emacs-bug`, here I come. Thanks for the answer. – nispio Oct 21 '14 at 23:27
  • Perhaps more useful than documentation of a deprecated option would be if Emacs generated a *warning* if `-e` is used, so that people have notice to make the change; then it could be safely removed in some subsequent release. – phils Oct 22 '14 at 04:04